from sympy import *
init_printing()
from sympy.physics.quantum import *
from sympy.physics.quantum.pauli import *
from sympy_quantum_utils import *
eps, delta, theta, Hsym, t = symbols("epsilon, delta, theta, H, t")
Omega = symbols("Omega", positive=True)
n = 6
sx, sy, sz = SigmaX(), SigmaY(), SigmaZ()
Consider the Hamiltonian for a two-level quantum system on the form:
$$ H = \frac{1}{2}\Delta\sigma_x + \frac{1}{2}\epsilon\sigma_z $$H = eps/2 * sz + delta/2 * sx
Eq(Hsym, H)
We can transform the Hamiltonian to the eigenbasis (where the Hamiltonian is diagonal, only containing a $\sigma_z$ term) by applying the unitary tranformation:
U = exp(I * theta/2 * sy)
hamiltonian_transformation_auto(U, sx)
hamiltonian_transformation_auto(U, sz)
H1 = hamiltonian_transformation_auto(U, H)
H1
H4 = collect(H1, (sx, sz))
H4
In the eigenbasis we require the coefficient of $\sigma_x$ to be zero, so we have the condition:
c, o = split_coeff_operator(H4.args[1])
Eq(c, 0)
Eq(tan(theta), delta/eps)
eq = Eq(theta, atan(delta/eps))
eq
H5 = simplify(H4.subs(theta, atan(delta/eps)))
H5
Now introduce $\Omega = \sqrt{\Delta^2 + \epsilon^2}$:
powsimp(simplify(H5.subs(eps, sqrt(Omega ** 2-delta ** 2))), force=True)
So we have reached the eigenbasis by applying the unitary transformation
U
with
eq
%reload_ext version_information
%version_information sympy
Software | Version |
---|---|
Python | 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] |
IPython | 3.0.0-dev |
OS | posix [linux] |
sympy | 0.7.4.1-git |
Sat Jun 07 16:27:37 2014 JST |