Problem 3. Find the eigenvalues and normalized eigenvectors of the Hamiltonian operator:
Solution 3.
xxxxxxxxxx5
1
begin2
using SymPy3
using Plots4
pyplot()5
end;Definitions:
xxxxxxxxxx5
1
begin2
π,𝑖 = sympy.symbols("π 𝑖")3
sqrthalf = 1/sympy.sqrt(2)4
⋅(x::SymMatrix,y::SymMatrix) = sympy.Matrix.dot(x,y).simplify()5
end;This operator is the Hadamard gate.
xxxxxxxxxx2
1
K̂ = sqrthalf * sympy.Matrix([1 1;2
1 -1]);Now calculating the eigenvalues and eigenvectors using SymPy.
xxxxxxxxxx4
1
begin2
eᵢ = K̂.eigenvals(multiple=true,rational=true)3
vᵢ = [sympy.simplify(v[end][1]) for v in K̂.eigenvects(chop=true)]4
end;The eigenvectors, which are not normalized, and eigenvalues are:
The characteristics that make these eigenvectors is that the inner product is a scalar value equal to 0, as seen below,
xxxxxxxxxx4
1
begin2
v₁, v₂ = vᵢ[1], vᵢ[2];3
v₁'⋅ v₂4
end