Skip to content

nicolasloizeau/BosonStrings.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BosonStrings

Dev Build Status

Normal ordered strings of bosonic operators in Julia.

Installation

] add https://github.com/nicolasloizeau/BosonStrings.jl

Getting started

Algebra

Compute $a_{1}^{\dagger 1} a_{1}^1 \cdot a_{1}^{\dagger 2} a_{1}^2$

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 $a_{1}^{\dagger 1} a_{1}^1 \cdot a_{1}^{\dagger 2} a_{1}^2 = a_{1}^{\dagger 3} a_{1}^3 + 2a_{1}^{\dagger 2} a_{1}^2$

Expectation values with Fock States

Compute $\langle 2 |o| 2 \rangle$:

julia> inner(2, o, 2)
4.0 + 0.0im

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •