-
Notifications
You must be signed in to change notification settings - Fork 631
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
Better MCX Decomposition with logarithmic Toffoli Depth #7028
base: master
Are you sure you want to change the base?
Conversation
@albi3ro I have a draft ready and am currently working on the tests. The implementation for dirty and clean only differs in terms of uncomputing certain gates. Long term, it would be great to have the compiler find dirty wires and call the appropriate decomposition function because finding clean wires is much stricter condition than reusing other wires of larger circuit as dirty wires. |
Thanks for opening this @patelvyom 👍 I'll try and take a look at it on Monday. |
This pull request is nearly ready to merge. The main open question is whether Summary of Changes:
|
Context:
The recent paper Rise of conditionally clean ancillae for optimizing quantum circuits presents an improved decomposition of MCX gates using conditionally clean ancilla qubits. The proposed method achieves the following trade-offs in terms of Toffoli gate count and circuit depth:
This approach is currently optimal regarding Toffoli count (for 1 and 2 ancillae) and significantly improves circuit depth.
Description of the Change:
Added
_decompose_mcx_with_two_workers
and_decompose_mcx_with_one_worker_kg24
decompositions.Benefits:
Extend support to:
len(work_wires) == 2
, enabling a more efficient decompositionlen(work_wires) == 1
, reducing circuit depth.Related GitHub Issues:
Implements #6997