[go: up one dir, main page]

0% found this document useful (0 votes)
55 views18 pages

MQC Notes 2

This document is a comprehensive overview of quantum gates and circuit design, covering topics such as qubit operations, fundamental quantum gates, and circuit composition. It includes detailed sections on various quantum gates like Pauli, Hadamard, and CNOT, as well as applications in quantum circuits. The document serves as a foundational resource for understanding the principles and applications of quantum computing.

Uploaded by

sahilsnaik.cs22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views18 pages

MQC Notes 2

This document is a comprehensive overview of quantum gates and circuit design, covering topics such as qubit operations, fundamental quantum gates, and circuit composition. It includes detailed sections on various quantum gates like Pauli, Hadamard, and CNOT, as well as applications in quantum circuits. The document serves as a foundational resource for understanding the principles and applications of quantum computing.

Uploaded by

sahilsnaik.cs22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Unit 2: Quantum Gates and Circuit Design

Dr. Venugopal K.
May 30, 2025

Contents
1 Introduction to Quantum Gates and Circuits 2
1.1 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Qubit Operations 3
2.1 Single-Qubit States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Multi-Qubit States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Quantum Gates as Unitary Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Fundamental Quantum Gates 3


3.1 Pauli Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Rotation Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 Hadamard Gate (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4 Phase Gate (S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.5 T Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.6 CNOT Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.7 CCNOT Gate (Toffoli Gate) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.7.1 Matrix Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.8 Circuit Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.8.1 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.9 Controlled Phase Gate (CPhase) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.9.1 Matrix Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.9.2 Circuit Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.9.3 Special Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.9.4 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.10 SWAP Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.10.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.10.2 Matrix Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.10.3 Circuit Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.11 Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.11.1 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.12 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Universal Set of Gates 8


4.1 Definition and Importance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Common Universal Gate Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 Universality Proof Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.4 Definition of SU(2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.4.1 General Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.5 Alternative Parameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Z-Y Decomposition 9
5.1 Theorem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1
1 INTRODUCTION TO QUANTUM GATES AND CIRCUITS

6 Quantum Circuit Composition 11


6.1 Circuit Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.2 Sequential and Parallel Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.3 Circuit Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.4 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

7 Basic Quantum Circuits 14


7.1 Bell State Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.2 Quantum Teleportation Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.3 Deutsch-Jozsa Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.4 Quantum Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.5 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

8 Examples and Applications 16


8.1 Building a Toffoli Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8.2 Implementing Single-Qubit Rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8.3 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

9 Understanding Key Concepts for Advanced Problems 16


9.1 CNOT and Entanglement Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9.2 Unitary Decomposition Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
9.3 Bell State Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
9.4 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

10 Conclusion 18

1 Introduction to Quantum Gates and Circuits


In quantum computing, information is processed using quantum gates that manipulate qubits. Under-
standing the fundamental gates and how they compose to form circuits is essential for quantum algorithm
design.

Key Concept

Unlike classical computing which uses bits (0 or 1), quantum computing uses qubits that can
exist in superpositions of states, represented as |ψ⟩ = α |0⟩ + β |1⟩ where |α|2 + |β|2 = 1.

1.1 Questions
1. What is the key difference between classical bits and quantum bits (qubits)?
Solution: Classical bits can only be in states 0 or 1, while qubits can exist in superpositions of
states represented as |ψ⟩ = α|0⟩ + β|1⟩ where α, β ∈ C and |α|2 + |β|2 = 1.

2. Explain how the superposition principle enables quantum parallelism, and discuss its implications
for quantum algorithm design.
Solution: The superposition principle allows a qubit to be in a linear combination of basis states,
enabling a quantum system to process multiple states simultaneously. For n qubits, the state space
has dimension 2n , allowing exponential parallelism. This enables quantum algorithms to evaluate
functions on many inputs at once, as seen in Deutsch-Jozsa and Grover’s algorithms. However,
measurement collapses the superposition, so algorithm design must carefully manage interference
patterns to amplify correct solutions.

Department of Mathematics 2 RV College of Engineering


3 FUNDAMENTAL QUANTUM GATES

2 Qubit Operations
2.1 Single-Qubit States
A single qubit state is represented as:
     
1 0 α
|ψ⟩ = α |0⟩ + β |1⟩ = α +β = (1)
0 1 β

where α, β ∈ C and |α|2 + |β|2 = 1.

2.2 Multi-Qubit States


Two-qubit states are represented in the computational basis {|00⟩ , |01⟩ , |10⟩ , |11⟩}:

|ψ⟩ = α00 |00⟩ + α01 |01⟩ + α10 |10⟩ + α11 |11⟩ (2)

Important Note

For n qubits, the state space has dimension 2n , showing the exponential advantage of quantum
computation.

2.3 Quantum Gates as Unitary Matrices


Quantum gates are represented by unitary matrices U that satisfy U † U = U U † = I, where U † is the
conjugate transpose of U .

2.4 Questions
1. Write the matrix representation of a general two-qubit state in the computational basis.
Solution:  
α00
α01 
|ψ⟩ = α00 |00⟩ + α01 |01⟩ + α10 |10⟩ + α11 |11⟩ =  
α10 
α11
|αij |2 = 1.
P
where i,j

2. Show that the Hadamard gate transforms between the X and Z bases. Specifically, prove that
H|+⟩ = |0⟩ and H|−⟩ = |1⟩, where |±⟩ = √12 (|0⟩ ± |1⟩).
Solution:

=1       
2 1 1  1  1 0
2 =|0⟩H|−⟩= √12 H(|0⟩−|1⟩)= 21  = =|1⟩
0 1 −1 −1 2 2

3 Fundamental Quantum Gates


3.1 Pauli Gates
The Pauli matrices form a basis for single-qubit operations:
       
1 0 0 1 0 −i 1 0
I= , X= , Y = , Z= (3)
0 1 1 0 i 0 0 −1

Department of Mathematics 3 RV College of Engineering


3.2 Rotation Operators 3 FUNDAMENTAL QUANTUM GATES

3.2 Rotation Operators

cos θ2 −i sin θ2
 
θ θ
Rx (θ) = e−iθX/2 = cos I − i sin X = (4)
2 2 −i sin θ2 cos θ2
cos θ2 − sin θ2
 
θ θ
Ry (θ) = e−iθY /2 = cos I − i sin Y = (5)
2 2 sin θ2 cos θ2
e−iθ/2
 
−iθZ/2 θ θ 0
Rz (θ) = e = cos I − i sin Z = (6)
2 2 0 eiθ/2

3.3 Hadamard Gate (H)


The Hadamard gate creates superpositions:
 
1 1 1
H=√ (7)
2 1 −1
Action:
1
H |0⟩ = √ (|0⟩ + |1⟩) = |+⟩ (8)
2
1
H |1⟩ = √ (|0⟩ − |1⟩) = |−⟩ (9)
2
Properties:
• H 2 = I (self-inverse)
• Transforms between X and Z bases: HXH = Z and HZH = X
• Creates uniform superpositions from computational basis states

3.4 Phase Gate (S)


The phase gate (also called S gate) introduces a π/2 phase shift:
 
1 0
S= (10)
0 i
Action:

S |0⟩ = |0⟩ (11)


S |1⟩ = i |1⟩ (12)

Properties:
• S2 = Z
• S4 = I
• Also called the π/2 phase gate

3.5 T Gate
The T gate is a π/4 phase gate:
 
1 0
T = (13)
0 eiπ/4
Properties:
• T2 = S
• T4 = Z
• Crucial for universal quantum computation

Department of Mathematics 4 RV College of Engineering


3.6 CNOT Gate 3 FUNDAMENTAL QUANTUM GATES

3.6 CNOT Gate


The Controlled-NOT gate is a two-qubit gate that flips the second qubit (target) if the first qubit (control)
is in state |1⟩:
 
1 0 0 0
 0 1 0 0
CNOT =   0 0 0 1
 (14)
0 0 1 0
Action in Dirac notation:

CNOT |00⟩ = |00⟩ (15)


CNOT |01⟩ = |01⟩ (16)
CNOT |10⟩ = |11⟩ (17)
CNOT |11⟩ = |10⟩ (18)

Or more compactly:
CNOT |a, b⟩ = |a, b ⊕ a⟩ (19)
where ⊕ represents XOR operation.
Properties:
• Self-inverse: CNOT2 = I
• Can create entanglement between qubits

• Essential component of most quantum algorithms

Entanglement Example

When CNOT acts on |+0⟩ = √12 (|00⟩ + |10⟩), it produces the Bell state |Φ+ ⟩ = √12 (|00⟩ + |11⟩),
which is an entangled state that cannot be factored into a product of individual qubit states.

3.7 CCNOT Gate (Toffoli Gate)


The CCNOT gate, also known as the Toffoli gate, is a three-qubit controlled gate that flips the target
qubit if and only if both control qubits are in the state |1⟩. It is a universal reversible gate, meaning any
classical reversible computation can be implemented using only CCNOT gates.

3.7.1 Matrix Representation


The CCNOT gate acts on three qubits and can be represented by the following 8 × 8 unitary matrix:
 
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
 
0 0 1 0 0 0 0 0
 
0 0 0 1 0 0 0 0
UCCNOT =  0
 (20)
 0 0 0 1 0 0 0 
0 0 0 0 0 1 0 0
 
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0

3.8 Circuit Representation


q0

q1

q2

Department of Mathematics 5 RV College of Engineering


3.9 Controlled Phase Gate (CPhase) 3 FUNDAMENTAL QUANTUM GATES

3.8.1 Properties
• Reversible: The CCNOT gate is its own inverse, i.e., UCCNOT
2
=I

• Universal: Any classical reversible computation can be implemented using CCNOT gates
• Quantum Universal: Combined with Hadamard gates, CCNOT gates form a universal set for
quantum computation

3.9 Controlled Phase Gate (CPhase)


The Controlled Phase (CPhase) gate is a two-qubit gate that applies a phase shift to the target qubit
only when the control qubit is in the state |1⟩. The phase shift parameter ϕ can be arbitrary.

3.9.1 Matrix Representation


The CPhase gate with phase parameter ϕ is represented by the following 4 × 4 unitary matrix:
 
1 0 0 0
0 1 0 0 
UCPhase (ϕ) = 0 0 1 0 
 (21)
0 0 0 eiϕ

3.9.2 Circuit Representation


q0

P (ϕ) q1

3.9.3 Special Cases


• Controlled-Z gate: When ϕ = π, the CPhase gate becomes the Controlled-Z gate

• Controlled-S gate: When ϕ = π/2, the CPhase gate becomes the Controlled-S gate
• Controlled-T gate: When ϕ = π/4, the CPhase gate becomes the Controlled-T gate

3.9.4 Properties
• Symmetric: The CPhase gate is symmetric with respect to control and target qubits

• Diagonal: The matrix representation is diagonal in the computational basis


• Phase-only: Only phases are modified, amplitudes remain unchanged

3.10 SWAP Gate


3.10.1 Definition
The SWAP gate is a two-qubit gate that exchanges the states of two qubits. It swaps the quantum
information between the two qubits without affecting the overall quantum state’s global phase.

3.10.2 Matrix Representation


The SWAP gate is represented by the following 4 × 4 unitary matrix:
 
1 0 0 0
0 0 1 0
USWAP =  0
 (22)
1 0 0
0 0 0 1

Department of Mathematics 6 RV College of Engineering


3.11 Decomposition 3 FUNDAMENTAL QUANTUM GATES

3.10.3 Circuit Representation


q0

q1

3.11 Decomposition
The SWAP gate can be decomposed into three CNOT gates:
q0

q1

This decomposition is useful for implementing SWAP gates on quantum hardware that only supports
CNOT gates natively.

3.11.1 Properties
• Involutory: The SWAP gate is its own inverse, i.e., USWAP
2
=I
• Symmetric: The effect is symmetric between the two qubits
• Permutation: Represents a permutation matrix in the computational basis

3.12 Questions
1. What is the action of the CNOT gate on the state |1⟩ ⊗ |+⟩?
Solution:
 
1 1
CNOT|1+⟩ = CNOT √ |10⟩ + √ |11⟩
2 2
1 1
= √ CNOT|10⟩ + √ CNOT|11⟩
2 2
1 1
= √ |11⟩ + √ |10⟩ = |1⟩ ⊗ |+⟩
2 2

2. Give the matrix representations of the Pauli X, Y, and Z gates from their definitions, and show
that they are both Hermitian and unitary.
Solution: The Pauli matrices are:
     
0 1 0 −i 1 0
X= , Y = , Z=
1 0 i 0 0 −1

For each matrix P ∈ {X, Y, Z}:


• Hermitian: P † = P (verify by conjugate transpose)
• Unitary: P † P = I (i.e, show that X † X = XX = I)
3. In Dirac notation, describe the action of the CNOT gate on a two-qubit state |ψ⟩ = α|00⟩ + β|01⟩ +
γ|10⟩ + δ|11⟩. Compute the output state. Also explain how this gate demonstrates entanglement
when applied to a specific input state.
Solution: The CNOT gate acts on a two-qubit system with the first qubit as control and the
second as target, flipping the target if the control is |1⟩. In Dirac notation, for basis states:
CN OT |xy⟩ = |x⟩|x ⊕ y⟩, where ⊕ is XOR. For a general state |ψ⟩ = α|00⟩ + β|01⟩ + γ|10⟩ + δ|11⟩:

CN OT |ψ⟩ = CN OT (α|00⟩ + β|01⟩ + γ|10⟩ + δ|11⟩) .

Applying CNOT: - |00⟩ → |0⟩|0 ⊕ 0⟩ = |00⟩, - |01⟩ → |0⟩|0 ⊕ 1⟩ = |01⟩, - |10⟩ → |1⟩|1 ⊕ 0⟩ = |11⟩, -
|11⟩ → |1⟩|1 ⊕ 1⟩ = |10⟩.

Department of Mathematics 7 RV College of Engineering


4 UNIVERSAL SET OF GATES

Thus:
CN OT |ψ⟩ = α|00⟩ + β|01⟩ + δ|10⟩ + γ|11⟩.
Entanglement Example: Consider |ψ⟩ = √1 (|00⟩ + |10⟩), a product state. Apply CNOT:
2
 
1 1 1
CN OT √ (|00⟩ + |10⟩) = √ (CN OT |00⟩ + CN OT |10⟩) = √ (|00⟩ + |11⟩).
2 2 2

The output √12 (|00⟩ + |11⟩) is a Bell state, which is entangled, as it cannot be written as a product
|ϕ⟩A ⊗ |χ⟩B . This shows CNOT can create entanglement, a key resource in quantum computing.

4 Universal Set of Gates


4.1 Definition and Importance
A set of quantum gates is considered universal if any arbitrary unitary operation can be approximated
to arbitrary precision using only gates from that set.

Universality Principle

A universal gate set allows us to implement any quantum algorithm without needing an infinite
variety of different fundamental gates.

4.2 Common Universal Gate Sets


Several combinations of gates are known to be universal:

1. Hadamard (H), Phase (S), and CNOT gates


2. Hadamard (H), T gate (π/8 phase), and CNOT gates

3. Rotation gates (Rx , Ry , Rz ) and CNOT gates

4.3 Universality Proof Sketch


To prove a gate set is universal, we typically show:

1. The set can generate arbitrary single-qubit gates (through combinations or approximations)
2. The set includes at least one multi-qubit entangling gate (like CNOT)

Solovay-Kitaev Theorem

According to the Solovay-Kitaev theorem, any single-qubit gate can be approximated to accuracy
ϵ using O(logc (1/ϵ)) gates from a finite universal set, where c is a constant.

4.4 Definition of SU(2)


The special unitary group SU(2) is defined as the set of all 2×2 complex matrices U that satisfy:

SU(2) = {U ∈ C2×2 : U † U = I and det(U ) = 1} (23)

4.4.1 General Form


Any element of SU(2) can be written in the general form:
 
a b
U= (24)
−b∗ a∗
where a, b ∈ C and |a|2 + |b|2 = 1.

Department of Mathematics 8 RV College of Engineering


4.5 Alternative Parameterization 5 Z-Y DECOMPOSITION

4.5 Alternative Parameterization


Using real parameters, any SU(2) matrix can be written as:

cos(θ/2)ei(ϕ+ψ)/2 sin(θ/2)ei(ϕ−ψ)/2
 
U= (25)
− sin(θ/2)e−i(ϕ−ψ)/2 cos(θ/2)e−i(ϕ+ψ)/2
where θ ∈ [0, 2π], ϕ ∈ [0, 2π], and ψ ∈ [0, 4π].

5 Z-Y Decomposition
5.1 Theorem Statement
Any single-qubit unitary operation U ∈ SU (2) can be decomposed as:

U = eiα Rz (β)Ry (γ)Rz (δ) (26)


where α, β, γ, δ ∈ R and Ry (θ), Rz (θ) are rotation operators.

5.2 Questions
1. State the Z-Y decomposition theorem for single-qubit unitaries.
Solution: Any single-qubit unitary operation U ∈ SU (2) can be decomposed as:
U = eiα Rz (β)Ry (γ)Rz (δ)
where α, β, γ, δ ∈ R and Ry , Rz are rotation operators.
 
√1
1 1
2. Perform the Z-Y decomposition for the Hadamard gate H = .
2 1 −1
Solution: The Z-Y decomposition expresses any single-qubit unitary gate using rotations around
the Z and Y axes of the Bloch sphere. The general form is:
U = eiα Rz (β)Ry (γ)Rz (δ)
where:
• Rz (θ) is a rotation around the Z-axis by angle θ
• Ry (θ) is a rotation around the Y-axis by angle θ
• eiα is a global phase factor
Step 1: Hadamard Gate Matrix The Hadamard gate is given by:
 
1 1 1
H=√
2 1 −1

Step 2: General Z-Y Decomposition Form The general unitary matrix can be written as:
 −i(β+δ)/2
cos(γ/2) −e−i(β−δ)/2 sin(γ/2)

e
U = eiα
ei(β−δ)/2 sin(γ/2) ei(β+δ)/2 cos(γ/2)

Step 3: Matrix Element Comparison Equating H to U , we examine each element:

1
U11 = eiα e−i(β+δ)/2 cos(γ/2) = √
2
iα −i(β−δ)/2 1
U12 = −e e sin(γ/2) = √
2
1
U21 = eiα ei(β−δ)/2 sin(γ/2) = √
2
1
U22 = eiα ei(β+δ)/2 cos(γ/2) = − √
2

Department of Mathematics 9 RV College of Engineering


5.2 Questions 5 Z-Y DECOMPOSITION

Step 4: Solving for Parameters


Magnitude Equations From |U11 |:
1 π
cos(γ/2) = √ =⇒ γ =
2 2

This also satisfies |U12 | = sin(γ/2) = √1 .


2
Phase Equations From U11 and U22 :

eiα e−i(β+δ)/2 = 1
eiα ei(β+δ)/2 = −1

This gives:
β+δ β+δ
α− =0 and α + =π
2 2
Solving yields:
π
α= , β+δ =π
2
From U12 :
−ie−i(β−δ)/2 = 1 =⇒ e−i(β−δ)/2 = i
Thus:
β−δ π
= − =⇒ β − δ = −π
2 2
Solving the System Combining with β + δ = π:

β = 0, δ=π

Final Decomposition The complete decomposition is:


π
H = eiπ/2 Rz (0)Ry Rz (π)
2
Since Rz (0) = I, this simplifies to:
π
H = eiπ/2 Ry Rz (π)
2

Verification Compute the product:


   −iπ/2   
π 1 1 −1 e 0 −i 1 1
Ry Rz (π) = √ =√
2 2 1 1 0 eiπ/2 2 1 −1

Multiply by eiπ/2 = i:    
−i · i 1 1 1 1 1
H= √ =√
2 1 −1 2 1 −1
This matches the original Hadamard gate, confirming our decomposition.
"√ √ #
2
√2
−√ 22
3. Using the Z-Y decomposition, express the single-qubit unitary gate U = 2 2
as a product
2 2
of rotation gates Rz (θ), Ry (ϕ), and a global phase. Verify that the resulting matrix is unitary.
Solution: The Z-Y decomposition states that any single-qubit unitary U can be written
 as
e−iθ/2
 
iα 0 cos(ϕ/2) − sin(ϕ/2)
U = e Rz (β)Ry (γ)Rz (δ), where Rz (θ) = , Ry (ϕ) = , and
"√ 0 eiθ/2 sin(ϕ/2) cos(ϕ/2)
√ #
2 √
−√ 22
 
2 1 −1
α, β, γ, δ ∈ R. Given U = √22 = 2 , we aim to find α, β, γ, δ.
2 1 1
2 2

Department of Mathematics 10 RV College of Engineering


6 QUANTUM CIRCUIT COMPOSITION

 −i(β+δ)/2
cos(γ/2) −e−i(β−δ)/2 sin(γ/2)

e
Rewrite U = eiα . Compare with U : - Magnitude con-
ei(β−δ)/2 sin(γ/2) ei(β+δ)/2 cos(γ/2)
√ √ √
2 2 2
dition: 2 = cos(γ/2) =⇒ cos(γ/2) = 2 =⇒ γ/2 = π/4 =⇒ γ = π/2. - For U11 = 2 ,

phase eiα e−i(β+δ)/2 = 1 =⇒ α − (β + δ)/2 = 0. - For U12 = − 22 , −eiα e−i(β−δ)/2 sin(π/4) =
√ √ √
− 22 =⇒ −eiα e−i(β−δ)/2 · 22 = − 22 =⇒ eiα e−i(β−δ)/2 = 1 =⇒ α − (β − δ)/2 = 0.
Solve: α − (β + δ)/2 = 0, α − (β − δ)/2 = 0. Subtract: (β − δ)/2 − (β + δ)/2 = 0 =⇒
−δ = 0 =⇒ δ = 0. Then α − β/2 = 0 =⇒ α = β/2. Set β = 0, so α = 0. Thus,
U = Rz (0)Ry (π/2)Rz (0) = Ry (π/2).
  " √2 √ #
2
cos(π/4) − sin(π/4) −
Compute: Ry (π/2) = = √22 √ 2 , which matches U .
sin(π/4) cos(π/4) 2
2 2
" √ √ #
2 2
Unitarity Check: Compute U † U : U † = 2√ √2 .
− 22 2
2

" √ √ # "√ √ #
2 2 2
−√ 22
 
† 2√ √2 √2
1 0
U U= = = I.
− 22 2 2 2 0 1
2 2 2

Thus, U is unitary, and U = Ry (π/2).


4. Explain the concept of a universal set of quantum gates and its importance in quantum computing.
Demonstrate that the Hadamard gate (H), phase gate (S), and CNOT gate form a universal set
by describing how they can approximate any single-qubit gate.
Solution: A universal set of quantum gates is a collection of gates sufficient to approximate any
unitary operation on a quantum computer to arbitrary precision. This is crucial for quantum
computing, as it ensures that any quantum algorithm can be implemented using a finite set of
gates, analogous to universal gates (e.g., NAND) in classical computing.
   
1 1 1 0
The Hadamard gate (H = √12 ), phase gate (S = ), and CNOT gate (a two-
1 −1 0 i
qubit gate) form a universal set. For single-qubit gates, any unitaryU can be expressed via
−iθ/2

e 0
the Z-Y decomposition as U = eiα Rz (β)Ry (γ)Rz (δ), where Rz (θ) = , Ry (θ) =
  0 eiθ/2
cos(θ/2) − sin(θ/2)
, and α, β, γ, δ ∈ R.
sin(θ/2) cos(θ/2)
- H and S generate rotations: S = Rz (π/2), and HSH approximates Ry (θ) via the identity
HSH ∝ Ry (π/2). Repeated applications and phase adjustments approximate any Ry (γ) and
Rz (β). - The global phase eiα can be adjusted using combinations of S. - CNOT enables multi-
qubit operations, ensuring universality for multi-qubit gates.
Thus, {H, S, CN OT } can approximate any unitary, making them universal.

6 Quantum Circuit Composition


6.1 Circuit Notation
Quantum circuits are represented horizontally with:
• Horizontal lines representing qubits

• Boxes representing single-qubit gates


• Vertical lines with control points representing multi-qubit controlled operations
• Time flowing from left to right

Department of Mathematics 11 RV College of Engineering


6.2 Sequential and Parallel Operations 6 QUANTUM CIRCUIT COMPOSITION

6.2 Sequential and Parallel Operations


• Sequential operations: Gates applied one after the other to the same qubit(s) are represented
by matrix multiplication: Utotal = Un · · · U2 · U1

• Parallel operations: Gates applied simultaneously to different qubits are represented by tensor
products: Utotal = U1 ⊗ U2 ⊗ · · · ⊗ Un

6.3 Circuit Identities


Useful circuit identities (prove them by usual matrix multiplication):
• HXH = Z
• HZH = X

• HY H = −Y
• Z = S2
• S = T2
• (I ⊗ H) · CNOT · (I ⊗ H) = CZ (Control-Z gate)

6.4 Questions
1. What is the matrix representation of two Hadamard gates applied in parallel to two qubits?
Solution:  
1 1 1 1
1 1 −1 1 −1
H ⊗H =  
2 1 1 −1 −1
1 −1 −1 1

2. Design a quantum circuit that swaps the states of two qubits without using a SWAP gate, and
derive its matrix representation.
Solution: The swap can be implemented using three CNOT gates:

|a⟩ + |b⟩

|b⟩ + + |a⟩

The matrix representation is:


 
1 0 0 0
0 0 1 0
CNOT1,2 CNOT2,1 CNOT1,2 =
0
 = SWAP
1 0 0
0 0 0 1

3. Construct a quantum circuit using Hadamard (H) and CNOT gates to prepare the Bell state
|Φ+ ⟩ = √12 (|00⟩ + |11⟩) from the initial state |00⟩. Provide the circuit diagram (in text form),
compute the state evolution using matrix operations, and verify the output is normalized.
Solution: To prepare the Bell state |Φ+ ⟩ = √12 (|00⟩ + |11⟩) from |00⟩, use a circuit with one
Hadamard gate on the first qubit followed by a CNOT gate (first qubit as control, second as
target).
Circuit Diagram (Text Form):

|q0 ⟩ : |0⟩ − − − [H] − − − ∗ − − − |q1 ⟩ : |0⟩ − − − − − − − − − X − −−

Where [H] is the Hadamard gate, ∗ is the control, and X is the target of CNOT.

Department of Mathematics 12 RV College of Engineering


6.4 Questions 6 QUANTUM CIRCUIT COMPOSITION

 
1
0
State Evolution: 1. Initial state: |00⟩ =  
 . 2. Apply H to the first qubit: H ⊗ I =
0
  0
1 0 1 0
0 1 0 1
√1  .
2 1 0 −1 0
0 1 0 −1
 
1
1   = √1 (|00⟩ + |10⟩).
0
(H ⊗ I)|00⟩ = √ 
2 1
 2
0
 
1 0 0 0
0 1 0 0
3. Apply CNOT: Matrix form is CN OT =  0 0 0 1.

0 0 1 0
 
1 1 1
CN OT √ (|00⟩ + |10⟩) = √ (CN OT |00⟩ + CN OT |10⟩) = √ (|00⟩ + |11⟩).
2 2 2
 
1
0
Final state: |Φ+ ⟩ = √12 (|00⟩ + |11⟩) = √12 
0.

1
  
Normalization Check: Compute the norm: ⟨Φ+ |Φ+ ⟩ = √12 (⟨00| + ⟨11|) √12 (|00⟩ + |11⟩) =
1
2 (⟨00|00⟩ + ⟨11|11⟩) = 12 (1 + 1) = 1. The state is normalized.
The circuit correctly produces the entangled Bell state, verified by matrix operations and normal-
ization.

4. Consider a two-qubit quantum circuit with a Hadamard gate on the first qubit followed by a phase
gate (S) on the second qubit. Starting from |00⟩, compute the output state in Dirac notation using
matrix operations. Determine if the output state is entangled.
Solution: The circuit  applies
 H to the first qubit and S to the second, so the operation is (H ⊗ S).
1
0
Initial state: |00⟩ = 
0.

0
 
    1 0 1 0
1 1 1 0 0 i 0 i
- Hadamard: H = √12 . - Phase gate: S = . - Combined: H⊗S = √12  1 0 −1 0 .

1 −1 0 i
0 i 0 −i
Apply to |00⟩:  
1
1   = √1 (|00⟩ + |10⟩).
0
(H ⊗ S)|00⟩ = √ 1
2  2
0
In Dirac notation: |ψ⟩ = √1 (|00⟩
+ |10⟩).
2
P P
Entanglement Check: A state |ψ⟩ = ij aij |ij⟩ is separable if it can be written as ( i ci |i⟩) ⊗
( j dj |j⟩). Write |ψ⟩ = √12 |0⟩|0⟩ + √12 |1⟩|0⟩ = ( √12 |0⟩ + √12 |1⟩) ⊗ |0⟩. This is a product state, so it
P

is not entangled.
Thus, the output is √1 (|00⟩ + |10⟩), and it is separable.
2

Department of Mathematics 13 RV College of Engineering


7 BASIC QUANTUM CIRCUITS

7 Basic Quantum Circuits


7.1 Bell State Preparation
The Bell states are maximally entangled two-qubit states:
1
|Φ+ ⟩ = √ (|00⟩ + |11⟩) (27)
2
1
|Φ− ⟩ = √ (|00⟩ − |11⟩) (28)
2
1
|Ψ+ ⟩ = √ (|01⟩ + |10⟩) (29)
2
− 1
|Ψ ⟩ = √ (|01⟩ − |10⟩) (30)
2
To prepare |Φ+ ⟩ from |00⟩:
1. Apply H gate to the first qubit: (H ⊗ I) |00⟩ = √1 (|00⟩ + |10⟩)
2

2. Apply CNOT gate: CNOT · √1 (|00⟩ + |10⟩) = √1 (|00⟩ + |11⟩) = |Φ+ ⟩


2 2

Circuit Diagram for Bell State

Bell state preparation circuit:


• First qubit: |0⟩ → H → Control

• Second qubit: |0⟩ → Target

7.2 Quantum Teleportation Circuit


Quantum teleportation transfers a quantum state from one qubit to another using entanglement and
classical communication:
Quantum teleportation circuit components:
• First qubit (state to teleport |ψ⟩): CNOT control → H gate → measurement
• Second qubit (entangled): H gate → CNOT target → measurement
• Third qubit (receiver): X gate (controlled by second qubit measurement) → Z gate (controlled by
first qubit measurement)

7.3 Deutsch-Jozsa Algorithm


The Deutsch-Jozsa algorithm determines if a function f : {0, 1}n → {0, 1} is constant or balanced with
a single evaluation:
Deutsch-Jozsa circuit:
⊗n
• Input register: |0⟩ → H ⊗n → Uf → H ⊗n → measurement
• Ancilla qubit: |1⟩ → H → Uf (jointly with input register)
where Uf is the oracle that computes f .

7.4 Quantum Fourier Transform


The QFT is a key component in many quantum algorithms:
N −1
1 X 2πijk/N
QFT |j⟩ = √ e |k⟩ (31)
N k=0
For n qubits (N = 2n ), the circuit involves Hadamard gates and controlled rotation gates.

Department of Mathematics 14 RV College of Engineering


7.5 Questions 7 BASIC QUANTUM CIRCUITS

7.5 Questions
1. Draw the quantum circuit for preparing a Bell state |Φ+ ⟩.
Solution:
H
|0⟩

|0⟩ +

2. Explain the quantum teleportation protocol step-by-step, including the role of entanglement and
classical communication.
Solution:
(a) Alice and Bob share an entangled Bell pair (|Φ+ ⟩)
(b) Alice performs a Bell measurement between her qubit to teleport and her half of the Bell pair
(c) She sends the 2 classical bits of measurement results to Bob
(d) Bob applies appropriate Pauli corrections (I, X, Z, or XZ) based on the received bits
(e) The original state is now on Bob’s qubit, with Alice’s qubits in known states
3. Design a quantum circuit using Hadamard (H), CNOT, and phase (S) gates to transform |00⟩ into
the state |ψ⟩ = 12 (|00⟩ + i|01⟩ + |10⟩ + i|11⟩). Provide the circuit diagram (text form), derive the
output state using matrix operations, and confirm the state is normalized.
Solution: To produce |ψ⟩ = 12 (|00⟩ + i|01⟩ + |10⟩ + i|11⟩), consider a circuit that creates superpo-
sition and phases. Use: (1) H on both qubits to create 21 (|00⟩ + |01⟩ + |10⟩ + |11⟩), (2) S on the
second qubit to apply i to |01⟩ and |11⟩.
Circuit Diagram (Text Form):
|q0 ⟩ : |0⟩ − − − [H] − − − − − − − − − |q1 ⟩ : |0⟩ − − − [H] − − − [S] − −−
 
1  
0 1 1 1
State Evolution: 1. Initial state: |00⟩ =  . 2. Apply H ⊗ H: H = √2
  , so
0 1 −1
0
 
1 1 1 1
1 1 −1 1 −1
H ⊗H =  .
2 1 1 −1 −1
1 −1 −1 1
 
1
1 1 = 1 (|00⟩ + |01⟩ + |10⟩ + |11⟩).
(H ⊗ H)|00⟩ = 
1
2  2

1
 
1 0
3. Apply I ⊗ S: S = , so
0 i  
1 0 0 0
0 i 0 0
I ⊗S = 0 0 1 0 .

0 0 0 i
1 1
(I ⊗ S) (|00⟩ + |01⟩ + |10⟩ + |11⟩) = (|00⟩ + i|01⟩ + |10⟩ + i|11⟩).
2 2
Final state: |ψ⟩ = 21 (|00⟩ + i|01⟩ + |10⟩ + i|11⟩).
Normalization Check:
1
⟨ψ|ψ⟩ = (⟨00| + (−i)⟨01| + ⟨10| + (−i)⟨11|)(|00⟩ + i|01⟩ + |10⟩ + i|11⟩).
4
Inner products: ⟨00|00⟩ = 1, ⟨01|01⟩ = (−i)(i) = 1, ⟨10|10⟩ = 1, ⟨11|11⟩ = (−i)(i) = 1. Sum:
1
4 (1 + 1 + 1 + 1) = 1. The state is normalized.
The circuit produces the desired state, verified by matrix operations and normalization.

Department of Mathematics 15 RV College of Engineering


9 UNDERSTANDING KEY CONCEPTS FOR ADVANCED PROBLEMS

8 Examples and Applications


8.1 Building a Toffoli Gate
The Toffoli (CCNOT) gate can be constructed from Hadamard, T, T† , and CNOT gates:

Toffoli gate decomposition:

• First control qubit (|a⟩): Controls 1st, 4th, and 7th CNOT gates
• Second control qubit (|b⟩): Controls 2nd, 5th, and 6th CNOT gates
• Target qubit (|c⟩): H gate → CNOT target → T† gate → CNOT target → CNOT target → T gate
→ CNOT target → CNOT target → H gate

8.2 Implementing Single-Qubit Rotations


A single-qubit rotation by an arbitrary angle can be approximated using H, T and S gates:

Solovay-Kitaev Approximation

Using the Solovay-Kitaev algorithm, we can approximate any single-qubit unitary with a sequence
of gates from {H, T } to arbitrary precision.

8.3 Questions
1. What is the minimum number of two-qubit gates needed to implement a Toffoli (CCNOT) gate?
Solution: The Toffoli gate can be implemented with 6 CNOT gates combined with single-qubit
gates.
2. Show how to implement a controlled-Ry (θ) gate using two CNOT gates and three single-qubit Ry
gates.
Solution: The decomposition is:

ctrl

Ry (θ/2) Ry (−θ/2) Ry (θ/2)


target + +

9 Understanding Key Concepts for Advanced Problems


9.1 CNOT and Entanglement Analysis
When analyzing CNOT operations on superposition states:

CNOT Entanglement Process

CNOT transforms separable states into entangled states when the control qubit is in superposition:
1 1
CNOT( √ (|0⟩ + |1⟩) ⊗ |0⟩) = CNOT( √ (|00⟩ + |10⟩)) (32)
2 2
1
= √ (|00⟩ + |11⟩) (33)
2
This state cannot be factored into separate qubit states, proving entanglement.

Department of Mathematics 16 RV College of Engineering


9.2 Unitary Decomposition
9 Practice
UNDERSTANDING KEY CONCEPTS FOR ADVANCED PROBLEMS

9.2 Unitary Decomposition Practice


For a general unitary U , follow these steps to find its Z-Y decomposition:
1. Verify U is unitary: U † U = I
2. Find the determinant to determine global phase: det(U ) = eiθ
3. Extract the global phase: α = θ/2
4. Compute U ′ = e−iα U so that det(U ′ ) = 1
5. Find Euler angles β, γ, δ such that U ′ = Rz (β)Ry (γ)Rz (δ)

Z-Y Decomposition Example


!
√1 √i
For U = 2 2 :
√i √1
2 2

• det(U ) = 1 so α = 0
√ 
• γ = 2 arccos 1/ 2 = π/2
√ √
• β = arg(1/ 2) − arg(i/ 2) = 0 − π/2 = −π/2
√ √
• δ = arg(1/ 2) + arg(i/ 2) = 0 + π/2 = π/2
Therefore, U = Rz (−π/2)Ry (π/2)Rz (π/2)

9.3 Bell State Analysis


For analysis of Bell state preparation:

Step-by-Step Bell State Preparation

Starting with |00⟩:

|ψ0 ⟩ = |00⟩ (34)


1
|ψ1 ⟩ = (H ⊗ I) |ψ0 ⟩ = √ (|00⟩ + |10⟩) (35)
2
1
|ψ2 ⟩ = CNOT |ψ1 ⟩ = √ (|00⟩ + |11⟩) (36)
2

The final state |ψ2 ⟩ = |Φ+ ⟩ is entangled because it cannot be written as a product state |a⟩ ⊗ |b⟩
for any single-qubit states |a⟩ and |b⟩.

9.4 Questions
1. Prove that the state √1 (|00⟩ + |11⟩) is entangled.
2
Solution: Assume it can be written as (a|0⟩+b|1⟩)⊗(c|0⟩+d|1⟩) =√ac|00⟩+ad|01⟩+bc|10⟩+bd|11⟩.
To match the given state, we need ad = bc = 0 and ac = bd = 1/ 2, which is impossible. Hence,
the state is entangled.
2. Analyze the entanglement creation process when applying a CNOT gate to the state |+⟩|0⟩, and
calculate the resulting state’s entanglement entropy.
Solution:
 
1
CNOT| + 0⟩ = CNOT √ (|00⟩ + |10⟩)
2
1
= √ (|00⟩ + |11⟩) = |Φ+ ⟩
2

Department of Mathematics 17 RV College of Engineering


10 CONCLUSION

The reduced density matrix for either qubit is 21 I, giving entanglement entropy:
 
1 1
S = −tr I log2 I = 1 bit
2 2

10 Conclusion
Understanding quantum gates and circuits provides the foundation for quantum algorithm design. The
universality of certain gate sets allows us to implement arbitrary quantum computations using a finite
set of elementary operations.
Key points to remember:

• Universal gate sets (like H, S, CNOT) can approximate any quantum operation
• Z-Y decomposition breaks down any single-qubit operation into rotation gates
• Quantum entanglement, created through gates like CNOT, is a critical quantum resource
• Circuit composition follows specific mathematical rules using matrix multiplication and tensor
products

Department of Mathematics 18 RV College of Engineering

You might also like