BosonStrings

Documentation for BosonStrings.

Base.:*Method
Base.:*(o1::Operator, o2::Operator)

Multiplication of two operators. Only supports single boson operator for now.

source
Base.:+Method
Base.:+(o::Matrix, term::Tuple{Number, Tuple{Int,Int} })

Add a term to a dense matrix operator. To add a term of the form c*(†n)(m), do o+=c,n,m

source
Base.:+Method
Base.:+(o1::Operator, o2::Operator)
Base.:+(o::Operator, a::Number)
Base.:+(a::Number, o::Operator)

Addition between operators and numbers

source
Base.:+Method
Base.:+(o::Operator, term::Tuple{Number, Vararg{Tuple{Int,Int,Int}} })

Add a term to an operator. The term is of the form c, (site1, n1, m1), (site2, n2, m2) ... where triplets (site, n, m) represent $a_{site}^{\dagger n} a_{site}^m$. The following example adds the term $a_{1}^{\dagger 1} a_{1}^1 a_{2}^{\dagger 2} a_{2}^3 a_{4}^{\dagger 5} a_{4}^5$ to a 4-bosons operator:

o = Operator(4)
o += 1, (1, 1, 1), (2, 2, 3), (4, 5, 5)
julia> o
(1.0 + 0.0im) (†1)(1)·(†2)(3)·(†0)(0)·(†5)(5)
source
Base.:-Method
Base.:-(o::Operator)
Base.:-(o1::Operator, o2::Operator)
Base.:-(o::Operator, a::Number)
Base.:-(a::Number, o::Operator)

Subtraction between operators and numbers

source
Base.:/Method
Base.:/(o::Operator, a::Number)

Divide an operator by a number

source
Base.showMethod
Base.show(io::IO, o::Operator)

Print an operator in a human-readable format. The operator is printed as a sum of terms, each term is a coefficient followed by a string of boson operators.

source
BosonStrings.equalMethod
equal(o1, o2; tol=1e-10)

Compare two operators. Return true if they are equal within the tolerance tol.

source
BosonStrings.expectMethod
expect(o::Operator, in_state::n, out_state::m)

Return <n|o|m> where |m> and |n> are foch states. TODO : many body

source
BosonStrings.innerMethod
inner(n::Int, o::Matrix, m::Int)

Return <n|o|m> where o is a single boson operator represented as a dense matrix.

source
BosonStrings.innerMethod
inner(n::Int, o::Operator, m::Int)

Return <n|o|m> where |n> and |m> are foch states. TODO : many body

source
BosonStrings.rk4Method
rk4(H::Operator, O::Operator, dt::Real; hbar::Real=1, heisenberg=true, M=2^20, keep::Operator=Operator(N))

Single step of Runge–Kutta-4 with time independant Hamiltonian. Returns O(t+dt). Set heisenberg=true for evolving an observable in the heisenberg picture. If heisenberg=false then it is assumed that O is a density matrix. M is the number of strings to keep.

source
BosonStrings.rk4_lindbladMethod
rk4_lindblad(H::Operator, O::Operator, dt::Real, L; hbar::Real=1, heisenberg=true, M=2^20, gamma=[])

Single step of Runge–Kutta-4 for solving the Lindblad equation

$\dot{O}=i[H,O]+\sum_i \gamma_i \left(L_i^\dagger O L_i -\frac{1}{2} \{ L_i^\dagger L_i, O\} \right)$

Returns O(t+dt). L is a list of jump operators. Set heisenberg=true for evolving an observable in the heisenberg picture. If heisenberg=false then it is assumed that O is a density matrix.

source
BosonStrings.trimMethod
trim(o::Operator, max_strings::Int)

Keep the first max_strings terms with largest coeficients.

source