question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

qpy serialization for pulse schedule

See original GitHub issue

What is the expected behavior?

Currently we are missing a serialization format for pulse schedule, and this is necessary for the calibration module in qiskit experiments. However implementation is not straightforward.

  1. No standard We don’t have any de facto standard of schedule program representation. Currently we have two types of schedule representations Schedule and ScheduleBlock.
  • Schedule
    • Closer to hardware program representation. All instruction time is assigned, i.e. (t0, instruction).
    • Timing related parameters cannot be parametrized due to immediate timeslot evaluation (overlap constraint).
    • Still used in many community codebases (conventional representation).
    • Many util functions are supported (filter, pad, align_measure)
  • ScheduleBlock
    • Context rich representation of instruction timing, eg AlignLeft block, AlignRight block, etc…
    • We can stretch instruction duration. All instruction parameters can be parametrized with Parameter.
    • Used for the calibration module and the default output of pulse builder.
    • Need conversion to Schedule for execution.
  1. Still under (relatively) active development For example, we are trying to upgrade definition of channel with #5977 . This PR can change the program representation. This means we need to pay a lot of effort for backward compatibility in serialization/deserialization logic.

  2. Subroutine support Schedule programs support Call instruction, which is one of schedule instructions but refers to another program defined outside the scope of current program, i.e. subroutine (in the current implementation the instruction just entirely copies the subroutine, thus it just looks like a nested program). If we support such data structure, the serialization logic could become complicated.

Regarding the point 1, I’ve tried to unify the Schedule and ScheduleBlock by allowing the block to take an instruction time t0 (kind of soft scheduling) in #6444 . Eventually we can deprecate Schedule with this approach, but currently the pros/cons of this attempt is not well discussed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mtreinishcommented, Sep 10, 2021

Yeah, not preserving calibrations is a limitation with qpy currently, this is the tracking issue for it. To be able to serialize calibrations we need to have a representation for a pulse schedule. Once that exists preserving the calibrations should be trivial.

0reactions
mtreinishcommented, Jun 15, 2022

This isn’t closed yet, #7300 is needed before this is done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

QPY serialization ( qiskit.qpy )
The QPY serialization format is a portable cross-platform binary ... from qiskit import pulse, qpy with pulse.build() as schedule: pulse.play(pulse.
Read more >
Releases · Qiskit/qiskit-terra - GitHub
Adding variational Quantum Deflation Algorithm for computing higher energy states (#7747) · QPY schedule serialization (#7300) · Add grouping by full-operator ...
Read more >
Company pushes bullet 'serialization' to trace ammunition
Police who recover bullets from a crime scene could consult a database to find out who purchased them, when, and from where. Not...
Read more >
Qiskit/qiskit-terra: Qiskit Terra 0.19.1 | Zenodo
(#7383) (#7384) Add QPY serialization for PauliEvolutionGate (#7374) (#7382) ... pulse.rst 114 Bytes; qasm.rst 112 Bytes; qobj.rst 112 Bytes; qpy.rst 154 ...
Read more >
CN1771704A - Transmitter circuit, receiver circuit, clock data ...
Patent documentation 2: the spy opens flat 9-168147 communique ... in proper order different with described pulse-width signal; Serializer circuit, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found