Boolean circuits as gates#13333
Merged
Cryoris merged 16 commits intoQiskit:mainfrom Oct 31, 2024
Merged
Conversation
Collaborator
|
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
reviewed
Oct 17, 2024
Collaborator
Cryoris
left a comment
There was a problem hiding this comment.
Thanks for adding this! I left some small comments below 🙂
Cryoris
reviewed
Oct 30, 2024
Cryoris
reviewed
Oct 30, 2024
Cryoris
reviewed
Oct 30, 2024
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
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.