Problem 3. Find the eigenvalues and normalized eigenvectors of the Hamiltonian operator:
Solution 3.
xxxxxxxxxx
5
1
begin
2
using SymPy
3
using Plots
4
pyplot()
5
end;
Definitions:
xxxxxxxxxx
5
1
begin
2
π,𝑖 = 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.
xxxxxxxxxx
2
1
K̂ = sqrthalf * sympy.Matrix([1 1;
2
1 -1]);
Now calculating the eigenvalues and eigenvectors using SymPy.
xxxxxxxxxx
4
1
begin
2
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,
xxxxxxxxxx
4
1
begin
2
v₁, v₂ = vᵢ[1], vᵢ[2];
3
v₁'⋅ v₂
4
end