Problem 1. Consider the hermitian matrix:
Find the eigenvalues of
xxxxxxxxxx
1
1
using SymPy
xxxxxxxxxx
1
1
begin
2
𝑖 = sympy.I
3
𝐎 = sympy.Matrix([ 0 0 𝑖;
4
0 0 0;
5
-𝑖 0 0]);
6
𝚝𝚛(X) = sympy.trace(X);
7
end;
xxxxxxxxxx
3
1
begin
2
λᵢ = sympy.symbols("λ₁ λ₂ λ₃")
3
end;
Now get the equation representing the equalities in the problem statement.
xxxxxxxxxx
1
1
get_eq(X,λ;p=1) = sympy.Eq(sum(λ.^p),𝚝𝚛(X^p));
xxxxxxxxxx
1
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: