-
Notifications
You must be signed in to change notification settings - Fork 1k
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 decomposition for CCZ gate and IonQTargetGateset when qubits are all-to-all connected #6095
Add decomposition for CCZ gate and IonQTargetGateset when qubits are all-to-all connected #6095
Conversation
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.
Please see my comment here - #6068 (comment)
Adding an alternative decomposition as done here is not enough because you would need a way to propagate the all_to_all_connect
flag through cirq.decompose
which is currently not supported.
Done. Thanks for the guidance. |
Requested changes done. Please review again. Thanks. @tanujkhattar |
Done |
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 % some final comments
@@ -217,6 +217,55 @@ def controlled( | |||
) | |||
|
|||
|
|||
def decompose_all_to_all_connect_ccz_gate( |
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.
Move this decomposition and corresponding test to cirq-ionq/cirq_ionq/ionq_gateset.py
.
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.
Done
"""If qubits are all-to-all connected, e.g. qubits in the same ion trap, | ||
the decomposition will be: |
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.
Summary line in the docstring should be a single line with <= 100 characters followed by an empty newline and then a detailed description if needed. Please update here and elsewhere
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.
Done. Thanks for the guide.
cirq-core/cirq/ops/__init__.py
Outdated
@@ -201,6 +201,7 @@ | |||
CCXPowGate, | |||
CCZ, | |||
CCZPowGate, | |||
decompose_all_to_all_connect_ccz_gate, |
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.
Remove from cirq/ops/__init__.py
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.
Done
Co-authored-by: Tanuj Khattar <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #6095 +/- ##
==========================================
- Coverage 97.37% 97.37% -0.01%
==========================================
Files 1116 1116
Lines 96042 96067 +25
==========================================
+ Hits 93524 93545 +21
- Misses 2518 2522 +4
☔ View full report in Codecov by Sentry. |
This PR is ready to merge @tanujkhattar Thanks! |
When the 3 qubits are all connected to each other, the decomposition can be further optimized #6068. Next step is to use all-to-all connectivity when decomposing circuits using
IonQTargetGateset
.