Detailed Solutions: Week 1 Assignment
1. Valid quantum gates
A matrix is a valid single-qubit gate iff it is unitary (U † U = I). Only options (a), (b), and (d)
are unitary. Option (c) is not a unitary operator.
Correct: (a), (b), (d).
2. Bloch sphere angles
Given |ψ⟩ = cos 2θ |0⟩ + eiϕ sin 2θ |1⟩ and
!
√1
|ψ⟩ = 2 .
1−i
2
We have cos 2θ = √1
2
⇒ θ = π2 .
And 1 − i π
ϕ = arg = tan−1 (−1) = − .
2 4
Correct: (c).
3. Circuit for |00⟩ 7→ √1 |00⟩ − √1 |11⟩
2 2
One implementation:
H⊗I CNOT I⊗Z
|00⟩ −−−→ √1 (|00⟩ + |10⟩) −−−−−1→2
−→ √1 (|00⟩ + |11⟩) −−−→ √1 (|00⟩ − |11⟩).
2 2 2
This matches the circuit indicated by option (a) (Hadamard on control, CNOT, then Z on
target).
Correct: (a).
4. Measuring in the {|+⟩ , |−⟩} basis
Given √
1− 2 i 3 − 2i
|ϕ⟩ = |0⟩ + |1⟩
4 4
√
. Probability of outcome |−⟩ = (|0⟩ − |1⟩)/ 2 is
√
1 1 − 2i 3 − 2i
p− = |⟨−|ϕ⟩| = |a − b|2 ,
2
where a = , b= .
2 4 4
√
−2+i(2− 2)
Compute a − b = 4 , so
√ √ √ √
2 (−2)2 + (2 − 2)2 4 + (6 − 4 2) 10 − 4 2 5−2 2
|a − b| = = = = .
16 16 16 8
√ √
5−2 2 5−2 2
Hence p− = 12 · 8 = 16 .
Correct: (d).
1
5. Adding a relative phase of π/2 between |0⟩ and |1⟩
A relative phase of π/2 is implemented by S = diag(1, i) up to a global phase. Also note that
the gates will multiply in reverse order.
• (a) Y XH: using Pauli identities Y X = −iZ, one finds that it is −iZH, which does not
add a relative phase π2 between |0⟩ and |1⟩.
• (b) SXH: The resultant matrix is
1 1 −1
√ ,
2 i i
α−β π α+β
which makes α |0⟩ + β |1⟩ → √
2
|0⟩ + ei 2 √
2
|1⟩, adding a relative phase of π
2 between
|0⟩ and |1⟩.
• (c) SSSSS = S 5 = S (since S 4 = I), which does add π/2 relative phase.
• (d) XY ZZ: using Pauli identities XY = iZ, one finds that it’s an iZ operation (as
Z 2 = I), which adds a relative phase π (not π2 ) between |0⟩ and |1⟩.
Correct: (b), (c).
6. Choosing ϕ so that outcome |−⟩ has zero probability
Gate P = |0⟩⟨0| + eiϕ |1⟩⟨1| acts on |−⟩ as
P |−⟩ = √1 (|0⟩
2
− eiϕ |1⟩).
We need ⟨−|P |−⟩ = 0, i.e.
1
(1 + eiϕ ) = 0 ⇒ eiϕ = −1 ⇒ ϕ = π .
2
Correct: (b).
7. Realizing O = diag(1, −1, 1, 1)
O flips the phase of |01⟩ only (computational order |00⟩ , |01⟩ , |10⟩ , |11⟩). This is a controlled-Z
on the second qubit conditioned on the first being |0⟩. Implement via a standard control-on-|1⟩
by wrapping the control line with X gates: apply X on the first qubit, then a controlled-Z
(control: first, target: second), then X on the first. This matches option (d) in the provided
circuits.
Correct: (d).
8. Perfectly distinguishable state pairs
Two pure states are perfectly distinguishable iff they are orthogonal.
√ √ √ √
6 13 13 6
(b) |ψ1 ⟩ = √ |0⟩ − √ |1⟩ , |ψ2 ⟩ = − √ |0⟩ − √ |1⟩ ,
19 19 19 19
1 √ √ √ √
⟨ψ1 |ψ2 ⟩ = 6 · (− 13) + (− 13) · (− 6) = 0.
19
Other listed pairs have nonzero inner product.
Correct: (b).
2
9. Physically equivalent states to |ψ⟩ = cos π6 |0⟩ + eiπ sin π6 |1⟩
States differing by an overall global phase are physically equivalent.
• (a) Multiply |ψ⟩ by eiπ/2 : eiπ/2 cos π6 |0⟩ + ei3π/2 sin π6 |1⟩, same physical state.
• (d) Multiply by −1: − cos π6 |0⟩ − eiπ sin π6 |1⟩, same physical state.
Correct: (a), (d).
10. Euler form of H using
Performing the matrix multiplication :
−α+β
α+β
!
iϕ e−i( 2 −ϕ) cos θ −iei( 2 +ϕ) sin θ
e Rz (α)Rx (θ)Rz (β) = α−β α+β (1)
−iei( 2 +ϕ) cos θ ei( 2 +ϕ) sin θ
Matrix form of the Hadamard gate is :
!
√1 √1
H= 2 2 (2)
√1 − √12
2
Comparing Eq(1) and Eq(2) :
1 θ
cos θ/2 = √ =⇒ = π/4 =⇒ θ = π/2 (3)
2 2
α+β α+β
− ϕ = 0 =⇒ =ϕ (4)
2 2
−α + β −α + β α + β
+ ϕ = π/2 =⇒ + = β = π/2 (5)
2 2 2
α+β
+ ϕ = π =⇒ 2ϕ = π =⇒ ϕ = π/2 (6)
2
α+β
∴ = ϕ =⇒ α + β = 2ϕ =⇒ α = 2ϕ − β = π/2 (7)
2
Correct: (b).