Functions

Docstrings

FermionicHilbertSpaces.FockSymmetryType
struct FockSymmetry{IF,FI,QN,QNfunc} <: AbstractSymmetry

FockSymmetry represents a symmetry that is diagonal in fock space, i.e. particle number conservation, parity, spin consvervation.

Fields

  • focknumbers::IF: A vector of Fock numbers, which are integers representing the occupation of each mode.
  • focktoinddict::FI: A dictionary mapping Fock states to indices.
  • qntofockstates::Dictionary{QN,Vector{Int}}: A dictionary mapping quantum numbers to Fock states.
  • conserved_quantity::QNfunc: A function that computes the conserved quantity from a fock number.
source
FermionicHilbertSpaces.embedding_unitaryMethod
embedding_unitary(partition, fockstates, jw)

Compute the unitary matrix that maps between the tensor embedding and the fermionic embedding in the physical subspace. 
# Arguments
- `partition`: A partition of the labels in `jw` into disjoint sets.
- `fockstates`: The fock states in the basis
- `jw`: The Jordan-Wigner ordering.
source
FermionicHilbertSpaces.eval_in_basisMethod
eval_in_basis(a, f)

Evaluate an expression with fermions in a basis f.

Examples

@fermions a
f = fermions(hilbert_space(1:2))
FermionicHilbertSpaces.eval_in_basis(a[1]'*a[2] + hc, f)
source
FermionicHilbertSpaces.fermion_sparse_matrixMethod
fermion_sparse_matrix(fermion_number, H::AbstractFockHilbertSpace)

Constructs a sparse matrix of size representing a fermionic annihilation operator at bit position fermion_number on the Hilbert space H.

source
FermionicHilbertSpaces.fermionic_kronFunction
fermionic_kron(ms, Hs, H::AbstractHilbertSpace=tensor_product(Hs))

Compute the fermionic tensor product of matrices or vectors in ms with respect to the spaces Hs, respectively. Return a matrix in the space H, which defaults to the tensor_product product of Hs.

source
FermionicHilbertSpaces.focksymmetryMethod
focksymmetry(focknumbers, qn)

Constructs a FockSymmetry object that represents the symmetry of a many-body system.

Arguments

  • focknumbers: The focknumbers to iterate over
  • qn: A function that takes an integer representing a fock state and returns corresponding quantum number.
source
FermionicHilbertSpaces.partial_trace!Function
partial_trace!(mout, m::AbstractMatrix, H::AbstractHilbertSpace, Hout::AbstractHilbertSpace, phase_factors)

Compute the fermionic partial trace of a matrix m in basis H, leaving only the subsystems specified by labels. The result is stored in mout, and Hout determines the ordering of the basis states.

source
FermionicHilbertSpaces.partial_traceMethod
partial_trace(m::AbstractMatrix,  bHfull::AbstractHilbertSpace, Hsub::AbstractHilbertSpace)

Compute the partial trace of a matrix m, leaving the subsystem defined by the basis bsub.

source
FermionicHilbertSpaces.removefermionMethod
removefermion(digitposition, f::FockNumber)

Return (newfocknbr, fermionstatistics) where newfocknbr is the state obtained by removing a fermion at digitposition from f and fermionstatistics is the phase from the Jordan-Wigner string, or 0 if the operation is not allowed.

source
FermionicHilbertSpaces.subregionMethod
subregion(modes, H::AbstractHilbertSpace)

Return a subregion of the Hilbert space H that is spanned by the modes in modes. Only substates in H are included.

source
FermionicHilbertSpaces.tensor_productFunction
tensor_product(ms, Hs, H::AbstractHilbertSpace, phase_factors=true)

Compute the ordered product of the fermionic embeddings of the matrices ms in the spaces Hs into the space H.

source
FermionicHilbertSpaces.@fermionsMacro
@fermions a b ...

Create one or more fermion species with the given names. Indexing into fermions species gives a concrete fermion. Fermions in one @fermions block anticommute with each other, and commute with fermions in other @fermions blocks.

Examples:

  • @fermions a b creates two species of fermions that anticommute:
    • a[1]' * a[1] + a[1] * a[1]' == 1
    • a[1]' * b[1] + b[1] * a[1]' == 0
  • @fermions a; @fermions b creates two species of fermions that commute with each other:
    • a[1]' * a[1] + a[1] * a[1]' == 1
    • a[1] * b[1] - b[1] * a[1] == 0

See also @majoranas, FermionicHilbertSpaces.eval_in_basis.

source
FermionicHilbertSpaces.@majoranasMacro
@majoranas a b ...

Create one or more Majorana species with the given names. Indexing into Majorana species gives a concrete Majorana. Majoranas in one @majoranas block anticommute with each other, and commute with Majoranas in other @majoranas blocks.

Examples:

  • @majoranas a b creates two species of Majoranas that anticommute:
    • a[1] * a[1] + a[1] * a[1] == 1
    • a[1] * b[1] + b[1] * a[1] == 0
  • @majoranas a; @majoranas b creates two species of Majoranas that commute with each other:
    • a[1] * a[1] + a[1] * a[1] == 1
    • a[1] * b[1] - b[1] * a[1] == 0

See also @fermions, FermionicHilbertSpaces.eval_in_basis.

source