# first, define the three atomic states:
one = basis(3,0)
two = basis(3,1)
three = basis(3,2)
# states and atomic operators
sig11 = one * one.dag()
sig22 = two * two.dag()
sig33 = three * three.dag()
sig12 = one * two.dag()
sig32 = three * two.dag()
# destruction operator
a = tensor(identity(3),destroy(N))
N = 10 # limit the photon space to N dimensions
# the tensor space will be in the form |atom> (*) |photon>:
Sig11 = tensor(sig11,identity(N))
Sig22 = tensor(sig22,identity(N))
... etc fill in the rest
# define the Hamiltonian
H = H0 + H12 + H21 + H23 + H32
psi0 = tensor(basis(N, n), basis(3,0)).unit()
tlist = linspace(0, 100, 1500)
res = mesolve(H , psi0, tlist, [Sig11])