0% found this document useful (0 votes)
183 views

Introduction To Quantum Computing - Quantum Circuit Elements

This document provides an introduction to quantum computing by discussing quantum circuit elements and building blocks. It explains that quantum gates are important building blocks of quantum circuits. Quantum gates can be decomposed in three ways for analysis: using matrix multiplication, computational basis states, and tensor product decomposition. As examples, it shows the decomposition of the C-Z gate using each method. It also provides the matrix representation of the controlled-X gate and discusses how classical logic gates like the Toffoli gate could be implemented on a quantum computer using quantum gates. Finally, it poses questions about using the Toffoli gate to implement a NAND gate and make a copy.

Uploaded by

SaikiranKumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
183 views

Introduction To Quantum Computing - Quantum Circuit Elements

This document provides an introduction to quantum computing by discussing quantum circuit elements and building blocks. It explains that quantum gates are important building blocks of quantum circuits. Quantum gates can be decomposed in three ways for analysis: using matrix multiplication, computational basis states, and tensor product decomposition. As examples, it shows the decomposition of the C-Z gate using each method. It also provides the matrix representation of the controlled-X gate and discusses how classical logic gates like the Toffoli gate could be implemented on a quantum computer using quantum gates. Finally, it poses questions about using the Toffoli gate to implement a NAND gate and make a copy.

Uploaded by

SaikiranKumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Introduction to Quantum Computing

-Quantum Circuit elements


RECAP

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.

Quantum gates can be decomposed in three ways for analysis

▸ Matrix multiplication:

▸ Computational basis states:

▸ Tensor product decomposition:


QUANTUM CIRCUIT BUILDING BLOCKS- DECOMPOSITION OF QUANTUM GATES
USING 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

Solving, (I ⊗ H )CNOT(I ⊗ H ) we get C-Z gate

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:

| 00⟩ | 0+⟩ | 0+⟩ | 00⟩


I⊗H C-NOT I⊗H
| 01⟩ | 0−⟩ | 0−⟩ | 01⟩
I⊗H C-NOT I⊗H
| 10⟩ | 1+⟩ | 1+⟩ | 10⟩
I⊗H C-NOT I⊗H
| 11⟩ | 1−⟩ − | 1−⟩ − | 11⟩ Which is C-Z gate
I⊗H C-NOT I⊗H
QUANTUM CIRCUIT BUILDING BLOCKS- DECOMPOSITION OF QUANTUM GATES
INTO TENSOR PRODUCTS

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:

CNOT = | 0⟩⟨0 | ⊗ I + | 1⟩⟨1 | ⊗ X

(I ⊗ H )CNOT(I ⊗ H ) = | 0⟩⟨0 | ⊗ H 2 + | 1⟩⟨1 | ⊗ HXH

H2 = I HXH = Z

(I ⊗ H )CNOT(I ⊗ H ) = | 0⟩⟨0 | ⊗ I + | 1⟩⟨1 | ⊗ Z

= CZ gate
QUANTUM CIRCUIT BUILDING BLOCKS- DECOMPOSITION OF QUANTUM GATES

SOME EXAMPLES

What is the matrix representation of the Control-X gate

Solution:

Let us represent CX gate by an Unitary operation, U as below


α11 α12 α13 α14 X
α21 α22 α23 α24
Let X= α α32 α33 α34
31
α41 α42 α43 α44 1

(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

Similarly expanding the relations, X | 10⟩ = | 11⟩; X | 11⟩ = | 10⟩

We will find that,

1 0 0 0
0 1 0 0
X= which is nothing but CNOT gate
0 0 0 1
0 0 1 0

Classical Computations using quantum computer

How would you use quantum gates to design classical gates ?


Classical computation
Classical on a quantum
computation computercomputer
on a quantum
Classical
Toffolicomputation
gate on a quantum computer
control Toffoli gate
Toffoli
Toffoli gategate
Classical computation on a quantum computer

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

Questions for the class:

1) How would you use Toffoli gate to implement NAND gate?


2) How would you use Toffoli gate to make a "copy"?

Toffoli gate to make a copy

Page 11

Use this part


Page 11
form (4.12). Exercise 4.1:
In Exercise 2.11, which you should do now if you haven’t already done
it, you computed the eigenvectors of the Pauli matrices. Find the points on the
Exercise 4.10: (X-Y decomposition of rotations)
Bloch sphere which correspond Give eigenvectors
to the normalized a decomposition
of the different
%! &" '# ($
Pauli matrices.
IMPORTANT INFO-QUANTUM
analogous to Theorem CIRCUIT ELEMENTS
4.1 but using Rx instead of Rz .
The Pauli matrices give rise to three useful classes of unitary matrices when they are
Exercise 4.11: Suppose
Rotation matrices about m̂Y-and
X-,
exponentiated, and
the n̂Z-are
rotation non-parallel
operators
axes real
about the x̂, ŷ,unit
and ẑvectors
axes, definedin bythree
the equations:
dimensions. Use Theorem Rx (θ) ≡ 4.1 to =show
cos Ithat
θ an X
θ arbitrary cos single
θ
− qubit
sin θ
unitary
(4.4)U
! "
i
e−iθX/2 − i sin = 2 2
2 2 − i sin 2
θ
cos 2θ
may be written
θ θ cos θ
− sin θ
! "
Ry (θ) ≡ e−iθY /2iα= cos I − i sin Y = 2 2 (4.5)
U = in 2
Rn̂ (β)R 2 sin θ
cos θ
Figure 4.12. Controlled-U operation and its equivalent e terms m̂ (γ)R
of circuit elementsn̂ (δ), 2
! we−iθ/2
already 2
know " how to (4.13)
θ θ e 0
implement. The fourth qubit has U appliedRzif(θ)the
≡ first and =third
e−iθZ/2 cos qubits are set
I − i sin Z to= zero, and the second. qubit is set
(4.6)
to one. for appropriate choices of α, β, γ and 2δ. 2 0 eiθ/2

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

1. Show that the following identities are true:

HXH=Z; HZH=X; HYH=-Y using the three decomposition methods explained above

2. What does this circuit do ?


X X

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.

If we operate this as a controlled operation, there will be a tangible effect


For example, let V = e iα I is such a controlled operation

(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⟩

You might also like