Problem 2. Consider the normalized vector in
Show that the matrix
Solution.
xxxxxxxxxx1
1
using SymPyx
1
begin2
𝑖 = sympy.I3
⋅(x::T,y) where {T<:Number} = x*y4
⋅(x::SymMatrix,y) = sympy.MatMul(x.as_explicit(),y,evaluate=true)5
⋅(x,y::SymMatrix) = sympy.MatMul(x,y.as_explicit(),evaluate=true)6
isunitary(x::Sym) = begin7
sympy.Equality(x.as_explicit().inv(),x.as_explicit().adjoint())8
end9
end;x
1
begin2
𝐯 = 1/2 ⋅ [ 𝑖;3
-𝑖;4
𝑖;5
𝑖];6
𝐯ᵈ = sympy.adjoint(𝐯)7
I₄ = sympy.Identity(4) # symbolic identity, could use sympy.eye(4,4)8
end;xxxxxxxxxx1
1
U = I₄ - 2⋅𝐯⋅𝐯ᵈ;Now checking if this matrix is indeed unitary (i.e.
x
1
isunitary(U)Now finding the eigenvalues:
x
1
e = U.as_explicit().eigenvects(dict=true,chop=true);A total of 4 eigenvalues:
As one can see 3 of them are degenerate.