Tutorial5 Solution
Tutorial5 Solution
|0i H H
|ψin i U |ψout i
This tutorial requires the concept of an orthogonal projection (see also the linear algebra cheatsheet): a square matrix P ∈ Cn×n is called
an orthogonal projection matrix if P is Hermitian (P † = P ) and P 2 = P , i.e., applying P a second time does not change the result any
more. Note that a geometric projection is a special case of this abstract definition.
Solution We compute the intermediate two-qubit states |ψ1 i, |ψ2 i, |ψ3 i shown below, which result from applying
the circuit gates from left to right:
|0i H H
|ψin i U |ψout i
|ψ1 i |ψ2 i |ψ3 i
1
|ψ1 i = (H |0i) ⊗ |ψin i = √ (|0i + |1i) ⊗ |ψin i , (1)
2
1 1
|ψ2 i = (controlled-U ) |ψ1 i = √ |0i ⊗ |ψin i + √ |1i ⊗ (U |ψin i), (2)
2 2
1 1
|ψ3 i = √ (H |0i) ⊗ |ψin i + √ (H |1i) ⊗ (U |ψin i)
2 2
1 1
= (|0i + |1i) ⊗ |ψin i + (|0i − |1i) ⊗ (U |ψin i)
2 2 (3)
I +U I −U
= |0i ⊗ |ψin i + |1i ⊗ |ψin i
2 2
= |0i ⊗ (P+ |ψin i) + |1i ⊗ (P− |ψin i)
where we have defined P± = 12 (I ± U ). The P± are orthogonal projectors: they are Hermitian since U is Hermitian
by assumption, and
1 1 1
P±2 = (I ± U )2 = I ± 2U + U 2 = (I ± U ) = P± .
4 4 2
In the last step we have used that U 2 = U † U = I. Moreover, the P± project onto orthogonal subspaces since
1 1
I − U 2 = 0.
P+ P− = (I + U )(I − U ) =
4 4
Since U = 1·P+ +(−1)·P− , we have found the spectral decomposition of U , i.e., the P± project onto the eigenspaces
of U corresponding to the eigenvalues ±1.
Now we show that the circuit can indeed be interpreted as measurement of |ψin i with measurement operators
P± : first, they satisfy the completeness relation since P+ + P− = I. Moreover, according to the last line of Eq. (3),
|ψ3 i is a sum of two orthogonal states, and the probability that the measurement (in the circuit diagram) of the first
qubit gives 0 or 1 is equal to the squared norm of the first and second state, respectively:
p(0) = k|0i ⊗ (P+ |ψin i)k2 = kP+ |ψin ik2 = hψin |P+† P+ |ψin i = hψin |P+ |ψin i
1 M. A. Nielsen, I. L. Chuang: Quantum Computation and Quantum Information. Cambridge University Press (2010), Exercise 4.34
1
and correspondingly p(1) = hψin |P− |ψin i. Directly after the measurement, the second qubit will be in the state
P+ |ψin i
|ψout i = if measured 0,
kP+ |ψin ik
P− |ψin i
|ψout i = if measured 1
kP− |ψin ik