0% found this document useful (0 votes)
2 views19 pages

MQC_Notes___3

The document discusses quantum algorithms, focusing on the Deutsch and Deutsch-Jozsa algorithms, which demonstrate quantum advantage by solving problems with fewer queries than classical methods. The Deutsch algorithm determines if a function is constant or balanced using one quantum query, while the Deutsch-Jozsa algorithm generalizes this to n-bit functions, achieving exponential speedup. Additionally, the Bernstein-Vazirani algorithm is introduced, which allows for the determination of a secret string with a single query, showcasing the efficiency of quantum computation.

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)
2 views19 pages

MQC_Notes___3

The document discusses quantum algorithms, focusing on the Deutsch and Deutsch-Jozsa algorithms, which demonstrate quantum advantage by solving problems with fewer queries than classical methods. The Deutsch algorithm determines if a function is constant or balanced using one quantum query, while the Deutsch-Jozsa algorithm generalizes this to n-bit functions, achieving exponential speedup. Additionally, the Bernstein-Vazirani algorithm is introduced, which allows for the determination of a secret string with a single query, showcasing the efficiency of quantum computation.

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/ 19

Unit 3: Quantum Algorithms - 1

Dr. Venugopal K.

June 2, 2025

Key Quantum Concepts


1. Phase Kickback: The oracle Uf induces phases:

Uf |x⟩ |−⟩ = (−1)f (x) |x⟩ |−⟩

where |−⟩ = √1 (|0⟩


2
− |1⟩)
2. Parallel Evaluation: Superposition allows evaluating f at both inputs simultane-
ously:
|0⟩ + |1⟩ (−1)f (0) |0⟩ + (−1)f (1) |1⟩
!
Uf √ |−⟩ = √ |−⟩
2 2

1 Deutsch Algorithm
1.1 Introduction
The Deutsch algorithm, proposed by David Deutsch in 1985, is the first quantum algorithm
demonstrating quantum advantage. It solves a toy problem that illustrates the power of
quantum parallelism.

1.2 Problem Definition


Given a function f : {0, 1} → {0, 1} promised to be either:
• Constant: f (0) = f (1)
• Balanced: f (0) ̸= f (1)
Determine which category f belongs to.

1.3 Classical Complexity


Classically, determining whether f is constant or balanced requires:

1
1.4 Circuit 1 DEUTSCH ALGORITHM

Best case 1 query (if outputs differ)


Worst case 2 queries (must check both inputs)

Figure 1: The Deutsch Algorithm

1.4 Circuit
1.5 Analysis
Initial State Preparation:
|ψ0 ⟩ = |0⟩ ⊗ |1⟩
• First qubit: Input register
• Second qubit: Ancilla prepared in |1⟩ for phase kickback
Step 1: Hadamard Transformation Apply H to both qubits:
1 1
H |0⟩ = √ (|0⟩ + |1⟩), H |1⟩ = √ (|0⟩ − |1⟩)
2 2
1
|ψ1 ⟩ = (H ⊗ H) |ψ0 ⟩ = (|0⟩ + |1⟩)(|0⟩ − |1⟩)
2
This creates superposition of all possible inputs with phase difference.
Step 2: Oracle Application The oracle Uf implements:
Uf |x⟩ |y⟩ = |x⟩ |y ⊕ f (x)⟩
Applying to |ψ1 ⟩:
1
|ψ2 ⟩ = [|0⟩ (|0 ⊕ f (0)⟩ − |1 ⊕ f (0)⟩) + |1⟩ (|0 ⊕ f (1)⟩ − |1 ⊕ f (1)⟩)]
2

Intermediate Step: Phase Analysis For any f (x) ∈ {0, 1}:



|0⟩ − |1⟩ if f (x) = 0
|0 ⊕ f (x)⟩ − |1 ⊕ f (x)⟩ =
|1⟩ − |0⟩ = −(|0⟩ − |1⟩) if f (x) = 1

This can be compactly written as:


|0 ⊕ f (x)⟩ − |1 ⊕ f (x)⟩ = (−1)f (x) (|0⟩ − |1⟩)

Department of Mathematics 2 RV College of Engineering


1.5 Analysis 1 DEUTSCH ALGORITHM

Step 3: State Simplification Substitute phase relationship:


1h i
|ψ2 ⟩ = (−1)f (0) |0⟩ + (−1)f (1) |1⟩ (|0⟩ − |1⟩)
2
Key observation: The ancilla qubit remains unchanged and can be factored out.
Step 4: Ancilla Removal Focus on the first qubit (ignoring global phase and normalized):
1 h i
|ψ3 ⟩ = √ (−1)f (0) |0⟩ + (−1)f (1) |1⟩
2

Factor out (−1)f (0) :


1 h i
= (−1)f (0) √ |0⟩ + (−1)f (0)⊕f (1) |1⟩
2

Intermediate Step: Function Property Encoding Define s = f (0) ⊕ f (1):


1
|ψ3 ⟩ = √ (|0⟩ + (−1)s |1⟩)
2
• s = 0: Constant function (f (0) = f (1))
• s = 1: Balanced function (f (0) ̸= f (1))
Step 5: Final Hadamard Gate

1
H |ψ3 ⟩ = √ (H |0⟩ + (−1)s H |1⟩)
2
1 1 s 1
" #
= √ √ (|0⟩ + |1⟩) + (−1) √ (|0⟩ − |1⟩)
2 2 2

1
H |ψ3 ⟩ = [(1 + (−1)s ) |0⟩ + (1 − (−1)s ) |1⟩]
2
Measurement Outcomes:

2 1
1 + (−1)s if s = 0 (constant)
Probability of |0⟩ : =
2 0 if s = 1 (balanced)


s 2 0
1 − (−1) if s = 0 (constant)
Probability of |1⟩ : =
2 1 if s = 1 (balanced)

Department of Mathematics 3 RV College of Engineering


1.6 Conclusion 2 DEUTSCH-JOZSA ALGORITHM

1.6 Conclusion
The measurement outcome deterministically reveals:
• |0⟩ → Constant function
• |1⟩ → Balanced function
with only one quantum query to the oracle, compared to two classical queries required in
the worst case.

Key Features Demonstrated:


• Quantum parallelism (evaluating f (0) and f (1) simultaneously)
• Phase kickback (oracle’s effect moved to computational basis states)
• Constructive/destructive interference (Hadamard transforms phases to measurable prob-
abilities)

1.7 Exercises
1. Verify the final state for all four 1-bit functions:
(a) f (x) = 0
(b) f (x) = 1
(c) f (x) = x
(d) f (x) = 1 ⊕ x
2. Show that measuring the second qubit gives no information about f .
3. Design a 2-qubit Deutsch-like algorithm that determines whether a function f : {0, 1}2 →
{0, 1} is constant or balanced.

2 Deutsch-Jozsa Algorithm
2.1 Introduction
The Deutsch-Jozsa algorithm generalizes the Deutsch algorithm to n-bit functions, providing
an exponential speedup over classical algorithms for a promise problem.

2.2 Problem Definition


Given f : {0, 1}n → {0, 1} promised to be either:
• Constant
• Balanced (exactly half inputs map to 1)

Department of Mathematics 4 RV College of Engineering


2.3 Circuit 2 DEUTSCH-JOZSA ALGORITHM

Determine which category f belongs to.

2.3 Circuit

Figure 2: The Deutsch-Jozsa Algorithm

2.4 Mathematical Derivation


Initial State Preparation:
|ψ0 ⟩ = |0⟩⊗n ⊗ |1⟩
• First n qubits: Input register
• Last qubit: Ancilla prepared in |1⟩ for phase kickback
Step 1: Hadamard Transformation Apply H to all qubits:
1 1
H ⊗(n+1) |ψ0 ⟩ = √ n |x⟩ ⊗ √ (|0⟩ − |1⟩)
X
2 x∈{0,1}n 2

Creates uniform superposition over all n-bit strings with phase difference.
Step 2: Oracle Application The oracle Uf implements:

Uf |x⟩ |y⟩ = |x⟩ |y ⊕ f (x)⟩

Applying to |ψ1 ⟩:
1 X
|ψ2 ⟩ = √ n |x⟩ (|0 ⊕ f (x)⟩ − |1 ⊕ f (x)⟩)
2 x

Intermediate Step: Phase Analysis Using phase kickback:

|0 ⊕ f (x)⟩ − |1 ⊕ f (x)⟩ = (−1)f (x) (|0⟩ − |1⟩)

Thus:
1 X 1
|ψ2 ⟩ = √ n (−1)f (x) |x⟩ ⊗ √ (|0⟩ − |1⟩)
2 x 2

Department of Mathematics 5 RV College of Engineering


2.4 Mathematical Derivation 2 DEUTSCH-JOZSA ALGORITHM

Step 3: Ancilla Removal The ancilla qubit factors out:


1 X
|ψ3 ⟩ = √ n (−1)f (x) |x⟩
2 x

Step 4: Final Hadamard Transform Apply H ⊗n to first n qubits:


1 X
H ⊗n |ψ3 ⟩ = (−1)f (x)+x·z |z⟩
2n x,z

where x · z denotes bitwise inner product mod 2.


Measurement Analysis:
• Constant case (f (x) = c):

(−1)c X
|ψ4 ⟩ = (−1)x·z |z⟩ = (−1)c |0⟩⊗n
2n x,z

since x (−1)
x·z
= 2n δz,0
P

• Balanced case:
2
⊗n 2 1 X
⟨0| |ψ4 ⟩ = n (−1)f (x)
=0
2 x
by definition of balanced functions
Measurement Outcomes:
• Measure |0⟩⊗n : Constant function (probability 1)
• Measure any other state: Balanced function (probability 1)

Key Features
• Quantum Parallelism: Evaluating f (0) and f (1) simultaneously
• Interference: Hadamard gates create constructive/destructive interference
• Measurement: Extracting global information about f from a single measurement
• Requires only one quantum query vs. Ω(2n−1 + 1) classical queries
• Perfect discrimination between constant/balanced classes
• Generalizes Deutsch’s algorithm (n = 1 case)
• Demonstrates exponential quantum advantage for oracle problems

Department of Mathematics 6 RV College of Engineering


2.5 Exercises 3 BERNSTEIN-VAZIRANI ALGORITHM

2.5 Exercises
1. Show that for balanced functions, the amplitude of |0⟩⊗n vanishes.
2. Construct the oracle Uf for the case when f (x) is the AND of all input bits.
3. Analyze the algorithm’s behavior when the promise is violated (i.e., f is neither con-
stant nor perfectly balanced).
4. How would you modify the algorithm if f is promised to be either constant or satisfy
f (x) = s · x for some secret string s?

3 Bernstein-Vazirani Algorithm
Problem Statement: Given a function f : {0, 1}n → {0, 1} defined as:
n
f (x) = s · x mod 2 =
M
s i xi
i=1

where s ∈ {0, 1}n is a secret string, determine s with minimal queries.

3.1 Circuit

Figure 3: Bernstein-Vazirani Algorithm

Initial State Preparation:


|ψ0 ⟩ = |0⟩⊗n ⊗ |1⟩
• First n qubits: Input register
• Last qubit: Ancilla prepared in |1⟩ for phase kickback
Step 1: Hadamard Transformation Apply H to all qubits:
1 1
|ψ1 ⟩ = H ⊗(n+1) |ψ0 ⟩ = √ n |x⟩ ⊗ √ (|0⟩ − |1⟩)
X
2 x∈{0,1}n 2

Department of Mathematics 7 RV College of Engineering


3.1 Circuit 3 BERNSTEIN-VAZIRANI ALGORITHM

Step 2: Oracle Application The oracle Uf implements:

Uf |x⟩ |y⟩ = |x⟩ |y ⊕ f (x)⟩ = |x⟩ |y ⊕ (s · x)⟩

Applying to |ψ1 ⟩:
1 X
|ψ2 ⟩ = √ n |x⟩ (|0 ⊕ (s · x)⟩ − |1 ⊕ (s · x)⟩)
2 x

Intermediate Step: Phase Kickback

|0 ⊕ (s · x)⟩ − |1 ⊕ (s · x)⟩ = (−1)s·x (|0⟩ − |1⟩)

Thus:
1 X 1
|ψ2 ⟩ = √ n (−1)s·x |x⟩ ⊗ √ (|0⟩ − |1⟩)
2 x 2

Step 3: Ancilla Removal The ancilla qubit factors out:


1 X
|ψ3 ⟩ = √ n (−1)s·x |x⟩
2 x

Step 4: Final Hadamard Transform Apply H ⊗n to first n qubits:


1 X
H ⊗n |ψ3 ⟩ = (−1)s·x+x·z |z⟩
2 x,z
n

where x · z = xi zi .
Ln
i=1

Measurement Analysis:
1 X
⟨z|ψ4 ⟩ = (−1)s·x+x·z
2 x
n

1 X
= n (−1)x·(s⊕z)
2 x
= δz,s (since (−1)x·w = 2n δw,0 )
X

Measurement Outcome:

Probability of measuring |s⟩ = | ⟨s|ψ4 ⟩ |2 = 1

Key Features
• Single Query: Determines s with one oracle call
• Classical Comparison: Requires n classical queries
• Phase Encoding: Oracle encodes s in relative phases
• Perfect Reconstruction: Hadamard transform perfectly extracts s

Department of Mathematics 8 RV College of Engineering


4 SIMON’S PERIODICITY ALGORITHM

Complexity Comparison
Quantum 1 query
Classical Ω(n) queries

4 Simon’s Periodicity Algorithm


Historical Context
Simon’s algorithm was introduced by Daniel Simon in 1994 and was one of the first quan-
tum algorithms to demonstrate an exponential speedup over classical algorithms. It laid
foundational concepts for later algorithms such as Shor’s factoring algorithm.

Conceptual Importance
• Exponential Speedup: Solves a specific oracle problem exponentially faster than
any classical algorithm.
• Quantum Paradigm Shift: Showcases the power of quantum parallelism and inter-
ference.
• Foundational Elements: Utilizes superposition, unitary operations, and measure-
ment to extract global structure from a function.

4.1 Problem Statement and Mathematical Background


Given a function f : {0, 1}n → {0, 1}n with the promise that there exists a secret string
s ∈ {0, 1}n such that:
• f (x) = f (y) if and only if y = x ⊕ s.
• f is 2-to-1 and periodic under XOR with s.
Goal: Determine the hidden string s using the least number of queries to f .

Figure 4: The Simon’s Algorithm

4.2 Quantum Circuit Description


• Apply H ⊗n to the first register.
• Apply the oracle Uf .
• Measure the second register.

Department of Mathematics 9 RV College of Engineering


4.3 The Algorithm 4 SIMON’S PERIODICITY ALGORITHM

• Apply H ⊗n to the first register.


• Measure the first register and obtain y.
Repeat the circuit until sufficient equations are obtained.

4.3 The Algorithm


Step 1: Initialization Use two registers of n qubits each:

|0⟩⊗n |0⟩⊗n .

Apply Hadamard transform to the first register:


1
|ψ1 ⟩ = √ n
X
|x⟩ |0⟩ .
2 x∈{0,1}n

Step 2: Oracle Query Apply the oracle Uf :

|x⟩ |0⟩ 7→ |x⟩ |f (x)⟩ .

After the oracle:


1
|ψ2 ⟩ = √ n |x⟩ |f (x)⟩ .
X
2 x∈{0,1}n

Step 3: Measure Second Register


Measure the second register to obtain f (x0 ), collapsing the state to:
1
|ψ3 ⟩ = √ (|x0 ⟩ + |x0 ⊕ s⟩).
2

Step 4: Apply Hadamard Transform Again Apply Hadamard to the first register:
1 h i
|ψ4 ⟩ = √ (−1)x0 ·y + (−1)(x0 ⊕s)·y |y⟩ .
X
2n+1 y∈{0,1}n

1 X
=√ (−1)x0 ·y [1 + (−1)s·y ] |y⟩ .
2n+1 y
Only those y for which s · y = 0 (mod 2) will have non-zero amplitude.
Step 5: Measure and Collect Equations Measure to get a bit string y such that:

s·y =0 (mod 2).

Repeat this process to obtain n − 1 linearly independent such equations.


Step 6: Classical Post-Processing Solve the system of linear equations over Z2 using
Gaussian elimination to determine the secret string s.

Department of Mathematics 10 RV College of Engineering


4.4 Complexity Analysis 5 QUANTUM FOURIER TRANSFORM

4.4 Complexity Analysis


• Quantum query complexity: O(n).
• Classical query complexity: Ω(2n/2 ).

4.5 Significance and Impact


• One of the earliest algorithms to demonstrate exponential speedup.
• Laid the groundwork for Shor’s algorithm and quantum period finding.
• Introduced key techniques used in many other quantum algorithms.

4.6 Conclusion
Simon’s algorithm solves the problem of finding a hidden XOR mask in a 2-to-1 function
using quantum superposition, interference, and measurement. It highlights the contrast
between classical and quantum capabilities and remains a foundational example in quantum
algorithm studies.

5 QUANTUM FOURIER TRANSFORM


The Quantum Fourier Transform (QFT) is the quantum analogue of the classical Discrete
Fourier Transform (DFT). It is a key component in several important quantum algorithms,
including Shor’s factoring algorithm and Quantum Phase Estimation.

Goal: Transform a quantum state |x⟩ into a superposition state where the amplitudes encode
frequency (or phase) information.

5.1 Classical Fourier Transform


Given a vector (x0 , x1 , . . . , xN −1 ), its Discrete Fourier Transform is defined by:

1 NX
−1
x̃k = √ xj e2πijk/N , for k = 0, 1, . . . , N − 1.
N j=0

Interpretation: This represents the original data in terms of frequency components.

5.2 Quantum Fourier Transform: Definition


Let N = 2n be the size of the Hilbert space for n qubits. The Quantum Fourier Transform
is the linear transformation defined by:

1 NX−1
QFT |x⟩ = √ e2πixy/N |y⟩
N y=0

Department of Mathematics 11 RV College of Engineering


5.3 Binary Representation and Phase Encoding5 QUANTUM FOURIER TRANSFORM

for x ∈ {0, 1, . . . , N − 1}.

Note: - This is a unitary transformation. - It maps computational basis states |x⟩ into
phase-encoded superpositions.

5.3 Binary Representation and Phase Encoding


Write x and y in binary:
x = x 1 x 2 . . . xn , y = y1 y2 . . . yn
where xj , yj ∈ {0, 1}. Then:
xy
= x · (0.y1 y2 . . . yn )
2n
and so:
n
e2πixy/2 = e2πix·(0.y1 y2 ...yn )

This means the QFT maps each |x⟩ to a superposition whose amplitudes carry phases that
depend on x.

5.4 QFT Circuit Structure


The QFT can be implemented with the following steps for n qubits:
1. For each qubit j = 1 to n:
• Apply a Hadamard gate H to qubit j.
• For each k > j, apply a controlled phase rotation:

1 0
" #
Rk =
0 e2πi/2
k

• This step introduces a phase based on the values of the later qubits.
2. Finally, reverse the order of the qubits.

5.5 Circuit
5.6 QFT on a General State
Let the input be a general state:
n −1
2X
|ψ⟩ = αx |x⟩
x=0

Then:  
n −1 n −1 n −1
2X 2X
1 2X n
QFT |ψ⟩ = αx · QFT |x⟩ = αx · √ n
 e2πixy/2 |y⟩
x=0 x=0 2 y=0

Department of Mathematics 12 RV College of Engineering


5.7 The QFT on Three Qubits 5 QUANTUM FOURIER TRANSFORM

Figure 5: Quantum Fourier Transform

5.7 The QFT on Three Qubits


The quantum Fourier transform on three qubits, F8 with n = 3, N = 8 = 23 , is represented
by the following transformation:

1 X 7
QFT |x⟩ → √ ω xk |k⟩ ,
8 k=0
8
where ω = ω8 = e( 8 ) is an eighth root of unity satisfying ω 8 = e( 8 )

2πi 2πi
= 1.

The matrix representation of the Fourier transform on three qubits is:

1 1 1 1 1 1 1 1
 

1 ω ω2 ω3 ω4 ω5 ω6 ω7


1 ω2 ω4 ω6 1 ω2 ω4 ω6
 

1  1
 
ω3 ω6 ω ω4 ω7 ω2 ω5
F8 = √  
.
8 1 ω4 1 ω4 1 ω4 1 4
ω 


1

 ω5 ω2 ω7 ω4 ω ω6 ω3

1 ω6 ω4 ω2 1 ω6 ω4 ω2
 

1 ω7 ω6 ω5 ω4 ω3 ω2 ω

The 3-qubit quantum Fourier transform can be rewritten as:


1      
QFT (|x0 , x1 , x2 ⟩) = √ |0⟩ + e2πi[0.x2 ] |1⟩ ⊗ |0⟩ + e2πi[0.x1 x2 ] |1⟩ ⊗ |0⟩ + e2πi[0.x0 x1 x2 ] |1⟩ .
8

The number of gates used is n(n + 1)/2 which is equal to 6 for n = 3.

How to Read the Matrix


Each row represents the result of the QFT acting on a computational basis state |j⟩ — it
gets mapped into a superposition of all 8 basis states |k⟩, with amplitudes given by √18 ω jk .

Department of Mathematics 13 RV College of Engineering


5.8 2-Qubit QFT Example 5 QUANTUM FOURIER TRANSFORM

Figure 6: Quantum Fourier Transform on three qubits

For example:
• Row 0: ω 0·k = 1 for all k, so it’s:

1 1 X 7
√ [1, 1, 1, 1, 1, 1, 1, 1] ⇒ QFT |0⟩ = √ |k⟩
8 8 k=0

• Row 1: ω 1·k = ω k gives powers of ω:

1 1 X 7
√ [1, ω, ω 2 , ω 3 , ω 4 , ω 5 , ω 6 , ω 7 ] ⇒ QFT |1⟩ = √ ω k |k⟩
8 8 k=0

• Row j: Contains ω jk for k = 0 to 7:

1 1 X 7
√ [1, ω j , ω 2j , . . . , ω 7j ] ⇒ QFT |j⟩ = √ ω jk |k⟩
8 8 k=0

5.8 2-Qubit QFT Example


Let’s consider n = 2, so N = 4. The QFT maps basis states |0⟩ , |1⟩ , |2⟩ , |3⟩ as follows:

1
QFT |0⟩ = (|0⟩ + |1⟩ + |2⟩ + |3⟩)
2
1
QFT |1⟩ = (|0⟩ + i |1⟩ − |2⟩ − i |3⟩)
2
1
QFT |2⟩ = (|0⟩ − |1⟩ + |2⟩ − |3⟩)
2
1
QFT |3⟩ = (|0⟩ − i |1⟩ − |2⟩ + i |3⟩)
2

Important: The number of gates grows quadratically (O(n2 )), but can be approximated
efficiently by ignoring very small rotations.

Department of Mathematics 14 RV College of Engineering


5.9 Inverse QFT 6 QUANTUM PHASE ESTIMATION

5.9 Inverse QFT


The inverse QFT is the Hermitian adjoint (conjugate transpose) of the QFT. It is used in
algorithms like Quantum Phase Estimation.
To implement inverse QFT:
• Reverse the order of steps in the QFT.
• Conjugate the phase gates (replace Rk with Rk† ).

8. Applications
• Quantum Phase Estimation: Extracts eigenvalues (phases) using inverse QFT.
• Shor’s Algorithm: Finds the period of modular functions using QFT.
• Quantum signal processing and chemistry: Exploit phase structure of quantum
states.

5.10 Summary
• QFT transforms computational basis states into phase-encoded superpositions.
• The inverse QFT decodes this phase back into binary form.
• QFT is central to many powerful quantum algorithms.

6 QUANTUM PHASE ESTIMATION


Purpose
The Quantum Phase Estimation (QPE) algorithm estimates the phase ϕ in the eigenvalue
e2πiϕ of a unitary operator U , given an eigenvector |u⟩ such that:

U |u⟩ = e2πiϕ |u⟩ .

QPE is a core subroutine in many quantum algorithms, including Shor’s algorithm, Hamil-
tonian simulation, and the HHL algorithm for solving linear systems.

Applications
• Shor’s factoring algorithm.
• Estimating eigenvalues of Hermitian operators.
• Quantum simulation of physical systems.

Department of Mathematics 15 RV College of Engineering


6.1 Problem Statement 6 QUANTUM PHASE ESTIMATION

6.1 Problem Statement


Given:
• A unitary operator U .
• An eigenvector |u⟩ such that U |u⟩ = e2πiϕ |u⟩ for some unknown ϕ ∈ [0, 1).
Goal: Estimate the phase ϕ to m bits of precision.

6.1.1 Circuit

Figure 7: Quantum Phase Estimation

6.2 Algorithm Overview


QPE uses:
• A control register with m qubits (for phase output).
• A target register initialized to the eigenstate |u⟩.
Steps:
1. Apply Hadamard gates to the control register.
2. Apply a sequence of controlled-U 2 gates.
j

3. Apply the inverse Quantum Fourier Transform (QFT−1 ).


4. Measure the control register.

6.3 The Algorithm


Step 1: Initialization
Start with:
|0⟩⊗m ⊗ |u⟩

Department of Mathematics 16 RV College of Engineering


6.3 The Algorithm 6 QUANTUM PHASE ESTIMATION

Apply Hadamard gates to each control qubit:


m −1
1 2X
√ |k⟩ ⊗ |u⟩
2m k=0

Step 2: Controlled Unitary Operations


Goal: Encode the unknown phase ϕ into the amplitudes (specifically, the relative phases)
of the control register qubits without disturbing the eigenstate |u⟩.

After applying the Hadamard gates in Step 1, the quantum state is:
m −1
1 2X
√ |k⟩ ⊗ |u⟩
2m k=0
This is a uniform superposition over all possible m-bit binary values k, tensored with the
eigenvector |u⟩.
Now, we apply a sequence of controlled-unitary operations. Specifically, we apply the unitary
U raised to increasing powers of 2, controlled by each qubit in the control register:
0 1 m−1
Apply controlled-U 2 , controlled-U 2 , . . . , controlled-U 2 .

This means that for each basis state |k⟩, the unitary U k is applied to |u⟩. Because |u⟩ is an
eigenvector of U , we have:
U k |u⟩ = e2πiϕk |u⟩ .

So the new state becomes: m −1


1 2X
√ e2πiϕk |k⟩ ⊗ |u⟩ .
2m k=0

Key Insight: The phase e2πiϕk is now associated with each basis state |k⟩ in the control
register. The information about ϕ is thus encoded into the relative phases of the amplitudes
of the control register. The target register |u⟩ remains unchanged.

This phenomenon is known as phase kickback: the controlled application of U causes the
eigenvalue (a complex phase) to “kick back” into the control qubits.

Step 3: Inverse Quantum Fourier Transform


Goal: Extract the encoded phase ϕ from the control register by applying the inverse Quan-
tum Fourier Transform (QFT−1 ).

Let us now ignore the target register (which remains |u⟩), and focus on the control register,
which is in the state: m −1
1 2X
√ e2πiϕk |k⟩ .
2 k=0
m

Department of Mathematics 17 RV College of Engineering


6.4 Precision and Success Probability 6 QUANTUM PHASE ESTIMATION

This is a Fourier-like state: the phases vary linearly with k. In fact, this is exactly the
quantum Fourier transform of the number ϕ · 2m .
Therefore, applying the inverse quantum Fourier transform (QFT−1 ) to this state gives:

|ϕ̃⟩ ,

where ϕ̃ is the m-bit binary approximation of ϕ.

Case 1: If ϕ is a rational number of the form j


2m
, then the result is exact: we get |j⟩.
Case 2: If ϕ cannot be exactly represented with m bits, we obtain the closest integer
approximation ϕ̃ ∈ {0, 1, . . . , 2m − 1} such that:

ϕ̃ 1
ϕ− ≤ m+1 ,
2 m 2

with high probability (at least ≈ 0.405, and higher with amplitude amplification).

Why This Works: The inverse QFT decodes the phase information encoded in the su-
perposition. It maps the complex exponential phases e2πiϕk into a binary representation of
ϕ.

Result: After applying QFT−1 , the control register collapses (upon measurement) to a
bitstring approximating ϕ, accurate to m bits.

Step 4: Measurement
Measure the control register to obtain a binary approximation of ϕ.

6.4 Precision and Success Probability


To estimate ϕ to m bits of precision:
• Use m qubits in the control register.
• The inverse QFT requires O(m2 ) gates.
If ϕ can be exactly expressed with m bits, then the result is deterministic. For other ϕ, the
estimate is close with high probability (at least ≈ 0.405), and can be amplified.

6.5 Applications
• Shor’s algorithm: Used for period finding in modular arithmetic.
• Quantum simulations: Estimating eigenvalues of Hamiltonians.
• Linear systems (HHL): QPE encodes eigenvalues into amplitudes.
• Quantum metrology and phase estimation.

Department of Mathematics 18 RV College of Engineering


6.6 Conclusion 6 QUANTUM PHASE ESTIMATION

6.6 Conclusion
Quantum Phase Estimation (QPE) is a fundamental algorithm that demonstrates the true
power of quantum computation. Its ability to extract eigenvalues efficiently is critical for
solving various important problems, making it a cornerstone of quantum algorithm design.

Department of Mathematics 19 RV College of Engineering

You might also like