Optimal number of controlled-NOT gates to generate a three-qubit state
ABSTRACT The number of two-qubit gates required to deterministically transform a three-qubit pure quantum state into another is discussed. We show that any state can be prepared from a product state using at most three CNOT gates and that starting from the Greenberger-Horne-Zeilinger state, only two suffice. As a consequence, any three-qubit state can be transformed into any other using at most four CNOT gates. Generalizations to other two-qubit gates are also discussed.
- SourceAvailable from: uni-muenchen.de
- [Show abstract] [Hide abstract]
ABSTRACT: We explicitly construct a quantum circuit which exactly generates random three-qubit states. The optimal circuit consists of three CNOT gates and fifteen single qubit elementary rotations, parametrized by fourteen independent angles. The explicit distribution of these angles is derived, showing that the joint distribution is a product of independent distributions of individual angles apart from four angles. Comment: 7 pages, 2 figuresPhysical Review A 03/2009; · 2.99 Impact Factor
arXiv:0711.4021v1 [quant-ph] 26 Nov 2007
How many CNOT gates does it take to generate a three-qubit state ?
MarkoˇZnidariˇ c1, Olivier Giraud2and Bertrand Georgeot2
1Department of Physics, Faculty of Mathematics and Physics,
University of Ljubljana, SI-1000 Ljubljana, Slovenia
2Laboratoire de Physique Th´ eorique, Universit´ e de Toulouse, CNRS, 31062 Toulouse, France
(Dated: November 26, 2007)
The number of two-qubit gates required to transform deterministically a three-qubit pure quantum
state into another is discussed. We show that any state can be prepared from a product state
using at most three CNOT gates, and that, starting from the GHZ state, only two suffice. As a
consequence, any three-qubit state can be transformed into any other using at most four CNOT
gates. Generalizations to other two-qubit gates are also discussed.
PACS numbers: 03.67.-a, 03.67.Ac, 03.67.Bg
Quantum information and computation (see e.g. ) is
usually described using qubits as elementary units of in-
formation which are manipulated through quantum oper-
ators. In most practical implementations, such operators
have to be realized as sequences of local transformations
acting on a few qubits at a time. Whereas one-qubit gates
alone cannot create entanglement, it has been shown that
together with two-qubit gates they can form universal
sets, from which the set of all unitary transformations of
any number of qubits can be generated . The complex-
ity of a quantum algorithm is usually measured by assess-
ing the number of elementary gates needed to perform
the computation. The Controlled-Not (CNOT) gate, a
two-qubit gate whose action can be written |00? → |00?,
|01? → |01?, |10? → |11?, |11? → |10?, is one of the most
widely used both for theory and implementations. It can
be shown that the CNOT gate together with one-qubit
gates is a universal set . Experimental implementa-
tions of a CNOT gate (or the equivalent controlled phase-
flip) have been recently reported using e.g. atom-photon
interaction in cavities , linear optics , superconduct-
ing qubits [5, 6] or ion traps [7, 8].
quantum computers are still far away, small platforms of
a few qubits exist or can be envisioned in the framework
of these existing experimental techniques. In most such
implementations, two-qubit gates such as the CNOT are
much more demanding that one-qubit gates.
While large size
Theoretical quantum computation has been usually fo-
cused on assessing the number of elementary gates to
build a given unitary operator performing a given com-
putation. Some works have tried to focus on two-qubit
gates and to minimize their number in order to build a
given unitary transformation for several qubits [9, 10].
Still, unitary transformations in many applications are
a tool to transform an initial state to a given state. It
seems therefore natural to try and assess how costly this
process is in itself. In this paper, we thus study the min-
imal number of two-qubit gates needed to change a given
quantum state to obtain another one. Of course, this
number is necessarily upper bounded by the number re-
quired for a general unitary transformation. We focus
on the case of two and three qubits. For two qubits, we
generalize the result of  and show that one CNOT
is enough to go from any given pure state to any other
one. For three qubits, we show that three CNOTs are
enough to go from |000? to any other pure state, and
that two CNOTs suffice if one starts from the GHZ state
(|000?+|111?)/√2. A corollary of the latter is thus that
four CNOTs are enough to go from any pure state to any
other pure state. The number of CNOT gates required to
go from a state to another defines a discrete distance on
the Hilbert space. Given any fixed state |ψ?, the Hilbert
space can be partitioned according to the distance to |ψ?.
It is known that if stochastic one-qubit operations are
used, entanglement of three  and four  qubits fall
into respectively two and nine different classes. Our clas-
sification according to the number of CNOTs is different,
although there are some relations. Our results generalize
to other universal two-qubit gates, in particular to the
iSWAP gate which has been shown to be implementable
for superconducting qubits .
Weconsider pure states
dimensional Hilbert space C2n. The space of normal-
ized quantum states is the sphere S2n+1−1.
cost of one-qubit gates is negligible, we are interested
only in equivalence classes of states modulo local uni-
tary transformations (LU). We thus consider the sets
En= S2n+1−1/U(2)nof states nonequivalent under LU.
In the case of two and three qubits the dimension of
E2 and E3 was determined in [15, 16] and their topol-
ogy has been described in .
per we will make use of the one-qubit LU operations
matrices acting on qubit k.
y (ξ) corresponds to a rotation of the qubit
cos(ϕ)|0? + sin(ϕ)|1? ?→ cos(ϕ + ξ)|0? + sin(ϕ + ξ)|1?.
Two-qubit states. Let us first consider the two-qubit
case. It has been shown in  that one can transform
an arbitrary two-qubit state |ψ? to |00? by using only
one CNOT. Here we prove that the same holds for two
general two-qubit states |ψ? and |ψ′?.
Proof: Since E2 is homeomorphic to [0,1], only one
Throughout the pa-
(ξ) = exp(−iξσ(k)
) where the σ(k)
In particular, the oper-
are the Pauli
parameter (e.g., one Schmidt coefficient) characterizes
a state up to LU. More precisely, by LU each two-
qubit state can be brought to the canonical form |ψ? =
cosϕ|00? + sinϕ|11?, which is just Schmidt decomposi-
tion. We want to transform state |ψ? with parameter ϕ
to state |ψ′? with parameter ϕ′. When ϕ′?= ϕ, we need
at least one CNOT. It turns out that one CNOT is in
fact sufficient, as can be easily seen by checking that the
convention, qubit 1 is the leftmost one).
In contrast, one needs three CNOTs in general to con-
struct a specific two-qubit unitary transformation .
Transforming one state to another is thus clearly easier.
We now turn to the three-qubit case.
Classification with respect to |000?. We start with
the case where we want to prepare a state |ψ? from |000?.
The distance (in number of CNOTs) from |000? to |ψ? is
a criterion for the difficulty to prepare |ψ?. We will show
that this distance partitions the Hilbert space into four
classes, and that any state can be prepared from |000?
using three CNOT gates or less. We will examine each
of these four classes in turn.
Class 0: One needs zero CNOT gates to transform |ψ?
to |000? iff the state is of the product form |ψ? = |αβγ?,
where |α?,|β?,|γ? are normalized single qubit states (this
is trivial, since only LU are used).
Class 1: One needs one CNOT iff the state is of the
form |ψ? = |α?1|χ?23(i.e., it is bi-separable), where |χ?23
is an arbitrary entangled state of the last two qubits .
Proof: By LU |ψ? can be transformed into canonical
to this canonical form we obtain |0?(cosϕ|00?+sinϕ|10?),
i.e., state |0?(cosϕ|0? + sinϕ|1?)|0? which is in class 0.
We can therefore reach |000? in a single CNOT step.
Conversely, applying one CNOT gate on a state from
class 0 the state reached is bi-separable and therefore all
states that need 1 step to get from |000? are of the above
In their canonical form states from class 1 can be
parametrized by a single real parameter ϕ.
Class 2: One needs two CNOT gates iff the state
is of the form |ψ? = cosϕ|αβγ? + sinϕ|α⊥β′γ′?, with
?α|α⊥? = 0, |?β|β′?| < 1 and |?γ|γ′?| < 1 (if |?β|β′?| or
|?γ|γ′?| are equal to 1 then |ψ? belongs to class 1).
Proof: We first bring the state by LU to the canon-
ical form |ψ?
are absorbed into the definition of local bases, |γ?
can be written as cosξ|0? + sinξ|1?.
(cosϕ|00?+sinϕ|1β?)|γ′?, which is a state of class 1 from
which we can reach state |000? in a single step.
To prove the converse, we have to show that by using
two CNOT gates one can reach only states of the form
|ψ? = cosϕ|αβγ? + sinϕ|α⊥β′γ′?, or states in class 0 or
class 1. Starting from class 0, we are in class 1 after one
y (ϕ′)|ψ? = |ψ′? holds (by
= |0?(cosϕ|00?+sinϕ|11?). Applying CNOT23
= cosϕ|000? + sinϕ|1βγ?. If the phases
followed by a CNOT13 yields a state
step. Any class 1 state can be written as |α?(cosϕ|0γ?+
eiξsinϕ|1γ′?). Applying CNOT23 or CNOT32 we get a
state in class 0 or class 1. Applying CNOT21 on the
other hand we get cosϕ|α0γ? + eiξsinϕ|α1γ′?, where
|α? = σx|α?, which is indeed of the canonical form of
class 2 states. Last possibility is applying CNOT12. In
this case it is better to write our state in the basis |±? =
(|0? ± |1?)/√2 for the second qubit. That is, any class 1
state can be written as |α?(cosϕ| − γ? + eiξsinϕ| + γ′?).
Writing |α? = cosϕ′|0? + eiξ′sinϕ′|1?, we then get after
applying CNOT12state cosϕ(cosϕ′|0?−eiξ′sinϕ′|1?)|−
γ?+sinϕeiξ(cosϕ′|0?+eiξ′sinϕ′|1?)|+γ′?, which is again
of the canonical form expected. For CNOT13or CNOT31
the argument is similar.
One needs 3 real parameters to describe states of class
2 in their canonical form. Note that class 2 states con-
stitute a subset of GHZ type states which are of (unnor-
malized) form |αβγ? + |α′β′γ′? .
Class 3: One needs three CNOT gates iff a state is
not in class 0, 1 or 2.
Proof: States not in the previous classes are of two
types: (i) W-like states (according to the classifica-
tion in ) for which the range of the reduced den-
sity matrix of qubits 2 and 3 contains only one prod-
uct state. Such states are of the (unnormalized) form
|ψ? = |αβγ?+|α′?|χ?23, where |χ?23is entangled and or-
thogonal to |βγ?. Under LU they can be written in the
following canonical form 
with |α? = cosξ|0? + sinξ|1? and, (ii) GHZ-like states
with the canonical form
= cosϕ|000? + sinϕ|α?(cosϕ′|10? + sinϕ′|01?), (1)
= a|000? + eiξb|αβγ?,(2)
where |α?, |β? and |γ? are real single qubit states
parametrized by one parameter each and a,b are real
parameters, one of which is fixed by normalization .
To exclude class 2 states we must demand that none of
|α?, |β? and |γ? be equal to |1?. To exclude class 1 and 0
states in (1),(2) ρ23must be of rank 2. W-like states (1)
require 3 parameters. GHZ-like (2) states need 5, and
thus are the generic states.
First we show that by using single CNOT one can
transform class 3 states to class 2. For W-like states (1)
we just have to apply CNOT23to the canonical form (1)
and we immediately get cosϕ|000?+ sinϕ|α?(cosϕ′|1? +
sinϕ′|0?)|1? which is of class 2 (states on the third qubit
are orthogonal). For GHZ-like states (2) it is a bit more
work. Note that GHZ-type states can be, by rearranging
terms and after LU, written as cosϕ|000?+ sinϕ|1?|χ?23
(expanding |0? on the first qubit in (2) into |α? and |α⊥?
and adding |α? part to the second term), where |χ?23can
in turn be expanded as |χ?23 = cosϕ′|0δ? + sinϕ′|1δ′?)
with |?δ|δ′?| < 1 (otherwise state would be in class
2). Finally, rotating third qubit brings the state to
cosϕ|00γ′′?+sinϕ|1?(cosϕ′|00?+eiξ′sinϕ′|1γ′?) with real
|γ′? = cosg′|0? + sing′|1?. After application of the ro-
cosϕ|00˜ γ′′? + sinϕ|1?(cosϕ′|0? + eiξ′sinϕ′|1?)|˜ γ′? which
is of class 2.
Since the canonical forms of classes 0, 1, 2 and 3 span
the whole Hilbert space and since the forms of classes 0,
1 and 2 are the only ones that can be reached in 2 steps,
it immediately follows that the states of canonical forms
(1) and (2) require exactly three steps.
Thus any state is at a distance less than or equal to 3
Classification with respect to GHZ state. Let
us now examine the distance to the GHZ state |GHZ? =
(|000? + |111?)/√2. It turns out that any state is at a
distance less than or equal to 2 from GHZ. We use the fact
that any state in E3can be characterized by a set of six
polynomial invariants [21, 22]. Following , we denote
the first three invariants by Ii= trρ2
ρi is the reduced density matrix of the ith qubit. Any
three-qubit state is equivalent under LU to its canonical
followed by CNOT23 we arrive at
i, 1 ≤ i ≤ 3, where
λ0|000? + λ1eiφ|100? + λ2|101? + λ3|110? + λ4|111?, (3)
where the six parameters λ0,...,λ4,ϕ label the state in
in the canonical form (3) are unique.
Class 0: States at distance 0 from GHZ are states
whose canonical form (3) is GHZ (this is trivial).
Class 1: States at distance 1 from GHZ are states
whose canonical form (3) is (up to relabeling)
i= 1. If we take 0 ≤ ϕ ≤ π the parameters
√2|000? + λ2|101? + λ3|110? + λ4|111?,
(with λ4?= 1/√2) i.e., states with I1=1
Proof: It is straightforward to check that the state
(4) has the same invariants (i.e.
to LU) as CNOT23R(2)
distance 1 from GHZ. Conversely, if a state |ψ? is at dis-
tance 1 from GHZ, then one of its invariants I1,I2,I3has
is the same up
y (θ3)|GHZ? with θ2 =
√2), and thus is at
√2) and θ3=1
to be the same as for GHZ. Since GHZ is symmetric un-
der permutation of the qubits, one can consider that the
CNOT gate applied is CNOT23(up to relabeling of the
qubits before applying the CNOT). In this case the in-
of the first qubit of |ψ? therefore verifies trρ2
in turn (since it is a 2 × 2 density matrix) implies that
as |ψ? =
canonical form of such states is precisely (4).
2is conserved. The reduced density matrix
?. All states with this property can be written
√2|1?|χ⊥?, with ?χ|χ⊥? = 0. The
Class 2: All other states are at distance 2 from GHZ.
Proof: We show that all other states are at distance
1 from states of canonical form (4). States of canonical
form (4) are characterized by I1=1
to prove that any state |ψ? not in class 0 or 1 can be trans-
formed to a state verifying I1=1
gate. The reduced density matrix of the first qubit is a
B∗1 − A
thus given by I1 = A2+ (1 − A)2+ 2|B|2. It is equal
2iff A =
yields three equations. One-parameter rotations of the
qubits before applying CNOT yield free parameters. It
turns out that a solution to the three equations always
exists. Indeed, the state |ψ? can be reduced either to
the canonical form (1) or to the canonical form (2). If
|ψ? is in canonical form (1), one can check that the state
2. Therefore we have
2with only one CNOT
2 × 2-matrix ρ1=
. The first invariant is
2and B = 0, which (since B is complex)
y (θ2)|ψ?, with
cot2ϕ + cos2ξ
sin(ξ + 2θ1)cosϕ′sin2ϕ
sin(2ξ + 2θ1)cos2ϕ′sin2ϕ − cos2ϕsin2θ1
is such that I1=
canonical form (2). The one-qubit states |α?, |β?, |γ? can
be written in the form cosϕ|0?+sinϕ|1? with parameters
respectively ϕ1, ϕ2and ϕ3. Normalization imposes that
a2+b2+2abcosξ cosϕ1cosϕ2cosϕ3= 1. One can check
that the state CNOT12R(1)
parameters of the rotations given by
2. Let us now suppose that |ψ? is in
y (θ2)|ψ?, with
(b2− b4)cos2ϕ1− a2?a2− 1 − 2b2cos2ϕ1cos2ϕ2+ 2b4cos2ϕ2sin2(2ϕ1)sin2ϕ3
b2sin(2ϕ1)?1 − a2− b2+ 2a2cos2ϕ2(1 − a2sin2ϕ3+ b2cos(2ϕ1)sin2ϕ3)?
tan2θ2 = −
a2sin2θ1+ b2sin(2ϕ1+ 2θ1)cos2ϕ2+ 2abcosξ sin(ϕ1+ 2θ1)cosϕ2cosϕ3
tan2χ = −2absinξ sinϕ1sinϕ2cosϕ3(a2sin2θ1− b2sin(2ϕ1+ 2θ1))
b2sin(2ϕ1+ 2θ1)sin2ϕ2+ 2abcosξ sin(ϕ1+ 2θ1)sinϕ2cosϕ3
2asinϕ1sinϕ2(2ab2cosϕ1cosϕ2+ b(a2+ b2)cosξ cosϕ3),
The results above show that the number of CNOTs
needed to transform a state to another state is much less
than the number to produce all unitary transformations.
Indeed, according to , one needs at least 14 CNOT
gates to produce any three-qubit unitary transformation.
We also note that the best available algorithm actually
does not saturate the bound, needing 20 CNOTs .
Our procedure is explicit, and selects a specific unitary
transformation leading from one state to the other using
less CNOTs than a general unitary transformation.
Let us now discuss the applicability of these results to
physical systems. In an experimental context, our re-
sults can be used to construct any desired state from the
initial state which is easiest to produce with a given sys-
tem. In some experimental set-ups, two-qubit gates are
built from a nearest neighbor interaction (for example
in [5, 6]). In this case, the common procedure is to use
additional SWAP gates to transfer the states of two dis-
tant qubits to nearest neighbors before performing the
CNOTs. However, in our case, due to the symmetry of
GHZ state, one can go from any state to the GHZ state
in two CNOTs without the need of any quantum SWAP.
Thus even if only nearest-neighbors CNOTs are available
for three qubits on a line, still only 4 CNOTs are enough
to go from any state to any other state. If one starts
from |000? and one allows for relabeling of qubits in the
final state, 3 CNOTs are still enough to go to any state,
except for the GHZ-type class 3 states, Eq. (2), which
need an additional CNOT in this architecture.
Any two-qubit gate can be expressed in terms of
CNOTs and one-qubit gates. Thus our result will im-
ply a bound in the number of two-qubit gates needed to
go from one three-qubit state to another, for any other
choice of universal two-qubit gate. We note that another
popular two-qubit gate is the iSWAP which is natural
for implementations corresponding to a XY-interaction.
As the iSWAP can be expressed in terms of one CNOT
and one SWAP gate plus one-qubit gates , our re-
sults apply directly to this particular gate provided the
SWAP can be made classically: the number of iSWAPs
needed to transform three qubits is then the same as for
CNOTs. This in particular arises when the physical im-
plementation allows for a coupling between any pair of
qubits, as swapping two qubits is equivalent to relabeling
the qubits for all subsequent gates by interchanging the
role of the qubits. An important example is the case of
superconducting qubits coupled to each other via cavity
bus , one of the most promising recent developments,
where the resonance can be tuned to couple any pair.
In conclusion, we have shown that one needs only
three CNOTs plus additional one-qubit gates to trans-
form |000? to any pure three-qubit states. If one starts
from the GHZ state, only two CNOTs are enough, and
thus one needs only four CNOTs plus additional one-
qubit gates to transform any initial pure three-qubit state
to any other pure three-qubit states. An interesting open
question is to find out whether four is the maximal dis-
tance between two three-qubit states (it should be at
least three since |000? is at distance 3 from class 3 states).
It would be also interesting to know how these results
translate to mixed states, or to pure states using SLOCC
instead of LU. At last, generalizations to higher numbers
of qubits may pave the way to better optimization of
quantum algorithms, which are usually described as uni-
tary operators but are sometimes just transformations of
a given state into another one.
We thank the French ANR (project INFOSYSQQ) and
the IST-FET program of the EC (project EUROSQIP)
for funding. MˇZ would like to acknowledge support by
Slovenian Research Agency, grant J1-7437, and hospi-
tality of Laboratoire de Physique Th´ eorique, Toulouse,
where this work has been started.
 M. A. Nielsen and I. L. Chuang, Quantum computation
and quantum information, Cambridge (2000).
 A. Barenco et.al., Phys. Rev. A 52, 3457 (1995).
 A. Rauschenbeutel et.al., Phys. Rev. Lett. 83, 5166
 J. L. O’Brien et.al., Nature 426, 264 (2003); S. Gasparoni
et.al., Phys. Rev. Lett. 93, 020504 (2004)
 T. Yamamoto et.al., Nature 425, 941 (2003).
 J. H. Plantenberg et.al., Nature 447, 836 (2007).
 D. Leibfried et.al., Nature 422, 412 (2003).
 M. Riebe et.al., Phys. Rev. Lett. 97, 220407 (2006).
 G. Vidal and C. M. Dawson, Phys. Rev. A 69, 010301(R)
(2004); F. Vatan and C. Williams, Phys. Rev. A 69,
 V. V. Shende, I. L. Markov and S. S. Bullock,
Phys. Rev. A 69, 062321 (2004); IEEE Trans. on CAD
25, 1000 (2006).
 V. V. Shende and I. L. Markov, Quant. Inf. and Comp.
5, 49 (2005).
 W. D¨ ur, G. Vidal and J. I. Cirac, Phys. Rev. A 62,
 F. Verstraete et.al., Phys. Rev. A 65, 052112 (2002).
 J. Majer et.al., Nature 449, 443 (2007).
 J. Schlienz and G. Mahler, Phys. Lett. A 224, 39 (1996).
 N. Linden and S. P. Popescu, Fortschr. Phys. 46, 567
 S. N. Walck et.al., Phys. Rev. A 72, 052324 (2005).
 In the proofs, qubits are relabeled when this simplifies
the notations, so that, e.g., state |α?1|χ?23also represents
|χ?12|α?3) and |α?2|χ?13. As we deal with distances from
symmetric states such as |000? and GHZ, this amounts
to relabeling the gates, without any loss of generality.
 Indeed, the rank of the reduced density matrix ρ23 ob-
tained by tracing out the first qubit is at most two. If it
is two, then the range of ρ23 contains at least one prod-
uct vector . If it contains only one, one has class 3(i)
states, otherwise one has class 3(ii) or class 2 states.
 M. Grassl, Th. Beth and T. Pellizzari, Phys. Rev. A 56,
 A. Sudbery, J. Phys. A: Math. Gen. 34 643 (2001).
 A. Ac´ ın et.al., Phys. Rev. Lett. 85, 1560 (2000).
 N. Schuch and J. Siewert, Phys. Rev. A 67, 032301