Draft
Conversation
- Add detailed docstrings with warnings about where not to use them.
…`qubit_properties` initializers.
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
The following commits remove the redundant mappings `gate_name_map` and `angle_bounds` in favor of one mapping with a struct that contains all of that data. This results in a much lighter `Target` going from 504 (0x1F8) bytes to 288 bytes. The new struct called `TargetProperties` is currently internal-only. And contains three fields. - `properties` containing the mapping of the qargs and instruction properties (originally the `gate_map`). - `instruction` containing the `TargetOperation` (originally the `gate_name_map`). - `angle_bounds`: Optionally containing the angle bounds for the ``Target`` (originally `angle_bounds`.) This is the first effort to more efficiently use the ``Target`` in Rust with upcoming efforts focusing on its behavior on Python. Fix: Remove clippy unused
- Remove duplicate methods in Python. - Revert changes to `Target` python class subclassing.
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
Based on top of #14308 and #15349.
Details and comments
This is the first part of the effort to split the Python version of Target from the Rust version, this PR does the internal split between
PyTarget(PyO3) andTarget(Rust).The next step is to prevent the Python target from subclassing the Rust version of it. A better approach might end up just moving all of the functionality to the PyO3 struct since they are so intertwined.
To-do list: