Julia Package QuantumAlgebra
: https://github.com/jfeist/QuantumAlgebra.jl
using Pkg
Pkg.add("QuantumAlgebra")
Allows to write (somewhat) arbitrary expressions of quantum operators and perform commutator algebra etc with them.
Possible operators (for now): Bosonic ($a$, $a^\dagger$) and two-level systems (Pauli matrices) $\sigma_{x,y,z}$.
Documentation at https://jfeist.github.io/QuantumAlgebra.jl/stable/
using QuantumAlgebra
adag()*a()
All expressions are reduced to a "canonical" form (normal ordering + some extra rules)
a()*adag()
σx()*σy()
σy()*σz()
σy()*σy()
Operators can have indices.
a(:k)*adag(:k)
Symbolic indices can be equal
a(:k)*adag(:j)
Sums: Can represent analytic sums over indices
s = ∑(:i,adag(:i))
s*a(:j)
Sum indices are assumed to run over all possible values.
Summing over $\delta_{i,j}$ removes the sum.
a(:j)*s
a(:k)*s
a(:k)*∑(:i,adag(:i)*adag(:i))
Multiple indices, nested sums, etc...
a(:i,:j,:μ) * adag(:m,:n,:μ)
∑(:j, ∑(:i,a(:i,:j,:μ))) * adag(:m,:n,:μ)
∑(:i,a(:i)) * ∑(:k,adag(:k))
Caution: implementation of analytic sums not fully finished (especially for nested sums).
Parameters
s = ∑(:j,param(:ω,:j)*adag(:j))
string-based input form:
s = ∑(:j,Pr"ω_j"*adag(:j))
a(:i)*s
Back to the original motivation: Emitter + many-mode Hamiltonian
H = 1//2*Pr"Ω"*σz() + Pr"E(t)"*σx() + ∑(:i,Pr"ω_i"*adag(:i)*a(:i)) + ∑(:i,Pr"g_i"*(adag(:i)+a(:i))*σx())
comm(σz(),H)
comm(adag(:j)*σz(),H)