-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Boolean circuits as gates #13333
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
Boolean circuits as gates #13333
Conversation
|
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 11595891469Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Cryoris
left a comment
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 adding this! I left some small comments below 🙂
Cryoris
left a comment
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.
LGTM, thank you!
Summary
Part of #13046. Adds the following
Gateclasses in addition to existingQuantumCircuitclasses:AndGateforANDOrGateforORBitwiseXorGateforXORInnerProductGateforInnerProductDetails and comments
To be honest, the difference between an
AndGategate and anANDquantum circuit is rather small. In addition to the general consistency pursued by #13046, it might be just a tiny bit more ergonomic to typeqc.append(AndGate(5), [0, 1, 2, 3, 4, 5])rather thanqc.append(AND(5).to_gate(), [0, 1, 2, 3, 4, 5]), and the first circuit has one less level of nestedness than the second (in the former case it takes one call todecomposeto see the definition circuit, and in the latter case - two). This applies to all 4 gates.Actually, another benefit for
AndGateandOrGateis that as their definitions are built on top of MCX gates, we are able to use all the synthesis methods that leverage ancilla qubits via the "mcx" plugin mechanism.