-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup timeline drawer with schedule analysis pass. (#7935)
* Cleanup timeline and add schedule info to scheduled circuit. * review comment * fix bug * review comments Co-authored-by: Matthew Treinish <[email protected]> * lint * disable cyclic import lint check (likely a bug) * fix import path * Revert "fix import path" This reverts commit 1fa5382. * fix bug * add deprecation for unscheduled circuit drawing Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5f77531
commit 7391168
Showing
9 changed files
with
152 additions
and
390 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
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 was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
releasenotes/notes/cleanup-timeline-drawer-a6287bdab4459e6e.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,33 @@ | ||
--- | ||
features: | ||
- | | ||
New attribute :attr:`op_start_times` has been added to :class:`~QuantumCircuit`. | ||
This information is populated when one of scheduling analysis passes is run on the circuit. | ||
It can be used to obtain circuit instruction with instruction time, for example: | ||
.. code-block:: python | ||
from qiskit import QuantumCircuit, transpile | ||
from qiskit.test.mock import FakeMontreal | ||
backend = FakeMontreal() | ||
qc = QuantumCircuit(2) | ||
qc.h(0) | ||
qc.cx(0, 1) | ||
qct = transpile( | ||
qc, backend, initial_layout=[0, 1], coupling_map=[[0, 1]], scheduling_method="alap" | ||
) | ||
scheduled_insts = list(zip(qct.op_start_times, qct.data)) | ||
fixes: | ||
- | | ||
Time misalignment bug of drawing classical register with :func:`~timeline_drawer` | ||
has been fixed. Now classical register slots are drawn at correct position. | ||
deprecations: | ||
- | | ||
Calling :func:`~timeline_drawer` with unscheduled circuit has been deprecated. | ||
All circuits, e.g. even though one consisting only of delay instructions, | ||
must be transpiled with ``scheduling_method`` option to generate | ||
schedule information being stored in :attr:`QuantumCircuit.op_start_times`. |
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
Oops, something went wrong.