arXiv:1011.2159v1 [quant-ph] 9 Nov 2010
BLOCK-BASED QUANTUM-LOGIC SYNTHESIS
Mehdi Saeedi, Mona Arabzadeh, Morteza Saheb Zamani, Mehdi Sedighi
Quantum Design Automation Lab
Department of Computer Engineering and Information Technology
Amirkabir University of Technology
Tehran, Iran
{msaeedi, m.arabzadeh, szamani, msedighi}@aut.ac.ir
The first two authors contributed equally to this work.
Abstract
In this paper, the problem of constructing an efficient quantum circuit for the implementation of
an arbitrary quantum computation is addressed. To this end, a basic block based on the cosine-sine
decomposition method is suggested which contains l qubits. In addition, a previously proposed quantumlogic synthesis method based on quantum Shannon decomposition is recursively applied to reach unitary
gates over l qubits. Then, the basic block is used and some optimizations are applied to remove redundant
gates. It is shown that the exact value of l affects the number of one-qubit and CNOT gates in the proposed
method. In comparison to the previous synthesis methods, the value of l is examined consequently to
improve either the number of CNOT gates or the total number of gates. The proposed approach is further
analyzed by considering the nearest neighbor limitation. According to our evaluation, the number of
CNOT gates is increased by at most a factor of 35 if the nearest neighbor interaction is applied.
1
Introduction
The promise of exponential speed up of quantum algorithms [1–3] running on quantum computers has intensified the attempts for using quantum algorithms in real world problems. Besides that, the ability of quantum
computation in simulating quantum-mechanical effects (QMEs) further increases its attraction. Classical computation has inherent limitations to simulate QMEs [4]. Due to the ability of quantum computation in solving
several applications efficiently [5], numerous efforts have been made to study various aspects of quantum
computation and a set of quantum technologies has been proposed to build a scalable quantum computer [6].
Aside from different technological characterizations, quantum computations provided by all of the proposed
quantum technologies can be described in terms of linear operators (i.e., matrices) in Hilbert space. In this
sense, any quantum computation involves evolution of an initial quantum state under a series of elementary
unitary transformations [7–10]. It has been shown that any unitary transformation can be exactly realized
if the set of single qubit operations plus CNOT are allowed as the elementary gates [9, 11]. As CNOT needs
interactions between two qubits which are usually much weaker than the interactions between a single qubit
and classical control fields, producing fewer CNOT gates is more favorable generally. At the same time,
reducing the number of one-qubit gates to improve the total synthesis cost is an active research field.
Synthesis of an arbitrary unitary matrix from a universal set of gates including one-qubit operations and
CNOTs has a rich history. Barenco et al. in 1995 [9] showed that the number of CNOT gates required to
implement an arbitrary unitary matrix over n qubits was O(n3 4n ). In [12], it was shown that applying the
QR decomposition of matrix algebra could lead to the same result. In 1995, Knill reduced the number of
CNOT gates to O(n4n ) [13]. In 2004, Shende et al. found the highest known lower bound on the number of
CNOT gates as ⌈ 41 (4n − 3n − 1)⌉ [14]. The process of reducing the number of CNOT gates was continued
by Vartiainen et al. in [15] which led to O(4n ) CNOT gates. Later, a decomposition method based on the
cosine-sine matrix decomposition, called CSD, was proposed which produced 4n − 2n+1 CNOT gates [16].
1
In [17] uniformly controlled one-qubit gates were used by Bergholm et al. in CSD method which resulted in
1 n
1 n
1 n
1 n
2 4 − 2 2 − 2 CNOT gates and 2 4 + 2 2 − n − 1 one-qubit gates. Another quantum circuit decomposition,
called NQ decomposition, based on CS decomposition was introduced by Shende et al. [18] which leads to
1 n
3 n
2 4 − 2 2 + 1 CNOT gates. Next, Möttönen and Vartiainen in [19] reduced the number of CNOT gates to
3 n
4
23 n
48 4 − 2 2 + 3 by improving the results of [18]. By using the idea of quantum Shannon decomposition (QSD)
and some circuit identities, the authors of [20] reached the same number of CNOT gates. In [21], an algorithm
was proposed that translated a unitary matrix into a quantum circuit according to the KAK decomposition
in Lie group theory. Their results showed that any matrix decomposition corresponding to type-AIII KAK
decompositions could be derived according to the given Cartan involution by applying the method of [21].
Most recently, Drury and Love placed the QSD into a Lie algebraic context. Their results showed that QSD
is an alternating series of Cartan decompositions [22].
Besides the significant attempts made in improving the worst-case number of CNOT gates and one-qubit
gates required to implement an arbitrary unitary matrix, efforts have been made to improve the number of
one-qubit gates and CNOTs for specific matrices with applications in the synthesis of an arbitrary matrix. It
has been shown that three CNOT gates are necessary and sufficient to implement an arbitrary 2-qubit unitary
matrix in the worst case [23], [24], [25]. In addition, seven one-qubit gates are reported to be sufficient by
three CNOT gates for implementing an arbitrary 2-qubit unitary matrix [23]. In [26], a new quantum gate,
B, was introduced and applied to synthesize a generic two-qubit operation. It has been shown that two B
gates with at most six single-qubit gates implement any arbitrary two-qubit quantum operation [26]. On the
other hand, a decomposition algorithm which leads to 40 CNOT gates was proposed in [27] for an arbitrary
quantum circuit with 3 qubits. Currently, it appears that the best known quantum circuit for a 3-qubit
matrix requires 20 CNOTs [20] whereas the lower bound is 14 [14]. The synthesis of an n-qubit Toffoli gate
was studied in [28] where the authors showed that an n-qubit Toffoli gate requires at least 2n CNOT gates
and for n = 3, their CNOT-cost (i.e., 6) is optimal. On different directions, synthesis of a diagonal matrix
and optimal realization of controlled unitary gates were studied in [29] and [30], respectively. The problem of
preparing an arbitrary quantum state starting from a given state was discussed in some papers [17, 20, 31].
In this paper, the synthesis of an arbitrary unitary matrix over n qubits is addressed. To this end, the
QSD method is used to synthesize a given unitary transformation first. Then, by determining an appropriate
decomposition level, unstructured unitary matrices in the resulted decomposed circuit are replaced with blocks
synthesized by CSD method equipped by some optimizations. We show that the decomposition level can be
selected to trade off the number of CNOT gates against one-qubit gates in the proposed decomposition method.
The remainder of the paper is organized as follows. In Section 2 basic concepts are explained. The
proposed synthesis approach is introduced in Section 3 followed by considering the number of CNOT and
one-qubit gates resulted from the proposed approach in Section 4. The nearest neighbor implementation of
our synthesis method is evaluated in Section 5 and finally, Section 6 concludes the paper.
2
Preliminaries
In this section, the basic concepts and notations used in the rest of the paper are introduced and explained.
2.1
Quantum Bits
A quantum bit, qubit in short, like its classical counterpart can be realized by a physical system such as a
photon. In this paper, we treat a qubit as a mathematical object which represents a quantum state with two
basic states |0i and |1i. A qubit can get any linear combination of its basic states, called superposition, as
shown in (1) where α and β are complex numbers.
|ψi = α|0i + β|1i
(1)
Although a qubit can get any linear combination of its basic states, when a qubit is measured, its state
collapses into the basis |0i and |1i with the probability of |α|2 and |β|2 , respectively and we have |α|2 +|β|2 = 1.
T
It is also common to denote the state of a single qubit by a 2 × 1 vector as [α β] in Hilbert space H where
2
superscript T stands for the transpose of a vector. A quantum system which contains n qubits is often called
a quantum register of size n in the context of quantum computation. More precisely, an n-qubit quantum
register can be described by an element |ψi = |ψ1 i ⊗ |ψ2 i ⊗ . . . ⊗ |ψn i in the tensor product Hilbert space
H = H 1 ⊗ H2 ⊗ · · · ⊗ H n .
2.2
Quantum Gates and Circuits
An n-qubit quantum gate is a device which performs a specific 2n × 2n unitary operation on selected n qubits
in a specific period of time. A matrix U is unitary if U U † = I where U † is the conjugate transpose of U and
I is the identity matrix. An arbitrary unitary gate over n qubits with a generic 2n × 2n matrix is represented
as U (2n ) in this paper. Previously, various quantum gates with different functionalities have been introduced.
For example, the θ rotation gates (0 ≤ θ ≤ 2π) around the x, y and z axes acting on one qubit are defined as:
−iθ
sin θ2
0
cos θ2
e 2
cos θ2 i sin θ2
,
R
(θ)
=
,
R
(θ)
=
Rx (θ) =
y
z
i sin θ2 cos θ2
− sin θ2 cos θ2
0
e iθ
2
A square matrix is called diagonal if the entries outside the main diagonal are all zero. In other words,
an n × n matrix ∆ = (δi,j ) is diagonal if δi,j = 0, i 6= j, 1 ≤ i, j ≤ n. For example, Rz (θ) gate is a diagonal
2 × 2 matrix. A generic diagonal gate over n qubits is represented by a 2n × 2n unitary diagonal matrix. A
diagonal gate over n qubits is denoted as ∆n throughout this paper.
A block matrix is a partition of a matrix into rectangular smaller matrices called blocks. A block diagonal
matrix is a block square matrix whose main diagonal blocks are square matrices. Hence, the blocks outside
the main diagonal are zero matrices. A block diagonal matrix has the form shown in (2) where each Ui (2m )
is a 2m × 2m matrix. The inverse of a block diagonal matrix is also block diagonal which is composed of
the inverse of each block. A quantum gate Bτs (U (2m )) over n qubits with m targets denoted by the set τ
and s = n − m select qubits on the most significant qubits has a block diagonal matrix [20] represented by
B(U (2m )) in this paper. In the case of only one target line (i.e., m = 1), the specific target line is shown
instead of the set τ . From the quantum circuit point of view, for a gate Bτs (U (2m )) over n qubits with matrix
B(U (2m )) shown in (2), the matrix of Ui (2m ) (1 ≤ i ≤ 2n−m ) is applied to the target qubits where the index
i depends on the values of s = n − m select qubits [20]. In this paper, a select qubit in a circuit is denoted by
✷ as in [20].
U1 (2m )
0
···
0
0
U2 (2m ) · · ·
0
m
B(U (2 )) =
(2)
.
..
..
.
.
.
.
.
.
.
0
0
· · · U2n−m (2m )
The unitary matrix implemented by several gates acting on different qubits independently can be calculated
by the tensor product ⊗ of their matrices. Two or more quantum gates can be cascaded to construct a quantum
circuit. For a set of k gates g1 , g2 , ..., gk cascaded in a quantum circuit C in sequence, the matrix of C can
be calculated as Mk Mk−1 ...M1 where Mi is the matrix of the ith gate (1 ≤ i ≤ k).
Quantum circuits are often synthesized using a “basic gate” library [9] which contains CNOT and onequbit gates. In contrast, an “elementary gate” library was used in [29] which contains CNOT and one-qubit
rotation gates. The gate CNOT acts on two qubits (control and target) where the state of the target qubit is
inverted if the control qubit holds the state |1i. A CNOT gate with control c and target t is denoted as C c,t in
this paper. Since every gate in the elementary library is a basic gate and every basic gate can be decomposed
into at most three elementary gates (see Section 2.3), the Ω(gate count), O(gate count), and Θ(gate count) in
either gate library are identical. In this paper, the basic gate library is applied to synthesize a given unitary
matrix as discussed in Section 3.
3
2.3
Quantum Circuit Decomposition
Two quantum circuits are equivalent if matrix products of their gates are identical. In order to synthesize a
given unitary matrix, equivalent circuits may be applied to simplify the circuit. To do this, various quantum
circuit identities have been proposed in recent years (for examples see [32], [11], [33], [20]).
An arbitrary one-qubit gate U (2) can be decomposed into Rz and Ry rotation gates (called ZYZ decomposition) as shown in (3) [9]. Hence, a one-qubit computation from the basic gate library can be implemented
as a sequence of at most three gates from the elementary gate library.
U (2) = Rz (α)Ry (β)Rz (λ)
(3)
Cosine-sine decomposition [34] for a 2n × 2n unitary matrix U can be expressed by (4) where L1 , L2 , R1 ,
and R2 are unitary 2n−1 × 2n−1 matrices and C and S are unitary 2n−1 × 2n−1 diagonal matrices with real
elements such that C 2 + S 2 = In−1 (In−1 is the identity matrix over n − 1 qubits).
L1 0
C S
R1 0
U=
(4)
0 L2
−S C
0 R2
In the following, two quantum synthesis algorithms which are based on the cosine-sine decomposition
method are described and used in the rest of the paper.
2.3.1
CSD
In [16], a decomposition algorithm, called CSD, was proposed which uses the cosine-sine decomposition to
decompose a generic U (2n ). The CSD decomposition was further improved in [17] where the cosine-sine
decomposition is recursively applied on each block diagonal gate. This process is stopped when there are
only one-qubit block diagonal gates. More precisely, the CSD decomposition of a generic U (2n ) matrix can
be expressed by (5) where γ(i) is the ruler function introduced in [35] (γ(i)+1 is the position of the least
significant nonzero bit in the binary representation of i).
n
U (2 ) =
Bnn−1 (U (2))
2n−1
Y−1
n−1
Bn−γ(i)
(Ry )Bnn−1 (U (2))
(5)
i=1
Each block diagonal gate that appears in (5) can also be decomposed into a circuit which contains three
block diagonal gates of smaller sizes and one CNOT gate [17]. Equation (6) shows the decomposition for a
Bnn−1 (U (2)).
Bnn−1 (U (2)) = Bnn−2 (U (2))C 1,n Bnn−2 (U (2))B1n−1 (Rz )
(6)
Applying the recursive decompositions given in (6) leads to a circuit with 2n−1 − 1 CNOTs and 2n−1
one-qubit gates followed by a diagonal gate ∆n where ∆n can also be decomposed into 2n − 2 CNOTs [29].
Figure 1 illustrates the result of [17] for a block diagonal circuit with 4 qubits.
B43 (U )
•
•
•
=
∆4
•
U
U
•
U
U
•
U
U
•
U
U
U
Figure 1: Decomposition of a block diagonal gate of size 4 [17]. Each U is a generic U (2) gate.
4
In addition, the authors of [17] used the notation given in (7) and converted (5) to (8) by replacing (7) in
(5) and merging each ∆n with its next block diagonal gate. Note that the notation ∼ over a block diagonal
gate means that this gate can be implemented up to a diagonal gate. Doing this could reduce the number of
gates resulted from the decomposition of a unitary gate.
Bnn−1 (U (2)) = ∆n B̃nn−1 (U (2))
n
U (2 ) =
∆n B̃nn−1 (U (2))
2n−1
Y−1
(7)
n−1
B̃n−γ(i)
(U (2))B̃nn−1 (U (2))
(8)
i=1
2.3.2
QSD
Since the left and the right matrices in (4) are block diagonals, they can be represented as block diagonal gate
1
Bτ1 (U (2n−1 )). In addition, the middle matrix in (4) can be represented by Bn−1
(Ry ). Therefore, (4) can be
rewritten as (9).
U (2n ) = Bτ1 (U (2n−1 ))B1n−1 (Ry )Bτ1 (U (2n−1 ))
(9)
The authors of [20] showed that each block diagonal gate Bτ1 (U (2n−1 )) in (9) can be decomposed into two
generic unitary matrices and a specific block diagonal matrix as illustrated in (10) and (11).
D 0
U1 0
U2 0
B(U (2n−1 )) =
(10)
0 U1
0 U2
0 D†
Bτ1 (U (2n−1 )) = U (2n−1 )B1n−1 (Rz )U (2n−1 )
(11)
By using (9) and (11), the method of [20] applies the quantum Shannon decomposition (QSD) shown in (12)
to synthesize a given unitary matrix. The recursion is continued till U (4). Next, an optimal decomposition
of U (4) with three CNOT gates [23] is used.
U (2n ) = U (2n−1 )B1n−1 (Rz )U (2n−1 )B1n−1 (Ry )U (2n−1 )B1n−1 (Rz )U (2n−1 )
(12)
The complete circuit diagram of (12) is shown in Fig. 2 where B1n−1 (Rz ) and B1n−1 (Ry ) gates are illustrated
by dashed lines. In this paper, we use slash to denote that a given line may carry an arbitrary number of
qubits. In addition, for a circuit with n qubits, circuit lines are numbered from 1 (top) to n (bottom).
U (2n )
B1n−1 (Rz )
_
U
/
=
/ U (2n−1 )
B1n−1 (Ry )
_
_
_
Rz
_
U (2n−1 )
B1n−1 (Rz )
_
_
Ry
_
_
U (2n−1 )
_
Rz
_
_
U (2n−1 )
Figure 2: Applying QSD [23] on a U (2n ) matrix
3
The Proposed Synthesis Method
In this section, a synthesis approach for quantum circuits is introduced. The proposed approach is based on
the CSD and QSD methods.
5
3.1
The Basic Block
In this part, a basic block is introduced which is used in the proposed decomposition method. Consider a
generic unitary matrix over l qubits and the CSD method is used to synthesize it as discussed in Section 2.3.1.
The resulted circuit without the last ∆l gate is considered as the basic block in the proposed decomposition
method. The proposed basic block is shown in (13) denoted as Q(2l ). The complete equation for Q(2l ) is
given in (14). The CSD decomposition for U (23 ) and our basic block are illustrated in Fig. 3. The rightmost
sequence of block diagonal Rz gates corresponds to a single ∆3 gate.
U (2l ) = ∆l Q(2l )
l
Q(2 ) =
B̃ll−1 (U (2))
2l−1
Y−1
(13)
l−1
(U (2))B̃ll−1 (U (2))
B̃l−γ(i)
(14)
i=1
3
U (23 )
=
∆
Q(2 )
3
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Rz
Ũ (2)
Rz
Ũ (2)
Ũ (2)
Ũ (2)
Ũ (2)
Ũ (2)
_ R_z _ _ _ _
Ũ (2)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Figure 3: The proposed basic block for 3 qubits.
3.2
Block-Based Quantum Decomposition (BQD)
In this subsection, the proposed decomposition method is introduced. The following proposition is used in
the rest of this section to remove unnecessary gates.
Proposition 1 (∆l ⊗ In−l )B1n−1 (Rk ) = B1n−1 (Rk )(∆l ⊗ In−l ) where l ≤ n − 1 and k = z,y.
As there is no overlap between the target line of B1n−1 (Rk ) and ∆l for l ≤ n − 1 and k = z,y, Proposition 1
is held. Figure 4 illustrates the result of Proposition 1 on n qubits for ∆n−1 .
B1n−1 (Rk )
B1n−1 (Rk )
Rk
Rk
=
n−1
/
∆n−1
∆n−1
Figure 4: Application of Proposition 1 on n qubits.
6
Reconsider the QSD method shown in (12). It can be verified that the recursive application of (12) up to
l qubits leads to (15) where each U (2l ) is denoted as U to save space.
l+1
l+1
l+1
l
l
l
U (2n ) = U Bn−l
(Rz )U Bn−l
(Ry )U Bn−l
(Rz )U Bn−l−1
(Rz )...Bn−l−1
(Ry )...Bn−l−1
(Rz )...
n−1
n−1
n−1
B1 (Rz )...B1 (Ry )...B1 (Rz )...
l+1
l+1
l+1
l
l
l
Bn−l−1
(Rz )...Bn−l−1
(Ry )...Bn−l−1
(Rz )U Bn−l
(Rz )U Bn−l
(Ry )U Bn−l
(Rz )U
(15)
Based on (13), each U (2l ) in (15) can be replaced by ∆l Q(2l ). The result is given in (16) where each Q(2l )
is denoted as Q.
U (2n ) =
l+1
l+1
l+1
l
l
l
∆l QBn−l
(Rz )∆l QBn−l
(Ry )∆l QBn−l
(Rz )∆l QBn−l−1
(Rz )...Bn−l−1
(Ry )...Bn−l−1
(Rz )...
n−1
n−1
n−1
B1 (Rz )...B1 (Ry )...B1 (Rz )...
l+1
l+1
l+1
l
l
l
(Rz )∆l QBn−l
Bn−l−1
(Rz )...Bn−l−1
(Ry )...Bn−l−1
(Rz )∆l QBn−l
(Ry )∆l QBn−l
(Rz )∆l Q
(16)
Now, direct applying of Proposition 1 on (16) moves all ∆l gates to the right side of block diagonal gates.
Then, each ∆l gate can be merged with its adjacent Q(2l ) gate which leads to a U (2l ) gate. The resulted
U (2l ) gate can also be replaced by ∆l Q(2l ). Continuing this process leads to (17).
U (2n ) =
l+1
l+1
l+1
l
l
l
∆l QBn−l
(Rz )QBn−l
(Ry )QBn−l
(Rz )QBn−l−1
(Rz )...Bn−l−1
(Ry )...Bn−l−1
(Rz )...
n−1
n−1
n−1
B1 (Rz )...B1 (Ry )...B1 (Rz )...
l+1
l+1
l+1
l
l
l
(Rz )...Bn−l−1
(Ry )...Bn−l−1
(Rz )QBn−l
(Rz )QBn−l
(Ry )QBn−l
(Rz )Q
Bn−l−1
(17)
Based on the above equations, the proposed block-based quantum decomposition (BQD) method is given
in (18) where each Ç(2i ) is denoted as (19). The circuit diagrams of (18) and (19) are illustrated in Fig. 5
and Fig. 6, respectively. Figure 7 shows the result of BQD method for U (26 ) where l = 4.
n−1
U (2n ) = ∆l Ç(2n−1 )B1
Ç(2i ) =
n−1
(Rz )Ç(2n−1 )B1
n−1
(Ry )Ç(2n−1 )B1
(18)
i−1
i−1
i−1
(Rz )Ç(2n−1 )
Ç(2i−1 )B1 (Rz )Ç(2i−1 )B1 (Ry )Ç(2i−1 )B1 (Rz )Ç(2i−1 ) l < i ≤ n
Q(2l )
i=l
(19)
Note that only one ∆l exists after final decomposition stopped at level l. To determine l, i.e., decomposition
U (2n )
n−
2n
−1 / U
3
2n
l= 3
/
B1n−1 (Rz )
B1n−1 (Ry )
B1n−1 (Rz )
Rz
Ry
Rz
=
Ç(2n−1 )
Ç(2n−1 )
Ç(2n−1 )
Ç(2n−1 )
∆l
Figure 5: The proposed decomposition method
level, number of CNOT gates and one-qubit gates should be evaluated as done in the following subsections.
7
Ç(2i )
B1i−1 (Rz )
B1i−1 (Ry )
B1i−1 (Rz )
Rz
Ry
Rz
=
Ç
/ Ç(2i−1 )
/
Ç(2i−1 )
Ç(2i−1 )
Ç(2i−1 )
Figure 6: The circuit diagram of (19)
B15 (Rz )
B15 (Ry )
Ry
Rz
Ry
Rz
4/ Q
Rz
Q
Q
Ry
Rz
Q
B15 (Rz )
Q
Q
Ç(25 )
Rz
Rz
Q
Ry
Rz
Q
Q
Q
Ç(25 )
Rz
Q
Ry
Rz
Q
Q
Q
Ç(25 )
Rz
Q
Q
∆4
Ç(25 )
Figure 7: Decomposition of a U (26 ) using BQD method. Q(24 ) is denoted as Q.
3.3
3.3.1
Synthesis Cost
CNOT cost
Equation (20) shows the recursion formula for the number of CNOT gates for the circuit of (19) where 2i−1
is the number of CNOT gates for each Rz gate [20]. In addition, the block diagonal Ry gate in Fig. 6 can be
transformed in the decomposition into a block diagonal U (2) rotation gate up to a diagonal gate. As a result,
it can be implemented by one less CNOT compared with the block diagonal Rz gate [19], [20].
(
4CÇ + 3 × 2i−1 − 1 l < i ≤ n
i−1
CÇ =
(20)
i
i=l
C Ql
Applying the recursion formula of (20) leads to (21).
4n−l − 1
l<i≤n
(21)
i
3
Now consider the proposed BQD method shown in (18). Equation (22) shows the number of CNOT gates
in the proposed method where 2l − 2 is the number of CNOT gates for ∆l [29].
CÇ = 4i−l (CQl + 3 × 2l−1 ) − 3 × 2i−1 −
CUn = CÇ + 2l − 2
n
(22)
One more CNOT gate can be eliminated in Q(2l ) ∆l [17]. This comes from the fact that Q(2l ) ∆l can
be written as a sequence of B̃il−1 (U (2)) gates, where i ∈ {l, l + 1, ..., n − 1, n}, followed by a chain of block
diagonal Rz gates (see Fig. 3). The single rotation gate in the chain can be absorbed into a U (2) gate
appeared after the decomposition of B̃nl−1 (U (2)) gate. Then, the sub-circuit I ⊗ U (2)C 1,2 I ⊗ U (2), resulted
1
(Rz ) gate constructs a Bn1 (U (2)) gate, which
from the decomposition of B̃nl−1 (U (2)) gate, followed by a Bn−1
can be implemented by two CNOT gates [20], one less than the number of CNOT gates required for the
1
(Rz ) sub-circuit. Equation (23) shows the final result.
implementation of I ⊗ U (2)C 1,2 I ⊗ U (2)Bn−1
CUn = 4n−l (CQl + 3 × 2l−1 ) − 3 × 2n−1 −
8
4n−l −1
3
+ 2l − 3
(23)
The number of CNOT gates for Q(2l ) (see (14)) can be computed by (24) where 2l − 1 is the number of
block diagonal gates in Q(2l ) each of which can be implemented by 2l−1 − 1 CNOT gates [17].
CQl = (2l − 1) × (2l−1 − 1)
(24)
Altogether, the number of CNOT gates for the proposed BQD method is shown in (25) for the decomposition level l.
CUn = 4n (
3.3.2
1
8
2
+ ) − 3 × 2n−1 + 2l −
3 × 4l
2
3
(25)
One-qubit cost
To count the number of one-qubit gates in the proposed decomposition method, an analysis similar to the one
performed for CNOT cost can be used. Equation (26) shows the number of one-qubit gates for the proposed
n−l
BQD method where 2 × 4 3 −1 is the number of one-qubit gates merged between B(Ry ) and B(Rz ) gates
at each recursion step. 2l − 1 is the number of one-qubit gates needed for diagonal gate ∆l . Besides, l more
gates can be eliminated at the last U (2l ) gate decomposed using CSD method [19].
OUn = 4n−l (OQl + 3 × 2l−1 ) − 3 × 2n−1 − (2 ×
4n−l − 1
) + (2l − 1) − l
3
(26)
Number of one-qubit gates for Q(2l ) is computed by (27).
OQl = (2l − 1) × (2l−1 − 1)
(27)
Replacing (27) in (26) and doing some simplifications lead to (28) for decomposition level l.
OUn = 4n (
4
1
1
1
−2
+ l + ) − 3 × 2n−1 + 2l − l −
3 × 4l
2
2
3
(28)
Result Comparison
In this section, the results of the proposed decomposition approach is presented. To this end, the effect of
the decomposition level on the synthesis cost in the BQD method is discussed first. Table 1 and Table 2
show the number of CNOT gates and one-qubit gates for 4 ≤ n and 3 ≤ l ≤ n up to n = 12, respectively.
Additionally, the total number of gates in BQD method for each decomposition level is shown in Table 3.
Note that the synthesis results for l = n in the proposed decomposition method (gray cells) are the same as
the ones produced by the improved CSD method (i.e., [17]). The results of the QSD method [20] are also
shown in these tables.
The results given in Table 1, Table 2 and Table 3 reveal the following facts regarding the behavior of the
BQD method compared to the other approaches:
• In terms of the number of CNOT gates, QSD and [19] work always better than BQD and BQD works
better than CSD.
• In terms of the number of one-qubit gates, improved CSD is better than BQD and BQD is better than
QSD and [19] all the time. Similar result is obtained in terms of total number of gates.
• As can be seen in Table 3, in l = n − 1, the total number of gates produced by BQD is one gate more
than the number of gates produced by improved CSD. However, in those cases, BQD produces fewer
CNOT gates. Since CNOT cost is usually much more than the cost of one-qubit gates, BQD produces
better circuits compared to the other methods as far as the total number of gates and technological
limitations are concerned. The appropriate l is n − 1 for this case.
9
Table 1: Number of CNOT gates in the proposed BQD, improved CSD [17] (gray cells), and QSD [20] methods
for 4 ≤ n ≤ 12.
Decomposition
Level (l)
4
5
6
7
3
112
480
2000
8176
4
118
480
1976
494
1984
2014
5
6
7
Circuit lines (n)
8
9
10
11
12
33072
133040
533680
2137776
8557232
8056
32568
131000
525496
2105016
8426168
8040
32456
130504
523464
2096840
8393416
8064
32456
130408
522984
2094824
8385256
8126
32512
130440
522920
2094376
8383272
32638
130560
523016
2094376
8382888
523264
2094600
8383016
523774
2095104
8383496
8
9
130814
10
11
2096126
12
[19], QSD [20]
8384512
8386558
100
444
1868
7660
31020
124844
500908
2006700
8032940
Table 2: Number of one-qubit gates in the proposed BQD, improved CSD [17] (gray cells), and QSD [20]
methods for 4 ≤ n ≤ 12.
Decomposition
Level (l)
4
5
6
7
10
11
12
3
138
586
2426
9882
39898
160346
642906
2574682
10304858
4
131
537
2209
8993
36321
146017
585569
2345313
9387361
522
2104
8528
34416
138352
554864
2222448
8895856
2073
8311
33455
134415
539023
2158991
8641935
8248
33014
132462
531022
2126798
8512974
32887
131573
527085
2110669
8448077
525300
2102764
8415692
524789
2099187
8399851
5
6
7
8
Circuit lines (n)
8
9
9
131318
10
11
2098164
12
QSD [20]
8392690
8390643
157
677
2805
11413
46037
184917
741205
2967893
11877717
• While QSD and [19] lead to better CNOT cost compared to improved CSD and BQD, if one-qubit gate
count is also concerned, BQD produces about 5% more CNOT gates and about 28% fewer one-qubit
gates compared to QSD on average. Altogether, the total number of gates is improved by about 16%
in BQD compared to QSD on average. The best results in terms of the number of CNOT gates for
each n are boldfaced in all tables. In some cases, there are two different decompositions which have the
same number of CNOT gates and different numbers of one-qubit gates. In those cases, decompositions
with fewer one-qubit gates are selected. Percentages of improvement (BQD vs. QSD) for CNOT gates,
one-qubit gates, and total gates are shown in Fig. 8 for this case.
A comparison of the results produced by BQD and improved CSD reveals that for this case, BQD leads
to fewer CNOT gates with the penalty of more one-qubit gates. Percentages of improvement (BQD vs.
improved CSD) for CNOT gates and one-qubit gates are almost equal (with a negative sign). However,
fewer CNOT gates is more desirable as discussed.
• Producing fewer CNOT gates leads to better quantum circuits considering the current technological
limitations. To find the exact gate counts in the proposed method, we set derivation of (25), i.e., the
number of CNOT gates for BQD method, with respect to l to zero which leads to l = 2n+log32 (4/3) .
According to the results given in Table 1 and Table 2, it can be verified that l = ⌈2n/3⌉ leads to the
achieved results. Therefore, the number of CNOT gates and one-qubit gates in the proposed BQD
method can be calculated as (29) and (30), respectively.
10
Table 3: Total number of gates in the proposed BQD, improved CSD [17] (gray cells), and QSD [20] methods
for 4 ≤ n ≤ 12.
Decomposition
Level (l)
4
5
6
7
10
11
12
3
250
1066
4426
18058
72970
293386
1176586
4712458
18862090
4
249
1017
4185
17049
68889
277017
1111065
4450329
17813529
1016
4088
16568
66872
268856
1078328
4319288
17289272
4087
16375
65911
264823
1062007
4253815
17027191
16374
65526
262902
1053942
4221174
16896246
65525
262133
1050101
4205045
16830965
1048564
4197364
16798708
1048563
4194291
16783347
5
6
7
8
Circuit lines (n)
8
9
9
262132
10
11
4194290
16777202
12
QSD [20]
16777201
257
1121
4673
19073
77057
309761
1242113
4974593
19910657
Figure 8: Percentages of improvement for CNOT, one-qubit and total gates (BQD vs. QSD)
CUn = 12 4n − 32 2n + 23 4n−⌈2n/3⌉ + 2⌈2n/3⌉ −
8
3
OUn = 21 4n + 22n−⌈2n/3⌉ − 32 2n − 23 4n−⌈2n/3⌉ + 2⌈2n/3⌉ −
(29)
2n
3
−
1
3
(30)
According to the above discussion, we select l = ⌈2n/3⌉ in the proposed decomposition method. Table 4
and Table 5 show the number of CNOT gates and one-qubit gates for different quantum synthesis methods.
Considering the fact that number of CNOT gates in the best reported synthesis methods [19, 20] is away
from the lower bound by a factor of two, more improvement in the synthesis cost needs consideration of both
CNOT and one-qubit gates. Simultaneous reduction of CNOT and one-qubit gates has also been recently
pursued by other researchers [28].
5
Nearest Neighbor Implementation
While several impressive physical realizations have been proposed for quantum computers, all of these technologies have serious intrinsic limitations which should be resolved in future [6]. Among the different technological constraints, the limited interaction distance between qubits is one of the most common ones. Although
arbitrary-distance interaction between qubits is possible in quantum computer technologies with moving qubits
(for example in a photon-based system [36]), some restrictions exist in other quantum technologies. Indeed,
many physical quantum computer proposals only permit interactions between adjacent (nearest neighbor)
qubits [37]. For example, liquid nuclear magnetic resonance (NMR) [38], and the original Kane model [39]
were designed based on the interactions between linear nearest neighbor (LNN) qubits.
11
Table 4: Comparison table for the number of CNOT gates in various quantum synthesis methods
Synthesis
method
2
3
4
5
6
7
Circuit lines
8
9
10
n
[9], [12]
-
O(n3 4n )
[13]
-
O(n4n )
QR [15]
O(4n )
-
Original CSD [16]
8
48
224
960
3968
16128
65024
261120
1046528
Improved CSD [17]
4
26
118
494
2014
8126
32638
130814
523774
3
20
100
444
1868
7660
31020
124844
500908
BQD
[19], QSD [20]
-
-
112
480
1976
8040
32456
130408
522920
Lower Bound [14]
3
14
61
252
1020
4091
16378
65529
262137
4n − 2n+1
1 n
1 n
24 − 22 − 2
3 n
4
23 n
48 4 − 2 2 + 3
Eq. (29)
1 n
4 (4 − 3n − 1)
Table 5: Comparison table for the number of one-qubit gates
Synthesis
method
2
3
4
5
6
7
Circuit lines
8
9
10
Improved CSD [17]
7
32
131
522
2073
8248
32887
131318
524789
QSD [20]
7
33
157
677
2805
11413
46037
184917
741205
1 n
1 n
24 + 22 − n
3 n
1
17 n
4
−
24
22 −3
BQD
-
-
138
537
2209
8528
33455
134415
531022
Eq. (30)
n
−1
In this section, the worst-case cost of BQD synthesis method for nearest neighbor architecture is studied.
To this end, the structure of the proposed basic block, the block diagonal and the diagonal gates under LNN
constraints should be evaluated. Reconsider the proposed basic block Q(2l ) which has 2l − 1 block diagonal
gates. Equation (31) shows the number of adjacent CNOT gates for a block diagonal gate with l − 1 control
lines where s is between 1 and ⌈ 2l ⌉ [17].
(
1
3 l even
(31)
CB l−1 = 65 2l + 2l − 6s
5
t
3 l odd
A comparison between the number of CNOT gates required to implement a block diagonal gate without
the LNN constraint (i.e., 2l−1 − 1) and with this constraint (i.e., O( 56 2l )) reveals that the number of CNOT
gates for a block diagonal gate is increased by a factor of 35 in the LNN architectures.
Equation (32) shows the number of adjacent CNOTs of a block diagonal gate with n − 1 control lines
where target is at the 1st line (without the last ∆n gate) in the LNN architectures [17]. The block diagonal
Ry gates produced in the QSD method can also be implemented by the same number of adjacent CNOTs as
discussed in Subsection 3.3.
(
19
n even
5 n
3
(32)
CB n−1 = 6 2 + 2n −
23
1
n odd
3
Equation (33) shows the number of adjacent CNOTs required for block diagonal Rz gates [17] which have
been produced during QSD decomposition.
(
22
n even
3
(33)
CRn−1 = 56 2n + 3n −
23
1
n odd
3
A comparison between the number of CNOT gates required to implement a block diagonal gate without the
LNN constraint (i.e., 2n−1 − 1) and with this constraint (i.e., O( 56 2n )) reveals that the number of CNOTs for
a block diagonal gate is increased by a factor of 53 in the LNN architectures.
On the other hand, the last diagonal gate can be considered as a cascade of block diagonal rotations
with i ∈ {1, · · · , l − 1} controls and one target placed at the 1st qubit [29]. Therefore, the nearest neighbor
12
implementation of ∆l can be computed as (34) where C∆l shows the number of CNOT gates in ∆l for LNN
architectures. Equation (34) reveals that C∆l is of O( 35 2l ) for LNN architectures.
(
35
41
6 l − 3 n even
(34)
C∆l = 35 2l + 32 l2 −
42
37
6 l − 3 n odd
An exact evaluation of the above costs shows that applying LNN constraints increases CNOT count by at
most a factor of 35 .
6
Conclusions and Future Directions
In this paper, a decomposition approach for quantum-logic synthesis was proposed which is based on the
previous CSD and QSD methods. To do this, a basic block based on CSD method was constructed which
contains l qubits. Next, the proposed circuit for a generic unitary gate over l qubits was used as a basic block to
present our quantum synthesis method. In doing so, the previously proposed QSD method for quantum-logic
synthesis was recursively applied to reach unitary gates over l qubits. Then, the proposed basic block was used
and further optimizations were applied to remove redundant gates. To evaluate the proposed method, number
of CNOT and one-qubit gates with and without the nearest neighbor constraint was analyzed. According
to our analysis, the decomposition level l can be selected to trade off the number of one-qubit gates against
CNOT gates. Since producing fewer CNOT gates is more desirable, the decomposition level is set to ⌈2n/3⌉
in the proposed decomposition method.
Due to the potential of the proposed decomposition method in consideration of the number of CNOT and
one-qubit gates, it is our hope that the proposed synthesis method may lead to further improvement in the
number of CNOT and one-qubit gates simultaneously in future.
Acknowledgment
We would like to thank Mikko Möttönen for helpful discussions.
References
[1] C. Elliott. Quantum cryptography. IEEE Security Privacy, 2(4):57 – 61, July-August 2004.
[2] P. W. Shor. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum
computer. SIAM Journal on Computing, 26:1484–1509, 1997.
[3] L. K. Grover. A fast quantum mechanical algorithm for database search. ACM symposium on Theory of
computing, pages 212–219, 1996.
[4] R. Feynman. Simulating physics with computers. International Journal of Theoretical Physics, 21:467–
488, 1982.
[5] M. Mosca. Quantum algorithms. Springer Encyclopedia of Complexity and Systems Science, pages
7088–7118, 2009.
[6] M. Ross and M. Oskin. Quantum computing. Commun. ACM, 51(7):12–13, July 2008.
[7] D. Deutsch. Quantum computational networks. Proc. Roy. Soc. Lond., A425(73), 1989.
[8] D. P. DiVincenzo. Two-bit gates are universal for quantum computation. APS Physical Review A,
50(1015), 1995.
13
[9] A. Barenco et al. Elementary gates for quantum computation. APS Physical Review A, 52:3457–3467,
1995.
[10] S. Lloyd. Almost any quantum logic gate is universal. Physical Review Letters, 75(2):346–349, 1995.
[11] M. Nielsen and I. Chuang. Quantum computation and quantum information. Cambridge University Press,
2000.
[12] G. Cybenko. Reducing quantum computations to elementary unitary operations. Computing in Science
and Engg., 3(2):27–32, 2001.
[13] E. Knill. Approximation by Quantum Circuits. LANL report LAUR-95-2225, 1995.
[14] V. V. Shende, I. L. Markov, and S. S. Bullock. Minimal universal two-qubit quantum circuits. APS
Physical Review A, 69:062321, 2004.
[15] J. J. Vartiainen, M. Möttönen, and M. M. Salomaa. Efficient decomposition of quantum gates. Physical
Review Letters, 92:177902, 2004.
[16] M. Möttönen, J. J. Vartiainen, V. Bergholm, and M. M. Salomaa. Quantum circuits for general multiqubit
gates. Physical Review Letters, 93(13):130502, 2004.
[17] V. Bergholm, J. J. Vartiainen, M. Möttönen, and M. M. Salomaa. Quantum circuits with uniformly
controlled one-qubit gates. Physical Review A, 71:052330, 2005.
[18] V. V. Shende, S. S. Bullock, and I. L. Markov. Synthesis of quantum logic circuits. Proceedings of the
Asia and South Pacific Design Automation Conference, pages 272–275, 2005.
[19] M. Möttönen and J. J. Vartiainen. Decompositions of general quantum gates. Ch. 7 in Trends in Quantum
Computing Research, NOVA Publishers, 2006.
[20] V. V. Shende, S. S. Bullock, and I. L. Markov. Synthesis of quantum-logic circuits. IEEE Trans. on
CAD, 25(6):1000–1010, June 2006.
[21] Y. Nakajima, Y. Kawano, and H. Sekigawa. A new algorithm for producing quantum circuits using kak
decompositions. Quantum Information and Computation, 6(1):67–80, 2006.
[22] B. Drury and P. Love. Constructive quantum shannon decomposition from cartan involutions. Journal
of Physics A: Mathematical and Theoretical, 41(39):395305, 2008.
[23] V. V. Shende, I. L. Markov, and S. S. Bullock. Smaller two-qubit circuits for quantum communication
and computation. Design, Automation and Test in Europe, pages 980–985, 2004.
[24] G. Vidal and C. M. Dawson. A universal quantum circuit for two-qubit transformations with three CNOT
gates. Physical Review A, 69:010301, 2004.
[25] F. Vatan and C. Williams. Optimal quantum circuits for general two-qubit gates. Physical Review A,
69:032315, 2004.
[26] J. Zhang, J. Vala, S. Sastry, and K. B. Whaley. Minimum construction of two-qubit quantum operations.
Physical Review Letters, 93:020502, 2004.
[27] F. Vatan and C. P. Williams. Realization of a general three-qubit quantum gate. e-print, quantph/0401178, 2004.
[28] V. V. Shende and I. L. Markov. On the CNOT-cost of Toffoli gates. Quantum Information and Computation, 9(5-6):461–486, May 2009.
14
[29] S. S. Bullock and I. L. Markov. Asymptotically optimal circuits for arbitrary n-qubit diagonal computations. Quantum Information and Computation, 4(1):27–47, 2004.
[30] G. Song and A. Klappenecker. Optimal realizations of controlled unitary gates. Quantum Information
and Computation, 3(2):139–155, 2003.
[31] M. Möttönen, J. J. Vartiainen, V. Bergholm, and M. M. Salomaa. Transformation of quantum states
using uniformly controlled rotations. Quantum Information and Computation, 5(6):467–473, 2005.
[32] R. R. Tucci. Qc paulinesia. Los Alamos e-print, quant-ph/0407215, 2004.
[33] C. Lomont. Quantum circuit identities. e-print, quant-ph/0307111, 2003.
[34] C. C. Paige and M. Wei. History and generality of the CS decomposition. Linear Algebra and Applications,
208:303–326, 1994.
[35] R. K. Guy. Unsolved Problems in Number Theory, 2nd ed. Springer-Verlag, New York, 1994.
[36] E. Knill, R. Laflamme, and G. J. Milburn. A scheme for efficient quantum computation with linear
optics. Nature, 409:46–52, January 2001.
[37] A. G. Fowler, S. J. Devitt, and L. C. L. Hollenberg. Implementation of shor’s algorithm on a linear
nearest neighbour qubit array. Quantum Information and Computation, 4(4):237–245, 2004.
[38] M. Laforest et al. Using error correction to determine the noise model. Physical Review A, 75, 2007.
[39] B. Kane. A silicon-based nuclear spin quantum computer. Nature, 393:133–137, May 1998.
15