MQC Notes 2
MQC Notes 2
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
5 Z-Y Decomposition 9
5.1 Theorem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1
1 INTRODUCTION TO QUANTUM GATES AND CIRCUITS
10 Conclusion 18
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.
2 Qubit Operations
2.1 Single-Qubit States
A single qubit state is represented as:
1 0 α
|ψ⟩ = α |0⟩ + β |1⟩ = α +β = (1)
0 1 β
|ψ⟩ = α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.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
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
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
Or more compactly:
CNOT |a, b⟩ = |a, b ⊕ a⟩ (19)
where ⊕ represents XOR operation.
Properties:
• Self-inverse: CNOT2 = I
• Can create entanglement between qubits
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.
q1
q2
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
P (ϕ) q1
• 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
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
Applying CNOT: - |00⟩ → |0⟩|0 ⊕ 0⟩ = |00⟩, - |01⟩ → |0⟩|0 ⊕ 1⟩ = |01⟩, - |10⟩ → |1⟩|1 ⊕ 0⟩ = |11⟩, -
|11⟩ → |1⟩|1 ⊕ 1⟩ = |10⟩.
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.
Universality Principle
A universal gate set allows us to implement any quantum algorithm without needing an infinite
variety of different fundamental gates.
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.
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:
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)
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
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, δ=π
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
−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
• Parallel operations: Gates applied simultaneously to different qubits are represented by tensor
products: Utotal = U1 ⊗ U2 ⊗ · · · ⊗ Un
• 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⟩
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):
Where [H] is the Hadamard gate, ∗ is the control, and X is the target of CNOT.
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
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.
• 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
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
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.
• 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)
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
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