Normal ordered strings of bosonic operators in Julia.
] add https://github.com/nicolasloizeau/BosonStrings.jlCompute
using BosonStrings
o1 = Operator(1) #single boson operator
o1 += 1, (1, 1, 1) #add a† a
o2 = Operator(1)
o2 += 1, (1, 2, 2) #add a†^2 a^2
o = o1 * o2
println(o)julia> o
(1.0 + 0.0im) (†3)(3)
(2.0 + 0.0im) (†2)(2)
we get
Compute
julia> inner(2, o, 2)
4.0 + 0.0im