Quantum State Preparation Using an Exact
CNOT Synthesis Formulation
Abstract
Minimizing the use of CNOT gates in quantum state preparation is a crucial step in quantum compilation, as they introduce coupling constraints and more noise than single-qubit gates. Reducing the number of CNOT gates can lead to more efficient and accurate quantum computations. However, the lack of compatibility to model superposition and entanglement challenges the scalability and optimality of CNOT optimization algorithms on classical computers. In this paper, we propose an effective state preparation algorithm using an exact CNOT synthesis formulation. Our method represents a milestone as the first design automation algorithm to surpass manual design, reducing the best CNOT numbers to prepare a Dicke state by 2. For general states with up to 20 qubits, our method reduces the CNOT number by 9% and 32% for dense and sparse states, on average, compared to the latest algorithms.
I Introduction
Quantum states preparation (QSP) is essential for compiling quantum algorithms [childs2000finding], implementing quantum communications [ben2005fast], studying quantum metrology [toth2012multipartite], and experimenting with quantum entanglement [horodecki2009quantum]. For decades, researchers have based QSP circuit designs on mathematical derivation [cruz2019efficient, bartschi2019deterministic, mukherjee2020preparing, aktar2022divide] and created them manually. Although efficient, the derived properties are specialized to a certain class of highly symmetric states, e.g., GHZ states [greenberger1989going], W states [dur2000three], and Dicke states [dicke1954coherence], and cannot be generalized.
Limitations of manual designs point us to the need to develop design automation algorithms. Recent works propose Boolean methods utilizing decision diagrams to prepare general -qubit states using CNOT gates [araujo2021divide, mozafari2019preparation, niemann2016logic]. By leveraging sparsity, the latest studies improve the efficiency and develop algorithms to prepare -qubit with nonzero amplitudes using CNOT gates [gleinig2021efficient, mozafari2022efficient, malvetti2021quantum]. However, these methods sacrifice optimality for efficiency, consuming more CNOT gates than manual designs.
The challenges of solving QSP on classical computers are the complexities of modeling superposition and entanglement [nielsen2010quantum]. Indeed, while classical computers store binary information, compute Boolean operators, and retrieve a single binary output, quantum computing processes high-dimensional state vectors with complex amplitudes that evolve with matrix multiplications. With superposition, the dimension of state vectors grows exponentially with the number of qubits. Therefore, only certain families of quantum states can be efficiently encoded using classical bits [aaronson2004multilinear, raz2009multi]. Besides, because of entanglement, the qubits in the states are inseparable. As a result, developing an effective divide-and-conquer approach for QSP problems is difficult.
In this paper, we propose an exact CNOT synthesis formulation for QSP. Our method encodes quantum states and gates on a graph and formulates QSP as a shortest path problem. Given an arbitrary quantum state and a library of available gates, our formulation provides full visibility of the solution space and is guaranteed to find the optimal circuit with minimal CNOT gates. For general states with up to qubits, our method reduces the CNOT number by and for dense and sparse states, on average, compared to the latest algorithms. Besides, our method represents a milestone as the first design automation algorithm to surpass manual design, reducing the best CNOT numbers to prepare a Dicke state by .
In the rest of the paper, we present the background in Section II and show an example to motivate our work in Section III. Then, we illustrate our shortest path problem formulation for QSP in LABEL:sec:formulation and introduce our specialized shortest path algorithm in LABEL:sec:algorithm. In LABEL:sec:evaluation, we demonstrate experimental results and evaluate our method.
II Background
In this section, we provide background for quantum state preparation. For clarity and space constraints, we refer readers to established sources for formal definitions of notations [nielsen2010quantum] and quantum gates[barenco1995elementary].
II-A Quantum States and Quantum Gates
We express the -qubit quantum state as a linear combination of orthonormal basis vectors.
where is the basis state, are amplitudes whose norm indicates the probability of observing , and is the index set, which represents the set of basis with nonzero amplitudes. The cardinality of a state is the number of elements in its index set, .
Quantum gates, or operators, denoted by , are unitary matrices representing transitions between quantum states. represents the set of all -qubit gates. This paper studies states with real amplitudes and restricts state transitions in the X-Z plane. Therefore, all single-qubit unitary matrices, , are Y rotations, , and all multi-qubit operators can be decomposed into gates in .
(1) |
where and are real numbers satisfying and is a rotation angle that satisfies .
We define CNOT cost of an operator as the number of CNOT gates to decompose . Quantum gates involved in this paper and their costs are listed in Section II-A, including Y rotations (R), CNOT, and multi-controlled Y rotations (MCR) gates. Note that the CNOT cost depends on the decomposition algorithm and the number of ancillary qubits [maslov2016advantages, mottonen2004quantum, saeedi2013linear]. This paper assumes an MCR gate with control qubit has a CNOT cost of .
Operators | R | CNOT | CR | MCR | ||||||
---|---|---|---|---|---|---|---|---|---|---|
|
& \Qcircuit@C=.3em @R=.5em \ctrl1 \qw \targ \qw \Qcircuit@C=.3em @R=.5em \ctrl1 \qw \qw \Qcircuit@C=.3em @R=.5em \ctrl1 \qw \ctrl1 \qw \gateR_y \qw CNOT cost 0 1 2 [mottonen2004quantum]
II-B Quantum Circuits for State Preparations
Given a state and a set of quantum gates , the quantum state preparation finds a quantum circuit comprising gates such that these gates map the ground state to the desired state , i.e., . For noisy intermediate-scale quantum (NISQ) computers, CNOTs introduce more noise than single-qubit gates. Therefore, the objective of QSP is to minimize the CNOT cost of the circuit, which is the sum of the gates’ CNOT costs.
III Motivating Example
Consider the problem of preparing the state , with which comprises three qubits with a cardinality of four. We demonstrate the quantum circuits generated by two categories of existing methods.
The first category of methods use qubit reduction [mozafari2019preparation, araujo2021divide]. These methods focus on one target qubit at each stage and apply MCR gates to separate it from the entanglement. As illustrated in Figure 1, the gates in the solid box separate , and the gates in the dashed box separate . The dashed and solid boxes have 1 and 2 control qubits, respectively, and require CNOT gates.
\Qcircuit@C=.7em @R=1em \lstickq_1: —0⟩ \gateR_y(π2) \ctrlo1 \ctrl1 \ctrlo1 \ctrl1 \qw\gategroup1324.5em–\gategroup1536.5em- \lstickq_2: —0⟩ \qw \gateR_y(π2) \gateR_y(π2) \ctrl1 \ctrlo1 \qw \lstickq_3: —0⟩ \qw \qw \qw \gateR_y(π) \gateR_y(π) \qw
Other related works perform cardinality reduction [gleinig2021efficient]. This method iteratively selects two different basis vectors from the index set and merges them using CNOT and controlled rotation gates. As depicted in LABEL:fig:cardinality-reduction, the circuit strictly reduces cardinality by one after each “merging” from right to left until , which is the ground state, . This circuit contains a single-qubit gate, three CNOTs, and two controlled Y-rotation gates. Therefore, the CNOT cost is .
\Qcircuit@C=.7em @R=1em \lstickq_1: —0⟩ \gateR_y(