Quantum computing Lecture Assignment's detailed solution, Schemes and Mind Maps of Quantum Computing

Quantum computing Lecture Assignment's detailed solution

Typology: Schemes and Mind Maps

2025/2026

Uploaded on 11/08/2025

jiahao-liu-2
jiahao-liu-2 🇳🇱

1 document

1 / 30

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1 Exercise 1: From Cliford Gates to Magic States
1.1 (a) The Clifford Group and Its Action on Pauli Operators
The single-qubit Clifford group is generated by the Hadamard gate Hand the phase gate S, defined as:
H=1
21 1
11, S =1 0
0i.
For any unitary operator Uand Pauli operator M {X, Y , Z}, define the conjugation action:
M7→ UMU.
Show that conjugation by Hand Scorresponds, up to signs, to a permutation of the set {X, Y, Z }. What
are these permutations?
Conclude from this that—up to global phase—the single-qubit Clifford group has at most 24 distinct
elements, corresponding to the rotations that permute the x,y, and zaxes on the Bloch sphere (i.e.,
the rotational symmetries of a cube or octahedron).
1.1.1 Conjugation by Hand Sas Permutations of {X, Y , Z}(up to signs)
To show that conjugation by Hand Scorresponds to permutations of {X, Y , Z}up to signs, we explicitly
compute their conjugation actions on each Pauli operator X, Y, Z . Recall the Pauli matrices:
X=0 1
1 0, Y =0i
i0, Z =1 0
01.
Conjugation by H:The Hadamard gate is Hermitian (H=H) and unitary, so conjugation simplifies to:
HM H=H MH
- For M=X:
HX H =1
21 1
110 1
1 01
21 1
11=Z.
- For M=Y:
HY H =1
21 1
110i
i01
21 1
11=Y.
- For M=Z:
HZ H =1
21 1
111 0
011
21 1
11=X.
Up to signs, Hswaps XZand leaves Yunchanged. This corresponds to the permutation (X Z) (cycle
notation for swapping Xand Z).
Conjugation by S:The phase gate Shas conjugate transpose S=1 0
0i.
- For M=X:
SX S=1 0
0i0 1
1 01 0
0i=Y.
- For M=Y:
SY S=1 0
0i0i
i01 0
0i=X.
- For M=Z:
SZ S=1 0
0i1 0
011 0
0i=Z.
Up to signs, Smaps XYand YXwhile leaving Zunchanged. This corresponds to the permutation
(X Y ) (cycle notation for swapping Xand Y).
Hence,Conjugation Hand Spermutes the Pauli operators {X, Y, Z }
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e

Partial preview of the text

Download Quantum computing Lecture Assignment's detailed solution and more Schemes and Mind Maps Quantum Computing in PDF only on Docsity!

1 Exercise 1: From Cliford Gates to Magic States

1.1 (a) The Clifford Group and Its Action on Pauli Operators

The single-qubit Clifford group is generated by the Hadamard gate H and the phase gate S, defined as:

H =

, S =

0 i

For any unitary operator U and Pauli operator M ∈ {X, Y, Z}, define the conjugation action:

M 7 → U M U †. Show that conjugation by H and S corresponds, up to signs, to a permutation of the set {X, Y, Z}. What are these permutations? Conclude from this that—up to global phase—the single-qubit Clifford group has at most 24 distinct elements, corresponding to the rotations that permute the x, y, and z axes on the Bloch sphere (i.e., the rotational symmetries of a cube or octahedron).

1.1.1 Conjugation by H and S as Permutations of {X, Y, Z} (up to signs)

To show that conjugation by H and S corresponds to permutations of {X, Y, Z} up to signs, we explicitly compute their conjugation actions on each Pauli operator X, Y, Z. Recall the Pauli matrices:

X =

, Y =

0 −i i 0

, Z =

Conjugation by H: The Hadamard gate is Hermitian (H†^ = H) and unitary, so conjugation simplifies to:

HM H†^ = HM H

  • For M = X: HXH =

= Z.

  • For M = Y : HY H =

0 −i i 0

= −Y.

  • For M = Z: HZH =

= X.

Up to signs, H swaps X ↔ Z and leaves Y unchanged. This corresponds to the permutation (X Z) (cycle notation for swapping X and Z).

Conjugation by S: The phase gate S has conjugate transpose S†^ =

0 −i

  • For M = X: SXS†^ =

0 i

0 −i

= Y.

  • For M = Y : SY S†^ =

0 i

0 −i i 0

0 −i

= −X.

  • For M = Z: SZS†^ =

0 i

0 −i

= Z.

Up to signs, S maps X → Y and Y → X while leaving Z unchanged. This corresponds to the permutation (X Y ) (cycle notation for swapping X and Y ). Hence,Conjugation H and S permutes the Pauli operators {X, Y, Z}

1.1.2 Size of the Single-Qubit Clifford Group: At Most 24 Elements (up to Global Phase)

The single-qubit Clifford group is generated by H and S, and its elements act on Pauli operators via conjugation, preserving the set {±X, ±Y, ±Z}.

1: Axis Permutations (6 Options, from Symmetric Group S 3 ) Any Clifford element U acts on {X, Y, Z} by first permuting the axes (via some permutation of {X, Y, Z}) and then assigning a sign (±1) to each permuted axis. This follows from the defining property: U M U †^ = ϵM ′ where M ′^ is a permutation of M and ϵ = ±1.

Table 1: All Permutations of {X, Y, Z} (from S 3 )

Permutation Type Cycle Notation Axis Transformation Example Clifford Gate Identity (no swap) e (X, Y, Z) → (X, Y, Z) Unit gate I Transposition (swap 2 axes) (X Y ) (X, Y, Z) → (Y, X, Z) S†HS Transposition (X Z) (X, Y, Z) → (Z, Y, X) Hadamard H Transposition (Y Z) (X, Y, Z) → (X, Z, Y ) HSH 3-cycle (cycle all 3 axes) (X Y Z) (X, Y, Z) → (Y, Z, X) SH 3-cycle (reverse) (X Z Y ) (X, Y, Z) → (Z, X, Y ) HS†

The set {X, Y, Z} has 3! = 6 distinct permutations, described by the symmetric group S 3. These include: identity (no permutation), transpositions (swapping two axes: (X Y ), (X Z), (Y Z)), and 3-cycles (cycling all three axes: (X Y Z), (X Z Y )).

2: Sign Choices (4 Valid Options, Constrained by Pauli Anticommutation) For each permutation, we can assign a sign (+1 or −1) to each axis—but Pauli anticommutation relations (e.g., XY = iZ) eliminate invalid combinations. Specifically: - If U XU †^ = ϵX X′, U Y U †^ = ϵY Y ′, then U ZU †^ = ϵX ϵY Z′^ (The third sign is fixed by the first two). This leaves only 2^2 = 4 valid sign combinations, shown in Table 2 (for the identity permutation; logic extends to all permutations).

Table 2: Valid Sign Combinations (for Identity Permutation)

Signs (ϵX , ϵY , ϵZ ) Satisfies ϵZ = ϵX ϵY? Valid? (+1, +1, +1) +1 = (+1)(+1) Yes (+1, − 1 , −1) −1 = (+1)(−1) Yes (− 1 , +1, −1) −1 = (−1)(+1) Yes (− 1 , − 1 , +1) +1 = (−1)(−1) Yes (+1, +1, −1) − 1 ̸= (+1)(+1) No (+1, − 1 , +1) +1 ̸= (+1)(−1) No

3: Total number of distinct actions (6 × 4 = 24) As Permutations and signs are independent choices,

Total valid conjugation actions = Number of permutations × Number of sign combinations = 6 × 4 = 24.

Since each action corresponds to exactly one Clifford element (up to global phase), the single-qubit Clifford group has at most 24 distinct elements.

1.2 (b) A State Beyond the Clifford Orbit

Define the magic state:

|T ⟩ =

| 0 ⟩ + eiπ/^4 | 1 ⟩ √ 2

Problem: Explain why no circuit made only of H and S gates can transform | 0 ⟩ into |T ⟩. Hint: Think about the Bloch-sphere locations of | 0 ⟩ and |T ⟩, and recall that Clifford operations only map the axes ±X, ±Y, ±Z onto each other. Solution:

  1. Clifford Gates and the Bloch Sphere The H and S gates are examples of Clifford gates. One important property of Clifford gates is that they map the Bloch sphere’s coordinate axes ±X, ±Y, ±Z onto each other. Specifically:
    • The Hadamard gate H swaps X ↔ Z.
    • The phase gate S maps X → Y , Y → −X, and Z → Z.

Thus, any sequence of Clifford gates acting on | 0 ⟩ (which points along +Z) can only produce states along the six axes ±X, ±Y, ±Z on the Bloch sphere.

  1. Bloch Sphere Coordinates of |T ⟩ A general single-qubit state can be written as

|ψ⟩ = cos(θ/2)| 0 ⟩ + eiϕ^ sin(θ/2)| 1 ⟩,

where (θ, ϕ) are the Bloch sphere angles. Comparing with

|T ⟩ =

| 0 ⟩ + eiπ/^4 | 1 ⟩ √ 2

θ =

π 2

, ϕ =

π 4

The corresponding Bloch vector is

(x, y, z) = (sin θ cos ϕ, sin θ sin ϕ, cos θ) =

Figure 2 clearly shows that |T ⟩ does not lie along any of the six Clifford axes.

Figure 2: | 0 ⟩,|T ⟩ and ±X, ±Y, ±Z

  1. Conclusion Since Clifford operations can only map the Bloch sphere axes ±X, ±Y, ±Z onto each other, and |T ⟩ lies off these axes, no combination of H and S gates can transform | 0 ⟩ into |T ⟩. This property is why |T ⟩ is called a magic state: it lies beyond the Clifford orbit.

1.3 (c) T-state injection: realizing a T gate using a magic ancilla

Suppose we have an arbitrary data qubit |ψ⟩ = α| 0 ⟩ + β| 1 ⟩,

and an ancilla prepared in the magic state

|T ⟩ =

| 0 ⟩ + eiπ/^4 | 1 ⟩ √ 2

The following procedure uses only Clifford operations and a measurement to implement the non-Clifford T gate on the data qubit.

Figure 3: Enter Caption

The measurement outcome m ∈ { 0 , 1 } controls whether the correction S is applied. Show that, after this correction, the data qubit equals T |ϕ⟩ up to a global phase. Discuss why this procedure effectively injects the non-Clifford resource into the circuit. Initial composite state:

|ψ⟩ ⊗ |T ⟩ =

h α| 0 ⟩| 0 ⟩ + αeiπ/^4 | 0 ⟩| 1 ⟩ + β| 1 ⟩| 0 ⟩ + βeiπ/^4 | 1 ⟩| 1 ⟩

i .

CNOT Gate Application Applying CNOT to the initial state:

CNOT(|ψ⟩ ⊗ |T ⟩) =

h α| 0 ⟩| 0 ⟩ + αeiπ/^4 | 0 ⟩| 1 ⟩ + β| 1 ⟩| 1 ⟩ + βeiπ/^4 | 1 ⟩| 0 ⟩

i

h α| 0 ⟩| 0 ⟩ + βeiπ/^4 | 1 ⟩| 0 ⟩ + αeiπ/^4 | 0 ⟩| 1 ⟩ + β| 1 ⟩| 1 ⟩

i .

Measurement and Correction Measure the ancilla qubit in the computational basis. The measurement outcome m ∈ { 0 , 1 } determines the correction: Case 1: m = 0 The state collapses to:

α| 0 ⟩| 0 ⟩ + βeiπ/^4 | 1 ⟩| 0 ⟩ =

α| 0 ⟩ + βeiπ/^4 | 1 ⟩

The data qubit state is: α| 0 ⟩ + βeiπ/^4 | 1 ⟩. Case 2: m = 1 The state collapses to:

αeiπ/^4 | 0 ⟩| 1 ⟩ + β| 1 ⟩| 1 ⟩ =

αeiπ/^4 | 0 ⟩ + β| 1 ⟩

The data qubit state is:

αeiπ/^4 | 0 ⟩ + β| 1 ⟩.

Apply the correction gate S =

0 i

S

αeiπ/^4 | 0 ⟩ + β| 1 ⟩

= αeiπ/^4 S| 0 ⟩ + βS| 1 ⟩

= αeiπ/^4 | 0 ⟩ + iβ| 1 ⟩.

2 Exercise 2: Three-Qubit Bit-Flip Code (30%)

We now examine how quantum error correction can protect information against single-qubit errors using the three-qubit bit-flip code.

2.1 (a) Encoding and error syndromes

The code encodes one logical qubit as

| (^0) L⟩ = | 000 ⟩ , | (^1) L⟩ = | 111 ⟩ , |ψL⟩ = α | (^0) L⟩ + β | (^1) L⟩.

If an X error occurs on one of the 3 qubits, the state is flipped. The stabilizer generators

S 1 = Z 1 Z 2 , S 2 = Z 2 Z 3

are measured to detect which qubit flipped. Compute the pattern for each error and show that the pair of results (S 1 , S 2 ) ∈ {(+, +), (+, −), (−, +), (−, −)} uniquely identifies the error location. These operators compare pairs of qubits without collapsing the quantum superposition, as they only reveal information about the relationships between qubits, not their individual states. The measurement outcomes (eigenvalues +1 or −1, denoted as + or −) form the error syndrome that uniquely identifies the error location.

Z =

, Z | 0 ⟩ = +1 | 0 ⟩ , Z | 1 ⟩ = − 1 | 1 ⟩

Case 1: No Error

State: |ψL⟩ = α | 000 ⟩ + β | 111 ⟩ S 1 = Z 1 Z 2 : Z 1 Z 2 | 000 ⟩ = (Z | 0 ⟩)(Z | 0 ⟩) | 0 ⟩ = (+1)(+1) | 000 ⟩ = +1 | 000 ⟩ Z 1 Z 2 | 111 ⟩ = (Z | 1 ⟩)(Z | 1 ⟩) | 1 ⟩ = (−1)(−1) | 111 ⟩ = +1 | 111 ⟩ ⇒ S 1 = + S 2 = Z 2 Z 3 : Z 2 Z 3 | 000 ⟩ = | 0 ⟩ (Z | 0 ⟩)(Z | 0 ⟩) = | 0 ⟩ (+1)(+1) | 00 ⟩ = +1 | 000 ⟩ Z 2 Z 3 | 111 ⟩ = | 1 ⟩ (Z | 1 ⟩)(Z | 1 ⟩) = | 1 ⟩ (−1)(−1) | 11 ⟩ = +1 | 111 ⟩ ⇒ S 2 = + Syndrome: (S 1 , S 2 ) = (+, +)

Case 2: X Error on Qubit 1

State: X 1 |ψL⟩ = α | 100 ⟩ + β | 011 ⟩ S 1 = Z 1 Z 2 : Z 1 Z 2 | 100 ⟩ = (Z | 1 ⟩)(Z | 0 ⟩) | 0 ⟩ = (−1)(+1) | 100 ⟩ = − 1 | 100 ⟩ Z 1 Z 2 | 011 ⟩ = (Z | 0 ⟩)(Z | 1 ⟩) | 1 ⟩ = (+1)(−1) | 011 ⟩ = − 1 | 011 ⟩ ⇒ S 1 = − S 2 = Z 2 Z 3 : Z 2 Z 3 | 100 ⟩ = | 1 ⟩ (Z | 0 ⟩)(Z | 0 ⟩) = | 1 ⟩ (+1)(+1) | 00 ⟩ = +1 | 100 ⟩ Z 2 Z 3 | 011 ⟩ = | 0 ⟩ (Z | 1 ⟩)(Z | 1 ⟩) = | 0 ⟩ (−1)(−1) | 11 ⟩ = +1 | 011 ⟩ ⇒ S 2 = + Syndrome: (S 1 , S 2 ) = (−, +)

Case 3: X Error on Qubit 2

State: X 2 |ψL⟩ = α | 010 ⟩ + β | 101 ⟩ S 1 = Z 1 Z 2 : Z 1 Z 2 | 010 ⟩ = (Z | 0 ⟩)(Z | 1 ⟩) | 0 ⟩ = (+1)(−1) | 010 ⟩ = − 1 | 010 ⟩ Z 1 Z 2 | 101 ⟩ = (Z | 1 ⟩)(Z | 0 ⟩) | 1 ⟩ = (−1)(+1) | 101 ⟩ = − 1 | 101 ⟩ ⇒ S 1 = − S 2 = Z 2 Z 3 : Z 2 Z 3 | 010 ⟩ = | 0 ⟩ (Z | 1 ⟩)(Z | 0 ⟩) = | 0 ⟩ (−1)(+1) | 0 ⟩ = − 1 | 010 ⟩ Z 2 Z 3 | 101 ⟩ = | 1 ⟩ (Z | 0 ⟩)(Z | 1 ⟩) = | 1 ⟩ (+1)(−1) | 1 ⟩ = − 1 | 101 ⟩ ⇒ S 2 = − Syndrome: (S 1 , S 2 ) = (−, −)

Case 4: X Error on Qubit 3

State: X 3 |ψL⟩ = α | 001 ⟩ + β | 110 ⟩ S 1 = Z 1 Z 2 : Z 1 Z 2 | 001 ⟩ = (Z | 0 ⟩)(Z | 0 ⟩) | 1 ⟩ = (+1)(+1) | 001 ⟩ = +1 | 001 ⟩ Z 1 Z 2 | 110 ⟩ = (Z | 1 ⟩)(Z | 1 ⟩) | 0 ⟩ = (−1)(−1) | 110 ⟩ = +1 | 110 ⟩ ⇒ S 1 = + S 2 = Z 2 Z 3 : Z 2 Z 3 | 001 ⟩ = | 0 ⟩ (Z | 0 ⟩)(Z | 1 ⟩) = | 0 ⟩ (+1)(−1) | 1 ⟩ = − 1 | 001 ⟩ Z 2 Z 3 | 110 ⟩ = | 1 ⟩ (Z | 1 ⟩)(Z | 0 ⟩) = | 1 ⟩ (−1)(+1) | 0 ⟩ = − 1 | 110 ⟩ ⇒ S 2 = − Syndrome: (S 1 , S 2 ) = (+, −)

Syndrome Table and Error Correction

The calculated syndrome patterns uniquely identify the error location as shown in the following table:

Case Error Location Syndrome (S 1 , S 2 ) 1 No error (+, +) 2 Qubit 1 (−, +) 3 Qubit 2 (−, −) 4 Qubit 3 (+, −)

Each possible single-qubit X error produces a distinct syndrome pattern, allowing for unambiguous iden- tification and correction of the error. The quantum error correction process preserves the encoded quantum information (α and β) by only extracting information about error locations through syndrome measurements, without collapsing the quantum superposition.

2.2 (b) Recovery procedure

Using the results from part (a), explain how the measurement outcomes of (S 1 , S 2 ) identify which qubit has flipped, and specify the corresponding corrective operation needed to restore the encoded state |ψL⟩.

Corrective Operations

For each syndrome pattern, we apply the corresponding X gate to restore the encoded state |ψL⟩:

Syndrome (S 1 , S 2 ) Error Identification Corrective Operation (+, +) No error No operation required (−, +) X error on qubit 1 Apply X to qubit 1 (X 1 ) (−, −) X error on qubit 2 Apply X to qubit 2 (X 2 ) (+, −) X error on qubit 3 Apply X to qubit 3 (X 3 )

Mathematical Verification of Recovery

The recovery procedure successfully restores the encoded state because applying an X gate twice to any qubit returns it to its original state (X^2 = I). For example:

  • If an X error occurred on qubit 1, the state becomes X 1 |ψL⟩
  • Applying the corrective X gate to qubit 1 gives: X 1 (X 1 |ψL⟩) = (X 12 ) |ψL⟩ = I |ψL⟩ = |ψL⟩

Similarly for errors on qubits 2 and 3. In practice, the recovery procedure is implemented using a quantum circuit that:

  1. Measures the stabilizers using ancillary qubits without collapsing the data qubits’ superposition
  2. Classically processes the syndrome to determine the required correction
  3. Applies the corrective X gate to the appropriate qubit This entire process preserves the quantum information encoded in the coefficients α and β while correcting the bit-flip error. The three-qubit bit-flip code thus provides complete protection against any single X error on any of the three physical qubits.

Action on ZL:

HLZLH L† = (H 1 H 2 H 3 )(Z 1 Z 2 Z 3 )(H 1 † H 2 † H† 3 ) = (H 1 Z 1 H† 1 )(H 2 Z 2 H† 2 )(H 3 Z 3 H† 3 ) = X 1 X 2 X 3 = XL.

Therefore, the transversal Hadamard operator HL = H 1 H 2 H 3 serves as a valid logical Hadamard gate that interchanges XL and ZL as required.

Action on logical states

We can also verify the action of HL on the logical basis states:

HL | 0 L⟩ = H 1 H 2 H 3 | 000 ⟩ = (H | 0 ⟩)⊗^3 =

HL | 1 L⟩ = H 1 H 2 H 3 | 111 ⟩ = (H | 1 ⟩)⊗^3 =

These transformed states represent the logical |+L⟩ and |−L⟩ states respectively, confirming that HL performs the logical Hadamard transformation.

3 Exercise 3: Reflections and Amplitude Amplification (40%)

This exercise introduces the idea of reflections in Hilbert space and shows how repeated reflections can amplify the probability of a desired measurement outcome—the principle behind Grover’s search algorithm.

3.1 (a) Algebraic properties of Of and D

Consider a Boolean function f : { 0 , 1 }n^ → { 0 , 1 } that we use to mark a subset M ⊆ { 0 , 1 }n^ of “good” basis states (i.e., f (x) = 1). Define the operators

Of = I − 2

X

x: f (x)=

|x⟩⟨x|, D = 2 |Ψ⟩⟨Ψ| − I.

Show that both Of and D are unitary and self-inverse, i.e.

O^2 f = D^2 = I.

Proof for Of :

Let M = {x ∈ { 0 , 1 }n^ : f (x) = 1}. Define the projector:

P =

X

x∈M

|x⟩⟨x|.

Proof that P 2 = P : Let P =

P

x∈M |x⟩⟨x|, where^ {|x⟩}^ forms an orthonormal basis for the Hilbert space^ C

2 n. This means:

⟨x|y⟩ = δxy =

1 if x = y 0 if x ̸= y

P 2 =

X

x∈M

|x⟩⟨x|

X

y∈M

|y⟩⟨y|

X

x∈M

X

y∈M

|x⟩⟨x|y⟩⟨y| (by linearity)

X

x∈M

X

y∈M

|x⟩δxy ⟨y| (by orthonormality)

X

x∈M

|x⟩⟨x| (since only terms with x = y survive)

= P

Therefore, P 2 = P Proof that P †^ = P : For any operator A, its adjoint A†^ satisfies ⟨ϕ|Aψ⟩ = ⟨A†ϕ|ψ⟩ for all vectors |ϕ⟩, |ψ⟩. For P =

P

x∈M |x⟩⟨x|, we compute its adjoint:

P †^ =

X

x∈M

|x⟩⟨x|

X

x∈M

(|x⟩⟨x|)†^ (by linearity of adjoint)

X

x∈M

|x⟩⟨x| (since (|x⟩⟨x|)†^ = |x⟩⟨x|)

= P

The step (|x⟩⟨x|)†^ = |x⟩⟨x| follows because for any vectors |ϕ⟩, |ψ⟩:

⟨ϕ|(|x⟩⟨x|)ψ⟩ = ⟨ϕ|x⟩⟨x|ψ⟩ = ⟨x|ϕ⟩∗⟨x|ψ⟩ and

3.2 (b) Geometric interpretation in the marked/unmarked subspace

Assume from now on and for the rest of this exercise that we start in the specific initial state:

|Ψ⟩ =

2 n

X

x∈{ 0 , 1 }N

|x⟩

Decompose the |Ψ⟩ into components on the marked and unmarked subspaces,

|Ψ⟩ =

p |Ψgood⟩ +

p 1 − p |Ψbad⟩. Find the dependence of p on the number of marked states M = |M| and the total number of basis states N. Show that both operators D and Of act within the two-dimensional subspace spanned by { |Ψgood⟩, |Ψbad⟩ }. Interpret their action geometrically in this plane and explain why their composition

G = D Of acts as a rotation in that plane.

3.2.1 State Decomposition and Probability Parameter

Initial State Definition: As N = 2n:

|Ψ⟩ =

2 n

X

x∈{ 0 , 1 }N

|x⟩ =

N

X

x∈{ 0 , 1 }N

|x⟩

Probability Amplitudes in Quantum Mechanics

⟨x|Ψ⟩ = ⟨x|

 √^1

N

X

y∈{ 0 , 1 }N

|y⟩

 = √^1

N

X

y∈{ 0 , 1 }N

⟨x|y⟩

⟨x|Ψ⟩ =

N

X

y∈{ 0 , 1 }N

δxy =

N

Probability calculation:

P (x) = |⟨x|Ψ⟩|^2 =

N

2

N

Probability Calculation for Marked States Let M be the set of marked states with M = |M| elements. The total probability of measuring any marked state is the sum of probabilities for individual marked states:

p =

X

x∈M

P (x) =

X

x∈M

|⟨x|Ψ⟩|^2 =

X

x∈M

N

N

X

x∈M

Since the summation contains M identical terms:

p =

N

X

x∈M

N

· M =

M

N

1 − p =

N − M

N

Physical Interpretation The result MN has an intuitive physical interpretation: In classical probability theory, if there are N equally probable states and M of them are ”good” (marked), then the probability of randomly selecting a good state is naturally MN

Relationship to State Decomposition In the state decomposition:

|Ψ⟩ =

p|Ψgood⟩ +

p 1 − p|Ψbad⟩

The parameter p ensures the normalization of the state:

p|Ψgood⟩ +

p 1 − p|Ψbad⟩∥^2 = p + (1 − p) = 1

This satisfies the fundamental normalization condition that all quantum states must obey.

Conclusion

p =

M

N

This result establishes the fundamental relationship between the number of marked states and the total number of states. Thus, the complete decomposition is:

r M N

|Ψgood⟩ +

r N − M N

|Ψbad⟩

3.2.2 Operator Actions in the Two-Dimensional Subspace

The oracle acts as Of |x⟩ = (−1)f^ (x)|x⟩, where f (x) = 1 for marked states and 0 otherwise. Of acts on basis states:

Of |Ψgood⟩ =

M

X

x∈M

Of |x⟩ =

M

X

x∈M

(−|x⟩) = −|Ψgood⟩

Of |Ψbad⟩ =

N − M

X

x /∈M

Of |x⟩ =

N − M

X

x /∈M

|x⟩ = |Ψbad⟩

In matrix form: Of =

Diffusion Operator D: The diffusion operator is D = 2|Ψ⟩⟨Ψ| − I. Define an angle α such that:

cos α =

r M N

, sin α =

r N − M N Then |Ψ⟩ = cos α|Ψgood⟩ + sin α|Ψbad⟩. We compute the action of D on our basis states: For |Ψgood⟩: D|Ψgood⟩ = (2|Ψ⟩⟨Ψ| − I)|Ψgood⟩ = 2|Ψ⟩⟨Ψ|Ψgood⟩ − |Ψgood⟩ = 2|Ψ⟩ cos α − |Ψgood⟩ = 2 cos α(cos α|Ψgood⟩ + sin α|Ψbad⟩) − |Ψgood⟩ = (2 cos^2 α − 1)|Ψgood⟩ + 2 cos α sin α|Ψbad⟩ D|Ψgood⟩ = cos 2α|Ψgood⟩ + sin 2α|Ψbad⟩ For |Ψbad⟩: D|Ψbad⟩ = (2|Ψ⟩⟨Ψ| − I)|Ψbad⟩ = 2|Ψ⟩⟨Ψ|Ψbad⟩ − |Ψbad⟩ = 2|Ψ⟩ sin α − |Ψbad⟩ = 2 sin α(cos α|Ψgood⟩ + sin α|Ψbad⟩) − |Ψbad⟩ = 2 sin α cos α|Ψgood⟩ + (2 sin^2 α − 1)|Ψbad⟩ D|Ψbad⟩ = sin 2α|Ψgood⟩ − cos 2α|Ψbad⟩ In matrix form: D =

cos 2α sin 2α sin 2α − cos 2α

3.3 (c) Single marked state and rotation angle

Assume now that there is exactly one marked basis state (M = 1). Within the subspace from (b) spanned by { |Ψgood⟩, |Ψbad⟩ }, show that G = D Of acts in that subspace by an angle 2θ satisfying

sin^2 θ = p. Illustrate geometrically how repeated applications of G rotate the state vector toward the “good” direction.

Initial State Decomposition and Probability p In part (b), the initial state |Ψ 0 ⟩ (typically the uniform superposition |Ψ⟩ = √^1 N

P

x |x⟩) decomposes as:

|Ψ 0 ⟩ =

p |Ψgood⟩ +

p 1 − p |Ψbad⟩,

where p is the initial probability of measuring a marked state. For M = 1, this probability is the squared overlap of |Ψ 0 ⟩ with |Ψgood⟩: p = |⟨Ψgood|Ψ 0 ⟩|^2.

Substituting |Ψgood⟩ = |m⟩ and |Ψ 0 ⟩ = √^1 N

P

x |x⟩, we calculate:

⟨Ψgood|Ψ 0 ⟩ =

m

N

X

x

|x⟩

N

⟨m|m⟩ =

N

where we used orthonormality of basis states (⟨m|x⟩ = δm,x). Thus:

p =

N

N

consistent with the general definition from part (b) (p = MN ) with M = 1.

  1. Relating p to Angle θ In part (b), an angle α was defined to parameterize the initial state |Ψ 0 ⟩ relative to the subspace basis:

cos α =

r M N

, sin α =

r N − M N

For M = 1, substitute MN = p :

cos α =

p, sin α =

p 1 − p. Now, Defining a new angle θ such that θ = 90·^ − α (i.e., α = 90·^ − θ). Using the trigonometric identity for complementary angles (cos(90·^ − θ) = sin θ):

cos α = cos(90·^ − θ) = sin θ. But from cos α =

p, so:

sin θ =

p.

Squaring both sides gives the desired relationship:

sin^2 θ = p.

Action of G = D Of as a Rotation by 2 θ: From part (b), we know: - The oracle Of acts on the subspace by flipping the sign of |Ψgood⟩ and leaving |Ψbad⟩ unchanged. Its matrix representation in {|Ψgood⟩, |Ψbad⟩} is:

Of =

which corresponds to a reflection about the |Ψbad⟩-axis. From part (b), the diffusion operator D = 2|Ψ 0 ⟩⟨Ψ 0 | − I acts as a reflection about the axis aligned with |Ψ 0 ⟩. Its matrix representation in the subspace is:

D =

cos 2α sin 2α sin 2α − cos 2α

G = D Of =

cos 2α sin 2α sin 2α − cos 2α

G =

− cos 2α sin 2α − sin 2α − cos 2α

Using the angle relationship α = 90·^ − θ, we substitute 2α = 180·^ − 2 θ.

cos 2α = cos(180·^ − 2 θ) = − cos 2θ, sin 2α = sin(180·^ − 2 θ) = sin 2θ.

Substituting:

G =

−(− cos 2θ) sin 2θ −(sin 2θ) −(− cos 2θ)

cos 2θ sin 2θ − sin 2θ cos 2θ

As shown in Figure 4,this is the standard matrix representation of a rotation by angle 2θ in 2D space.

Figure 4: Grotate the state vector toward the “good” direction.Adapted from Lecture Note Figure 7.

3.3.1 Repeated Applications of G

As established earlier, G acts as a rotation operator in the |ΨGood⟩-|ΨBad⟩ subspace, with a rotation angle of 2 θ:

G =

cos(2θ) sin(2θ) − sin(2θ) cos(2θ)

where the columns (and rows) correspond to projections onto |ΨBad⟩ and |ΨGood⟩, respectively. For any state vector |ψ⟩ = (cb, cg ) in this subspace (with cb = ⟨ΨBad|ψ⟩ and cg = ⟨ΨGood|ψ⟩), applying G updates the coordinates as:

G ·

cb cg

cb cos(2θ) + cg sin(2θ) −cb sin(2θ) + cg cos(2θ)

This is the standard result of rotating a vector by 2θ in 2D.

Cumulative Rotation Over k Applications The key property of rotations is that their effects are additive: applying a rotation by α followed by a rotation by β is equivalent to a single rotation by α + β. For G, each application contributes a rotation of 2θ, so k applications result in a total rotation of 2kθ. To formalize this, consider the initial state |Ψ⟩, which makes an angle θ with |ΨBad⟩ (its coordinates are (cos θ, sin θ), since cos θ = ⟨ΨBad|Ψ⟩ and sin θ = ⟨ΨGood|Ψ⟩).

  • After 0 applications: The state is unchanged:

cos θ sin θ

with angle θ relative to |ΨBad⟩.

3.4 (d) Amplitude-amplification dynamics

Starting from |Ψ⟩, show that after k iterations of G the success probability is

Pk = sin^2

(2k + 1)θ

Discuss qualitatively how Pk depends on p, and explain why the probability oscillates as the number of iterations increases.

Step 1: Initial State in the 2D Subspace As established earlier, the quantum state evolves within the 2D subspace spanned by the orthonormal basis {|Ψgood⟩ ≡ |g⟩, |Ψbad⟩ ≡ |b⟩} The initial state |Ψ⟩ : |Ψ⟩ = sin θ |g⟩ + cos θ |b⟩,

where θ is a real angle satisfying sin^2 θ = p. Here, p = |⟨g|Ψ⟩|^2 is the initial success probability (the probability of measuring |g⟩ in |Ψ⟩). The normalization condition ⟨Ψ|Ψ⟩ = 1 ensures sin^2 θ + cos^2 θ = 1, consistent with cos θ = ⟨b|Ψ⟩. Step 2: Rotational Action of G Over k Iterations From part (c), the operator G = DOf :

G =

cos(2θ) − sin(2θ) sin(2θ) cos(2θ)

where the columns (and rows) correspond to projections onto |b⟩ and |g⟩, respectively. Applying Gk^ gives: Gk^ =

cos(2kθ) − sin(2kθ) sin(2kθ) cos(2kθ)

|Ψ(k)⟩ = Gk|Ψ(0)⟩ =

cos(2kθ) · cos θ − sin(2kθ) · sin θ sin(2kθ) · cos θ + cos(2kθ) · sin θ

cos [(2k + 1)θ] sin [(2k + 1)θ]

Step 4: Success Probability Pk The success probability after k iterations is the squared magnitude of the projection of |Ψ(k)⟩ onto |g⟩. From the coordinates above, this projection is sin [(2k + 1)θ]. Thus:

Pk = ⟨g|Ψ(k)⟩

2 = sin^2 [(2k + 1)θ] ,

which matches the desired result. Dependence on p Since sin^2 θ = p, we have θ = arcsin

p

. Substituting this into Pk gives:

Pk = sin^2 [(2k + 1) arcsin (

p)]. For small p (when the number of marked states is much smaller than the total number of states): arcsin (

p) ≈

p (using the approximation arcsin(x) ≈ x for x ≪ 1)

Pk ≈ sin^2 [(2k + 1)

p] Thus, the probability depends on the product of the number of iterations k and the square root of p.

For larger p the nonlinearity of arcsin

p

becomes significant, and Pk evolves more rapidly with k. Oscillation of Pk: Pk = sin^2 [(2k + 1)θ] oscillates because the sine function is periodic with period 2π. As k increases:

  • When (2k + 1)θ = π 2 + nπ (for integer n), sin^2 [(2k + 1)θ] = 1, giving maximum success probability.
  • When (2k + 1)θ = nπ, sin^2 [(2k + 1)θ] = 0, giving minimum success probability. This oscillation arises from the rotational nature of G: rotating the state past |g⟩ causes its projection onto |g⟩ to decrease, and further rotation brings it back. Thus, beyond a certain number of iterations, the probability of measuring the good state decreases, requiring careful choice of k to maximize Pk. In summary, the success probability after k iterations is sin^2 [(2k + 1)θ], with oscillations driven by the periodicity of the sine function and a dependence on p mediated by θ = arcsin

p

3.5 (e) Extension: more than one marked state

If two orthogonal states |g 1 ⟩ and |g 2 ⟩ are marked (M = 2), express the relevant two-dimensional subspace and show that the same rotation picture applies with

sin^2 θ =

N

Step 1: Define Key States and Subspaces Let the total number of basis states be N = 2n. With M = 2 marked states, there are N − 2 unmarked states, denoted |b 1 ⟩, |b 2 ⟩,... , |bN − 2 ⟩. All states |g 1 ⟩, |g 2 ⟩, |b 1 ⟩,... , |bN − 2 ⟩ are orthonormal:

⟨gi|gj ⟩ = δij , ⟨bk|bl⟩ = δkl, ⟨gi|bk⟩ = 0

for i, j ∈ { 1 , 2 } and k, l ∈ { 1 ,... , N − 2 }. Step 2: The 2D Relevant Subspace The dynamics of the search are confined to a 2D subspace spanned by two orthonormal states:

  1. Good state: A normalized superposition of the marked states:

|G⟩ =

(|g 1 ⟩ + |g 2 ⟩).

This is normalized because:

⟨G|G⟩ =

(⟨g 1 |g 1 ⟩ + ⟨g 1 |g 2 ⟩ + ⟨g 2 |g 1 ⟩ + ⟨g 2 |g 2 ⟩) =

  1. Bad state: A normalized superposition of all unmarked states:

|B⟩ =

N − 2

NX − 2

k=

|bk⟩.

This is normalized because:

⟨B|B⟩ =

N − 2

NX − 2

k=

⟨bk|bk⟩ = 1

These states are orthogonal: ⟨G|B⟩ = 0, since marked and unmarked states are orthogonal. Thus, {|G⟩, |B⟩} forms an orthonormal basis for the 2D subspace. Step 3: Initial State in the 2D Subspace The initial state is typically the uniform superposition over all basis states:

|Ψ⟩ =

N

|g 1 ⟩ + |g 2 ⟩ +

NX − 2

k=

|bk⟩

Rewrite |Ψ⟩ in terms of |G⟩ and |B⟩ by computing its projections onto these states: Projection onto |G⟩:

⟨G|Ψ⟩ =

(⟨g 1 | + ⟨g 2 |)

N

|g 1 ⟩ + |g 2 ⟩ +

X

|bk⟩

Cross terms with unmarked states vanish, leaving:

⟨G|Ψ⟩ =

2 N

(⟨g 1 |g 1 ⟩ + ⟨g 2 |g 2 ⟩) =

2 N

r 2 N

Projection onto |B⟩:

⟨B|Ψ⟩ =

N − 2

X

⟨bk|

N

|g 1 ⟩ + |g 2 ⟩ +

X

|bk⟩

Cross terms with marked states vanish, leaving:

⟨B|Ψ⟩ =

p N (N − 2)

NX − 2

k=

⟨bk|bk⟩ =

N − 2

p N (N − 2)

r N − 2 N