Introduction To Quantum Computing - Quantum Circuit Elements
Introduction To Quantum Computing - Quantum Circuit Elements
Compiler Tasks
1. Decompose
2. Optimize
3. Schedule
4. Mapping
5. FT synthesis
QUANTUM CIRCUITS-BUILDING BLOCKS
Quantum gates are one of the important building blocks in the quantum circuits.
▸ Matrix multiplication:
C-Z operation can be shown to be equivalent to C-NOT and 2 H-gates using matrix multiplication
==
Z H H
(0 1) 2 (1 −1)
1 0 1 1 1
I⊗H=
1 1 0 0
1 1 −1 0 0
=
2 0 0 1 1
0 0 1 −1
Note: Multiplication is performed in the reverse order to how it appears in the circuit
QUANTUM CIRCUIT BUILDING BLOCKS- DECOMPOSITION OF QUANTUM GATES
INTO COMPUTATIONAL BASIS
Equivalence of C-NOT and 2 H gates to C-Z gate can also be proved using decomposition of qubits in to
computational basis as follows:
Equivalence of C-NOT and 2 H gates to C-Z gate can also be proved using decomposition of qubits in to
tensor products as follows:
H2 = I HXH = Z
= CZ gate
QUANTUM CIRCUIT BUILDING BLOCKS- DECOMPOSITION OF QUANTUM GATES
SOME EXAMPLES
Solution:
(0) (0)
1 1 0
| 00⟩ = ⊗ =
X | 00⟩ = | 00⟩ 0
0
α11 α12 α13 α14 1 1 α11 1
α21 α22 α23 α24 0 0 α21 0 ⟹ α11 = 1; α21 = 0; α31 = 0; α41 = 0;
= ⟹ =
α31 α32 α33 α34 0 0 α31 0
α41 α42 α43 α44 0 0 α31 0
X | 01⟩ = | 01⟩
1 α12 α13 α14 0 0
0 α22 α23 α24 1 1
= ⟹ α22 = 1; α12 = 0; α32 = 0; α42 = 0;
0 α32 α33 α34 0 0
0 α42 α43 α44 0 0
QUANTUM CIRCUIT BUILDING BLOCKS- DECOMPOSITION OF QUANTUM GATES
1 0 0 0
0 1 0 0
X= which is nothing but CNOT gate
0 0 0 1
0 0 1 0
Toffoli gate
target
Classical computation on a quantum computer
control
control
control
Toffoli gate
target
control target If both are 1 it flips the qubit
target
Questions for the class:
target
control
1) How would
Questions
Questions you
for
for use
the
the Toffoli gate to implement NAND gate?
class:
class:
2) How would you use Toffoli gate to make a "copy"?
1)
1)How
Howwould
wouldyou useuse
you Toffoli gategate
Toffoli to implement NAND gate?
to implement NAND gate?
2) Questions
How would you for
use the
Toffoli class:
gate to make a "copy"?
2) How would you use Toffoli gate to make a "copy"?
NAND gate
target
Questions for the from
class: Toffoli
1) How would you use Toffoli gate to implement NAND gate?
1) How would
2)you
Howusewould
Toffoli you
gate use
to implement NAND
Toffoli gate togate?
make a "copy"?
2) How would you use Toffoli gate to make a "copy"?
Use this part
Page 11
Suppose U is anofunitary
The utility Theoremoperation
4.1 liesoninathe
single qubit, there
following exist real
mysterious α, β, γ, δ which
numbers
looking corollary, such that
is the key to the construction
• of controlled
U = e iαmulti-qubit
• Y (γ)R
RZ (β)R unitary operations, as explained
• Z(δ)
in the next section.
⊕ ≡ ⊕
Corollary 4.2: Suppose ⊕ U is a unitary gate on a single
⊕ qubit. Then there exist unitary
operators A, B, C on a single qubit such that ABC = I and U = eiα AXBXC,
where α is Figure
some 4.13.
overall phase factor.
Controlled- gate with multiple targets.
Proof
Principle of deferred measurement: Measurements can always be moved from
In the notation of Theorem 4.1, set A ≡ Rz (β)Ry (γ/2), B ≡ Ry (−γ/2)Rz (−(δ + β)/2)
an intermediate stage of a quantum circuit to the end of the circuit; if the
and C ≡ Rz ((δ − β)/2). Note that
measurement results are used at any stage of the circuit then the classically
#γ $ # γ$ δ +quantum
controlled operations can be replaced by conditional β operations.
δ−β
% & % &
ABC = Rz (β)Ry Ry − Rz − Rz =I. (4.14)
2 2 2 2
Often, quantum measurements are performed as an intermediate step in a quantum
Since X 2 = I, and using Exercise 4.7, we see that
circuit, and the measurement results are used
% to conditionally
& control subsequent
% quan-
&
# $ # $
Quiz -2
HXH=Z; HZH=X; HYH=-Y using the three decomposition methods explained above
3. Express the Hadamard gate as a product of Rx and Rz rotations and e iϕ for some real ϕ
4. Show that the circuits are equivalent using the decomposition methods discussed
H H
=
H H
QUANTUM CIRCUIT BUILDING BLOCKS- READING OUT PHASE OF A CIRCUIT
Typically, in a quantum circuit phase of a qubit gets accumulated by the end of operations. If we need to
forward this phase into the next section of the circuit or read out the phase of a circuit, we follow the
procedure below:
An operation such as ψ → e iϕψ do not change the final probabilities and hence the measurement.
(0 e iα)
1 0
| 0⟩⟨0 | ⊗ I + | 1⟩⟨1 | ⊗ e iα I = ⊗I
IMPORTANT TO NOTE: The phase has now accumulated on the control bit.
(0 e iα)
1 0
=
U
| ψe⟩
THIS IS CALLED
(0 e iα)
1 0
PHASE KICKBACK
This is true even if there are large
number of target bits
Quiz -2
Construct a quantum circuit to add two two-qubit numbers x and y modulo 4. That is the circuit should perform
the transformation| x, y⟩ → | x, x + ymod4⟩