-
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.
Improve deprecation of unit and duration (#13247)
* Improve deprecation of unit and duration The unit and duration attributes of QuantumCircuit and Instruction were introduced in #13224 however the way the PR went about this was a bit to abbreviated and it had several downsides. The most noticable was that it introduced a significant runtime regression as the rust internals were accessing the deprecated getter. This is fixed so that the rust code doesn't try to access any deprecated attributes. However, more importantly there were several edge cases not accoutned for in the PR. Mainly, DAGCircuit's matching attribute were not deprecated, but then also specific use cases of the attributes were not addressed. The primary driver of the per instruction duration and unit were the timeline visualization which didn't have a method to function without these data attributes. This commit addresses this by adding a new target argument that is used to provide a backend's target which is the source of truth for durations in a post unit/duration `Instruction`. The other notable edge case is the `Delay` instruction which will need to retain the duration and unit attributes as the fields are integral for that instruction. The `Delay` is updated to handle them explicitly outside of the `Instrution` data model to avoid complications around the deprecation. * Apply suggestions from code review Co-authored-by: Elena Peña Tapia <[email protected]> * Fix lint * Mention the target in constructor deprecation message --------- Co-authored-by: Elena Peña Tapia <[email protected]>
- Loading branch information
Showing
11 changed files
with
187 additions
and
49 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 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 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.