-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix deprecated behaviour in timeline drawer #10846
Merged
jakelishman
merged 1 commit into
Qiskit:main
from
jakelishman:fix-timeline-deprecated-bit
Oct 10, 2023
Merged
Fix deprecated behaviour in timeline drawer #10846
jakelishman
merged 1 commit into
Qiskit:main
from
jakelishman:fix-timeline-deprecated-bit
Oct 10, 2023
Conversation
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
jakelishman
added
Changelog: New Feature
Include in the "Added" section of the changelog
Changelog: Removal
Include in the Removed section of the changelog
mod: visualization
qiskit.visualization
labels
Sep 15, 2023
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 6207547275
💛 - Coveralls |
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.
jakelishman
force-pushed
the
fix-timeline-deprecated-bit
branch
from
September 16, 2023 13:04
c8df0e6
to
55b774b
Compare
jakelishman
removed
the
Changelog: Removal
Include in the Removed section of the changelog
label
Sep 16, 2023
3 tasks
1ucian0
approved these changes
Oct 10, 2023
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.
Thanks Jake!
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Oct 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Changelog: New Feature
Include in the "Added" section of the changelog
mod: visualization
qiskit.visualization
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This removes the year-old deprecation of attempting to use the timeline drawer to draw an unscheduled circuit.Internally, it removes all use of the deprecated
Bit
propertiesBit.index
andBit.register
. This is achieved by making it possible for generator functions to accept the completeQuantumCircuit
program as a keyword argument, if they advertise that they can handle this by setting a specialaccepts_program
attribute on themselves toTrue
. 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.Details and comments
Along with #10844, I believe this removes the last uses of
Bit.index
andBit.register
from the Terra code base. I'll follow up this (and that) PR with another that removes that warning skip from the test class (and any other warning skips that can be removed as well).I had to add a new "feature" to the timeline object generators to do this in a backwards-compatible manner, since the data model the generators were working from is just fundamentally incorrect in current Qiskit, and there has been no way to produce the exactly correct results ever since #5486.
This PR originally removed the long-deprecated code that scheduled unscheduled circuits on entry to the canvas program loader. However, that deprecation was done incorrectly and was currently not being shown to users, so it actually needs to go through a proper deprecation cycle. The deprecated behaviour is also being used in the
DynamicalDecoupling
pass's docstring.