Fix deprecated behaviour in timeline drawer #10846
Merged
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.