138 Quantum gates and quantum circuits
Similarly, we can deﬁne a two qubit gate, three qubit gate and so on. We
know that gates are combined together to form circuits, so in this chapter
we will ﬁrst describe single qubit gates, two qubit gates and three qubit
gates. Then we will provide a few examples of quantum circuits and brieﬂy
describe the quantitative measures of the quality of the quantum circuits.
We will also describe a few simple tricks that are usually used to improve
the quality of quantum circuits. This chapter is focused on quantum gates
and quantum circuits, but the techniques described here are also valid for
reversible gates and reversible circuits.
4.1 Single qubit gates
A general structure of single qubit gates is shown in Fig. 4.1. Here the
single qubit gate is a unitary operator which transforms a single qubit state
to another single qubit state |ψ
. In this ﬁgure and in all
the subsequent ﬁgures that depict quantum gates and quantum circuits,
time moves from left to right, and each horizontal line represents a qubit.
The horizontal lines are often referred to as qubit lines. Single qubit gates
are represented by 2 × 2 unitary matrices. Every unitary operator (U),
whichisrepresentedbya2 × 2 matrix, is a valid single qubit gate. In
principle, we can construct an inﬁnite number of 2 × 2 unitary matrices.
Consequently, there are an inﬁnite number of possible single qubit quantum
gates. However, in the conventional classical circuit theory, only two single
bit logic gates are possible, namely the Identity gate and the logical NOT
gate. Among this inﬁnite number of possible single qubit quantum gates,
some have special importance as they are used most frequently, and as
they can be used as elements of a set of gates, which form a universal gate
library. In this section we will brieﬂy introduce these important and useful
single qubit quantum gates, which are nothing but single qubit quantum
state transformations. Since these transformations are linear, they are
completely speciﬁed by their eﬀect on the basis vectors. For instance, if we
know that a single qubit quantum gate A maps |0 to |ψ
and |1 to |ψ
then linearity implies that the gate maps an arbitrary single qubit state
α|0 + β|1 to α|ψ
. Keeping this in mind, we will now describe
the eﬀect of important single qubit gates on the basis vectors |0 and |1 and
will also provide the corresponding 2 × 2 unitary matrices that represent
Figure 4.1: An arbitrary single qubit gate U .