-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add more classes for 2q synthesis to qiskit synthesis docs #11687
Conversation
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 7746292644
💛 - Coveralls |
two_qubit_cnot_decompose, | ||
TwoQubitWeylDecomposition, |
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.
A search through qiskit-community
showed that only these two objects are used. I'd suggest we use this as criterion and only add those classes to the API docs that are really needed 🙂
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.
I'm fine starting small, also looking at the code for all the specialized TwoQubitWeyl*
variants it looks like they're all used internally by __new__
when you create a new TwoQubitWeylDecomposition
object.
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.
TwoQubitWeylDecomposer
kind of implies that all the family classes are public in the sense of going to a lot of trouble to make a repr
that you can eval
back in (including pickling then b64'ing a Numpy array and making sure __new__
eats keywords that it throws in the repr
just to be pretty) (it's a very busy constructor). That said, I don't really think it's necessary to make those public at all - they're largely not meant to be accessed directly, I think, because of the abstract factory class.
Co-authored-by: Julien Gacon <gaconju@gmail.com>
I did a quick search through the code, and confirmed that the only intended public interfaces are probably what @Cryoris pointed out in his review comments. The other classes were either added for internal features (such as QSD) or were magically dispatched for |
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.
This is already tagged for merge, but here's a review basically to say I agree.
from .two_qubit.two_qubit_decompose import TwoQubitBasisDecomposer, two_qubit_cnot_decompose | ||
from .two_qubit.two_qubit_decompose import ( | ||
TwoQubitBasisDecomposer, | ||
two_qubit_cnot_decompose, |
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.
I think this two_qubit_cnot_decompose
is missing an .. autofunction::
in the docstring? If it's meant to be there, let's take a note to add it after rc1 - no need to hold up the PR over a documentation thing.
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.
Ah, yeah good catch I missed that in the original review. I'll open an issue to track this. It actually will likely require a full docstring addition as it's doesn't have anything there now: https://github.com/Qiskit/qiskit/blob/main/qiskit/synthesis/two_qubit/two_qubit_decompose.py#L1553
it's a lazy loaded instance of TwoQubitBasisDecomposer
using cx.
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.
I actually already opened #11709 for it - forgot to comment here.
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.
I also wasn't sure what to do with this function, since it has no docstring, and also due to the comment here:
# This weird duplicated lazy structure is for backwards compatibility; Qiskit has historically |
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 for taking care of this PR
two_qubit_cnot_decompose, | ||
TwoQubitWeylDecomposition, |
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.
TwoQubitWeylDecomposer
kind of implies that all the family classes are public in the sense of going to a lot of trouble to make a repr
that you can eval
back in (including pickling then b64'ing a Numpy array and making sure __new__
eats keywords that it throws in the repr
just to be pretty) (it's a very busy constructor). That said, I don't really think it's necessary to make those public at all - they're largely not meant to be accessed directly, I think, because of the abstract factory class.
…ion` This is a follow-up to the conversation at Qiskit/qiskit#11635 (comment). The toplevel package import was made available in Qiskit/qiskit#11687 in time for Qiskit 1.0.
…ion` (#547) This is a follow-up to the conversation at Qiskit/qiskit#11635 (comment). The toplevel package import was made available in Qiskit/qiskit#11687 in time for Qiskit 1.0.
Summary
Following the discussions in #11460, #11635 and #11672, we properly add some more classes for 2q synthesis to qiskit synthesis docs.
Details and comments