FermionicHilbertSpaces.jl
FermionicHilbertSpaces.jl turns symbolic fermion, boson and spin operators into matrices on Hilbert spaces. The goal of this package is that you should be able to define your own physics and never have to think about indexing of vectors and matrices.
Install the package from the Julia package manager with Pkg.add("FermionicHilbertSpaces").
The cheat sheet lists common tasks and the functions that do them.
Functionality
- Symbolic operators: fermions, bosons and spins are combined algebraically, e.g.
f[1]'f[2] + hc, and simplified with their commutation relations.representationturns them into matrices on any Hilbert space. - Hilbert spaces: spaces keep track of their basis states and ordering, so you never index by hand. They can be restricted by particle number, parity or any rule on the basis states.
- Tensor products and partial traces: spaces combine and split, as in
partial_trace(ρ, H => Hsub), with fermionic signs handled automatically. - Extensible: custom operators and spaces can be added, see Extending.
It is not a solver: combine it with LinearAlgebra, KrylovKit or ODE solvers for eigenstates and time evolution.
Getting started
We find the ground state of a half-filled chain of interacting spinless fermions and how entangled its two halves are. The Hamiltonian conserves particle number, so we diagonalize only in the half-filled sector and then trace out the right half:
using FermionicHilbertSpaces, LinearAlgebra@fermions cN, V = 6, 2.0ham = sum(c[n+1]'c[n] + hc + V * c[n]'c[n] * c[n+1]'c[n+1] for n in 1:N-1)H = hilbert_space(c, 1:N, NumberConservation(N ÷ 2))E, vecs = eigen(Hermitian(representation(ham, H, :dense)))ρ = partial_trace(vecs[:, 1], H => hilbert_space(c, 1:N÷2))S = -sum(λ * log(λ) for λ in eigvals(Hermitian(ρ)) if λ > 0)E[1], S(-2.672479361373294, 0.7055211210460454)Where to go next
Tutorials:
- Interacting Kitaev chain: parity sectors, ground states and the locality of many-body Majoranas.
- Bosons and Spins: truncated bosonic modes and spin chains.
- Mixed fermion-spin-boson system: combining different particle types in one space.
- Open systems: Lindblad dynamics on the doubled space, with
reshapebetween vectors and density matrices. - Spatial symmetries: translation-symmetry sectors.
Guides:
- Constrained spaces and quantum numbers: building sectors and custom constraints.
- Hilbert space operations: tensor products, embeddings, partial traces and sector blocks.
- Symbolic states: acting with operators on states without building matrices.
- Fermionic tensor products and partial traces: the conventions behind the fermionic signs[1].
- Non-interacting systems: free-fermion methods for quadratic Hamiltonians.
- Extending: adding your own operators, with clock and Floquet examples.
Related packages
FermionicHilbertSpaces.jl grew out of QuantumDots.jl. Its symbolic operator algebra is built on NonCommutativeProducts.jl.
- 1Szalay, Szilárd, et al. "Fermionic systems for quantum information people." Journal of Physics A: Mathematical and Theoretical 54.39 (2021): 393001, arXiv:2006.03087