Resource-tailored multi-controlled NOT implementation
Mentors: Adam Glos, Özlem Salehi
Mentors: Adam Glos, Özlem Salehi
Interns: Shraddha Aangiras, Ankit Khandelwal, Handy Kurniawan, Maha Haj Meftah, Rutvij Menavlikar, Owais Ishtiaq Siddiqui
Mentors
Adam Glos¹ ² ³
Özlem Salehi¹ ³
¹Institute of Theoretical and Applied Informatics, Polish Academy of Sciences
²Algorithmiq Ltd
³QWorld Association
Meet the Interns
Handy Kurniawan
University of Tartu
Ankit Khandelwal
Indian Institute of Science
maha haj meftah
University of Carthage
shraddha aangiras
RU PV College
Owais Siddiqui
COMSATS University Islamabad
Rutvij Menavlikar
IIIT Hyderabad
Index
What is MCT?
MCT stands for Multi Controlled Toffoli
NOT Gate
CNOT Gate
Toffoli Gate
5 Controlled
Toffoli Gate
What is MCT?
Toffoli Gate and its Decomposition
- MCT is a very common gate used in various algorithms.
- Various decompositions are given in the literature but are not readily available to the end user.
- Only a few implementations exist in quantum computing libraries, but these do not account for the user's resources.
Motivation
Create a python library that chooses the best implementation given the number of controls and the specified resources.
- We considered ~25 papers to look at various decompositions present in the literature.
- Different decompositions focus on different resources like T gate count, CNOT count, total gate count, circuit depth, T gate depth and ancilla qubit count.
- Different decompositions also use different basis gates like Clifford+T, NCV, NCVW etc.
Literature Review
We have created a concise summary of most of the papers we considered.
Literature RevieW Cont.
We also looked at various implementations present in quantum computing libraries like Qiskit, Pennylane, Pyquil, Cirq, etc.
Library | Method | Control Qubits | Ancilla Qubits |
Cost |
---|---|---|---|---|
Qiskit | Recursive | n | 1 |
|
V-chain | n | n-2 | 6n-6 | |
V-chain dirty | n | n-2 | 12n-22 | |
No ancilla | 5, 6, 7 | 0, 0, 0 | 92, 188, 764 | |
Cirq | Decompose multi controlled X | 5, 6, 7 | 3, 4, 5 (two less than control qubits) | 37, 54, 120 |
Pennylane | Split and V-chain | n | 1 | 48(n-3) |
Pyquil uses block encoding of matrices to implement complex gates like MCX.
- Most implementations present in libraries are based on Elementary gates for quantum computation¹.
- There are better decompositions available depending on resource requirements but are not implemented.
- Linear depth decompositions are known but have not been implemented.
- Huge resource savings are possible.
Findings
¹Barenco, A., Bennett, C., Cleve, R., DiVincenzo, D., Margolus, N., Shor, P., Sleator, T., Smolin, J., & Weinfurter, H. (1995). Elementary gates for quantum computation. Phys. Rev. A, 52, 3457–3467.
Qumcat
Quantum Multi Controlled Not Automated Toolkit (QUMCAT) is a python library to provide the best implementation for an MCT gate given the number of controls and available resources like depth, count or ancilla qubits.
Features
- make_mct
- generate_mct_cases
- ...
qumcat
features: make_mct
QUMCAT
Linear Depth
Log Depth
No Ancilla
Variable Ancilla
control
ancilla
target
Features: generate_mct_cases
Unitary matrix from Qiskit MCT implementation of 'noancilla'
Unitary matrix from qumcat implementation
testing
- No ancilla
- Clean ancilla
- Dirty ancilla
- Clean-wasted ancilla
method
Testing - No Ancilla
MCT
Relative-phase MCT
to remove the global phase
absolute here is applied element-wisely
example of MCT with 2 controls
example of Relative-phase MCT with 2 controls
Testing - Clean ancilla
MCT
Relative-phase MCT
The projection is needed since we are only interested in the control + target qubit conditioned ancilla enters and leaves at \(|0_A\rangle\)
then the new unitary matrix is tested with the same procedure as 'noancilla'
Ancilla qubits should be initialized as all-zero state and remain the same after the application of MCT.
Testing - dirty ancilla
Ancilla qubits are arbitrary states, but the state is left "the same" after the application of MCT, i.e., applying Identity Gate
In MCT case, the generated unitary matrix is "the same" as tensoring 'no ancilla' unitary matrix with the identity matrix
MCT
Testing - dirty ancilla
Relative-phase MCT
Any relative-phase Toffoli can be written as
Since \(\tilde{U}\) should act trivially on ancilla, and with \(U^R_{MCT}\) on the controls and target, the test should take the form
diagonal unitary matrix
for some \(D^R\). Then construct the following operator:
After constructing the operator, the testing for relative-phase Toffoli takes this form:
Testing - clean-wasted ancilla
5
Test
4
Implement
6
Launch v0.1
Planned Work
1
Conception
3
Prioritize decompositions
2
Literature Review
7
Paper
A.G. has been partially supported by National Science Center under grant agreements 2019/33/B/ST6/02011, and 2020/37/N/ST6/02220. O.S. acknowledges support from National Science Center under grant agreement 2019/33/B/ST6/02011. We also thank Ryszard Kukulski for valuable discussions.
References
Acknoledgements
Barenco, A., Bennett, C., Cleve, R., DiVincenzo, D., Margolus, N., Shor, P., Sleator, T., Smolin, J., & Weinfurter, H. (1995). Elementary gates for quantum computation. Phys. Rev. A, 52, 3457–3467.
Thank You
- Linear depth (1-auxiliary)
- Log depth ([n-2]-auxiliary)
- No auxiliary
- Variable auxiliary
- many more...
Implementations
- No ancilla
- Clean ancilla
- Dirty ancilla
- Clean-wasted ancilla
Testing
Features
Literature RevieW Cont.
A short summary of some of the papers whose decompositions were optimal.
Paper | Section | Control Qubits | Ancilla Qubits | Gate Cost |
---|---|---|---|---|
Barenco et al. | Corollary 7.4 | n | 1 | 48(n-3) |
Balauca et al. | 4.1 (One clean ancilla) | n | 1 (clean ancilla) | 8(4n-13) |
A graph representing gate cost for single ancilla decomposition methods used by Barenco et al., Balauca et al. and qiskit:
P19
By Ankit Khandelwal
P19
- 63