-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for pulse reference to QPY #9890
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
from qiskit.qpy import formats | ||
|
||
QPY_VERSION = 6 | ||
QPY_VERSION = 7 | ||
ENCODE = "utf8" | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
features: | ||
- | | ||
QPY supports pulse :class:`~.ScheduleBlock` with unassigned reference, | ||
and preserves the data structure for the reference to subroutines. | ||
This feature allows to save a template pulse program for tasks such as pulse calibration. | ||
|
||
.. code-block:: python | ||
|
||
from qiskit import pulse | ||
from qiskit import qpy | ||
|
||
with pulse.build() as schedule: | ||
pulse.reference("cr45p", "q0", "q1") | ||
pulse.reference("x", "q0") | ||
pulse.reference("cr45p", "q0", "q1") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another note. @mtreinish could you also replace this with
cr45"p" -> cr45"m" when you cleanup the release note? This is just a typo but not critical. Usually ECR pulse sequence has negative rotation (subscripted with "m") on the second pulse. |
||
|
||
with open('template_ecr.qpy', 'wb') as fd: | ||
qpy.dump(schedule, fd) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A note to myself (or anyone who is doing release notes) we should have an upgrade release note here about bumping to version 7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have QPY function to write mapping object here.