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.
Fix deprecated behaviour in timeline drawer
Internally, it removes all use of the deprecated `Bit` properties `Bit.index` and `Bit.register`. This is achieved by making it possible for generator functions to accept the complete `QuantumCircuit` program as a keyword argument, if they advertise that they can handle this by setting a special `accepts_program` attribute on themselves to `True`. This somewhat convoluted setup is because the generator functions are supposed to be arbitrary and user-definable in custom stylesheets, so we cannot unilaterally change the call signature.
- Loading branch information
1 parent
7d9d32e
commit 55b774b
Showing
4 changed files
with
75 additions
and
26 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
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/timeline-visualisation-deprecated-bit-index-7277aa6e2a903cb7.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,7 @@ | ||
--- | ||
features: | ||
- | | ||
When defining a custom stylesheet for the pulse timeline drawer :func:`qiskit.visualization.timeline_drawer`, | ||
"generator" functions that have the object attribute ``accepts_program`` set to ``True`` will | ||
receive an extra keyword argument ``program`` containing the full scheduled | ||
:class:`.QuantumCircuit` being drawn. |
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