3.2.B Problem Set
3.2.B Problem Set
com
The notation f : {0, 1}n → {0, 1}m means the function f takes in a bit string of length
n and returns a bit string of length m.
1
1. Apply Uf to the state |ψ⟩ = 3 |001⟩|0⟩ + |010⟩|0⟩ + |111⟩|0⟩ , where the function
√
f : {0, 1}3 → {0, 1}. Let the first register of qubits be the input to the function and second
register be the output register.
1
2. Apply Uf to the state |ψ⟩ = 3 |001⟩|−⟩ + |010⟩|−⟩ + |111⟩|−⟩ , where the function
√
f : {0, 1}3 → {0, 1}. Let the first register of qubits be the input to the function and second
register be the output register. Recall the phase oracle formula: Uf |x⟩|−⟩ = (−1)f (x) |x⟩|−⟩
Answers
1. Uf |ψ⟩ = Uf √13 |001⟩|0⟩ + |010⟩|0⟩ + |111⟩|0⟩
1
= √
3
Uf |001⟩|0⟩ + Uf |010⟩|0⟩ + Uf |111⟩|0⟩
1
= √
3
|001⟩|f (001)⟩ + |010⟩|f (010)⟩ + |111⟩|f (111)⟩
1
2. Uf |ψ⟩ = Uf √3 |001⟩|−⟩ + |010⟩|−⟩ + |111⟩|−⟩
1
= √
3
Uf |001⟩|−⟩ + Uf |010⟩|−⟩ + Uf |111⟩|−⟩
1 f (001) f (010) f (111)
= √
3
(−1) |001⟩|−⟩ + (−1) |010⟩|−⟩ + (−1) |111⟩|−⟩