Problem 1. Consider the hermitian matrix:
Find the eigenvalues of
xxxxxxxxxx1
1
using SymPyxxxxxxxxxx1
1
begin2
𝑖 = sympy.I3
𝐎 = sympy.Matrix([ 0 0 𝑖;4
0 0 0;5
-𝑖 0 0]);6
𝚝𝚛(X) = sympy.trace(X);7
end;xxxxxxxxxx3
1
begin2
λᵢ = sympy.symbols("λ₁ λ₂ λ₃")3
end;Now get the equation representing the equalities in the problem statement.
xxxxxxxxxx1
1
get_eq(X,λ;p=1) = sympy.Eq(sum(λ.^p),𝚝𝚛(X^p));xxxxxxxxxx1
eq1 = get_eq(𝐎,λᵢ)x
1
eq2 = get_eq(𝐎,λᵢ,p=2)x
1
eq3 = get_eq(𝐎,λᵢ,p=3)x
1
solutions = solve([eq1,eq2,eq3],λᵢ,dict=true);Various eigenvalue solutions: