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.
xxxxxxxxxx
1
1
begin
2
using SymPy
3
end
xxxxxxxxxx
1
1
begin
2
𝑖 = sympy.I
3
sqrthalf = 1/sympy.sqrt(2)
4
⋅ = *
5
⊗(X,Y) = kron(X,Y)
6
end;
xxxxxxxxxx
1
1
begin
2
b₀ = [1;
3
0]
4
b₁ = [0;
5
1]
6
ψ = sqrthalf ⋅ (b₀ ⊗ b₀ + b₁ ⊗ b₁)
7
ψᵃ = ψ.adjoint()
8
end;
xxxxxxxxxx
1
1
begin
2
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;
xxxxxxxxxx
1
1
begin
2
P₁ = 1/2 ⋅ (I₂ - σx)
3
P₂ = 1/2 ⋅ (I₂ + σz)
4
P₁₂ = P₁ ⊗ P₂
5
end;
The projection matrix over the
xxxxxxxxxx
1
1
expectation = ψᵃ⋅P₁₂⋅ψ;
The expectation,