Author: J. R. Johansson (robert@riken.jp), http://jrjohansson.github.io.
Status: Preliminary (work in progress)
This notebook is part of a series of IPython notebooks on symbolic quantum mechanics computations using
SymPy and SymPsi. SymPsi is an experimental fork and extension of the sympy.physics.quantum
module in SymPy. The latest version of this notebook is available at http://github.com/jrjohansson/sympy-quantum-notebooks, and the other notebooks in this lecture series are also indexed at http://jrjohansson.github.io.
Requirements: A recent version of SymPy and the latest development version of SymPsi is required to execute this notebook. Instructions for how to install SymPsi is available here.
Disclaimer: The SymPsi module is still under active development and may change in behavior without notice, and the intention is to move some of its features to sympy.physics.quantum
when they matured and have been tested. However, these notebooks will be kept up-to-date the latest versions of SymPy and SymPsi.
from sympy import *
init_printing()
from sympsi import *
from sympsi.pauli import *
One of the simplest possible quantum system is the two-level system, such as a spin-$1/2$, or an atom or artificial-atom (nano-device) with (effectively) only two quantum states.
The Hamiltonian for a two-level quantum system is conveniently written in terms of the Pauli matrices $\sigma_x$, $\sigma_y$ and $\sigma_z$, and their annihilation and creation operators $\sigma_-$ and $\sigma_+$. In terms of these operators we can write the Hamiltonian on the form:
$$ H = -\frac{1}{2}\Delta\sigma_x - \frac{1}{2}\epsilon\sigma_z $$where $\epsilon$ is the bare energy splitting and $\Delta$ is the tunneling rate between the two states of the two-level system.
In SymPy we can represent this Hamiltonian as:
theta, t = symbols("theta, t")
eps, Delta, Omega = symbols("epsilon, Delta, Omega", positive=True)
Hsym = symbols("H")
sx, sy, sz = SigmaX(), SigmaY(), SigmaZ()
H = -eps/2 * sz - Delta/2 * sx
Eq(Hsym, H)
Is often convenient to perform basis transformation that simplifies the Hamiltonian. For example, we can transform the Hamiltonian to the eigenbasis (where the Hamiltonian is diagonal, that is only containing a $\sigma_z$ term) by applying the unitary tranformation:
U = exp(I * theta/2 * sy); U
This unitary tranformation transforms the operators in the Hamiltonian according to these well-known relations:
hamiltonian_transformation(U, sx)
hamiltonian_transformation(U, sz)
so the Hamiltonian after this transformation takes the form
H1 = hamiltonian_transformation(U, H)
H1
H2 = collect(H1.expand(), (sx, sz))
H2
In the eigenbasis we require the coefficient of $\sigma_x$ to be zero, so we have the condition:
c, o = split_coeff_operator(H2.args[0])
Eq(c, 0)
with the solution
Eq(tan(theta), Delta/eps)
Substituting this into the Hamiltonian results in
H3 = simplify(H2.subs(theta, atan(Delta/eps)))
H3
Now introduce $\Omega = \sqrt{\Delta^2 + \epsilon^2}$, which is the eigenenergies of the two-level system:
H3.subs(Delta, sqrt(Omega ** 2 - eps ** 2))
In summary, to reach this basis, we have transformed $\sigma_x$ and $\sigma_z$ as:
hamiltonian_transformation(U, sx)
hamiltonian_transformation(U, sz)
and chosen $\theta = \arctan(\Delta/\epsilon)$.
%reload_ext version_information
%version_information sympy, sympsi
Software | Version |
---|---|
Python | 3.4.1 (default, Sep 20 2014, 19:44:17) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] |
IPython | 2.3.0 |
OS | Darwin 13.4.0 x86_64 i386 64bit |
sympy | 0.7.5-git |
sympsi | 0.1.0.dev-0c6e514 |
Thu Oct 09 15:23:41 2014 JST |