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
template library organization #5275
Comments
I would like to give this a try, @ajavadia. |
hi @born-2learn ! Sorry this felt between the cracks. Are you still interested? |
In addition, currently the picture of the circuit of the template appears as a comment in the code, but not in the documentation. |
I'll work on this, thanks! |
Assigned! Thanks @born-2learn |
Hi, I might have to delay working on this issue due to other engagements. Thanks! |
Hello @ajavadia |
I can also give it a try, but I need some guidance regrading how to arrange and classify all the circuits at once. |
The goal of this issue is to create a |
fyi: @ShellyGarion If I remember correctly, some of the clifford templates are only "up to the global phase", for instance the template I am wondering if this needs to be taken into account when reorganizing the templates. We also have code that verifies templates; and again please note that |
Yes. The context for this is this review comment when the original templates were added to Qiskit A "template", by definition, is a circuit that is equivalent to the identity. So there must be some check somewhere that prohibits defining invalid templates. The ones that ship with Qiskit should be verified with CI. The user-defined ones must be verified when they are being defined as a template. So one way to do this is to make this a proper datastructure/library that contains various templates and additions to the library are checked. And then have methods for drawing the contents of the library. Also a method to reduce the library to some subset of the circuits would be useful. Then let the TemplateMatching transpiler pass accept a library or a subset of it. And yes the equivalence to Identity should be exact including global phase. |
Clifford group elements and templates are defined up to a global phase, e.g. the template |
Is anyone working on this? |
Hi @poig, it seems to me there were some attempts to approach the issues, but no PR open yet. This issue is part of the unitary hack initiative so I think it is fine if more than one person works on this. So feel free to jump in :) |
The template circuits used in the template optimization pass are currently stored in a directory under
qiskit.circuit.library.templates
. It would be better to store them in a proper library structure like the EquivalenceLibrary, where each entry in the library can be verified for correctness.The text was updated successfully, but these errors were encountered: