forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for pulse reference to QPY (Qiskit#9890)
* Add support pulse reference to QPY * Review comments Co-authored-by: Matthew Treinish <mtreinish@kortar.org> --------- Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
- Loading branch information
1 parent
131b287
commit e4c8488
Showing
7 changed files
with
235 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
releasenotes/notes/add-support-for-qpy-reference-70478baa529fff8c.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
with open('template_ecr.qpy', 'wb') as fd: | ||
qpy.dump(schedule, fd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.