Problem 2. Consider the standard basis
.
Given the projection matrices:
Find the expectation value for the projection matrices on the state vector in the
Solution.
xxxxxxxxxx1
1
begin2
using SymPy3
endxxxxxxxxxx1
1
begin2
𝑖 = sympy.I3
sqrthalf = 1/sympy.sqrt(2)4
⋅ = *5
⊗(X,Y) = kron(X,Y)6
end;xxxxxxxxxx1
1
begin2
b₀ = [1;3
0]4
b₁ = [0;5
1]6
ψ = sqrthalf ⋅ (b₀ ⊗ b₀ + b₁ ⊗ b₁)7
ψᵃ = ψ.adjoint()8
end;xxxxxxxxxx1
1
begin2
I₂ = sympy.eye(2,2)3
σx = sympy.Matrix([0 1;4
1 0])5
σz = sympy.Matrix([1 0;6
0 -1])7
end;xxxxxxxxxx1
1
begin2
P₁ = 1/2 ⋅ (I₂ - σx)3
P₂ = 1/2 ⋅ (I₂ + σz)4
P₁₂ = P₁ ⊗ P₂5
end;The projection matrix over the
xxxxxxxxxx1
1
expectation = ψᵃ⋅P₁₂⋅ψ;The expectation,