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
Adam Glos¹ ² ³
Özlem Salehi¹ ³
¹Institute of Theoretical and Applied Informatics, Polish Academy of Sciences
²Algorithmiq Ltd
³QWorld Association
University of Tartu
Indian Institute of Science
University of Carthage
RU PV College
COMSATS University Islamabad
IIIT Hyderabad
MCT stands for Multi Controlled Toffoli
NOT Gate
CNOT Gate
Toffoli Gate
5 Controlled
Toffoli Gate
Toffoli Gate and its Decomposition
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.
¹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.
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.
QUMCAT
Linear Depth
Log Depth
No Ancilla
Variable Ancilla
control
ancilla
target
Unitary matrix from Qiskit MCT implementation of 'noancilla'
Unitary matrix from qumcat implementation
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
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.
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
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:
Test
Implement
Launch v0.1
Conception
Prioritize decompositions
Literature Review
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.
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.
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: