Fix deprecated behaviour in timeline drawer#10846
Merged
Merged
Conversation
Collaborator
|
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.
c8df0e6 to
55b774b
Compare
3 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
BitpropertiesBit.indexandBit.register. This is achieved by making it possible for generator functions to accept the completeQuantumCircuitprogram as a keyword argument, if they advertise that they can handle this by setting a specialaccepts_programattribute 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.indexandBit.registerfrom 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
DynamicalDecouplingpass's docstring.