Skip to content

qojulia/SecondQuantizedAlgebra.jl

Repository files navigation

SecondQuantizedAlgebra

docs codecov Benchmarks

Code Style: Blue Aqua QA jet

A Julia package for symbolic manipulation and algebraic computation with second quantized operators. SecondQuantizedAlgebra.jl provides a flexible framework for working with creation and annihilation operators, commutation relations, and algebraic expressions common in quantum many-body theory and quantum optics.

The package provides:

  • Symbolic representation of bosonic fock creation and annihilation operators
  • Automatic (anti-)commutation relation handling
  • Algebraic simplification and normal ordering
  • Support for atom and spin operators
  • Extensible for custom operator types

The code was refactored out of QuantumCumulants.jl.

Installation

Install with Julia's package manager:

pkg> add SecondQuantizedAlgebra

Usage

using SecondQuantizedAlgebra

ha = NLevelSpace(:atoms,2)
hc = FockSpace(:cavity)
h = hc  ha

@cnumbers N Δ κ γ ν

i = Index(h,:i,N,ha)
j = Index(h,:j,N,ha)

@qnumbers b::Destroy(h)
σ(x,y,z) = IndexedOperator(Transition(h,,x,y),z)
gi = IndexedVariable(:g,i)

H = Δ*b'*b + (gi*(b*σ(2,1,i) + b'*σ(1,2,i)),i)

See the documentation for more details and advanced usage.

Contributing

Contributions and suggestions are welcome! Please open issues or pull requests on GitHub.

License

This project is licensed under the MIT License.