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 conservation.

Fields

  • basisstates::IF: A vector of Fock numbers, which are integers representing the occupation of each mode.
  • state_indexdict::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.FockSymmetryFunctionType
FockSymmetryFunction{F} <: AbstractSymmetry

FockSymmetryFunction represents a symmetry defined by a function that maps Fock states to quantum numbers. The function should return 'missing' for states which should be discarded from the hilbert space.

source
FermionicHilbertSpaces.bdg_hilbert_spaceMethod
bdg_hilbert_space(labels)

This hilbert space uses Nambu states to describe non-interacting systems with superconductive pairing. Matrix representations of quadratic operators take the form
[H Δ; -Δ* -H*]
where H is hermitian and Δ is antisymmetric.

source
FermionicHilbertSpaces.embedMethod
embed(m, Hsub => H; complement=complementary_subsystem(H, Hsub), kwargs...)

Compute the embedding of a matrix m in the basis Hsub into the basis H. Fermionic phase factors are included if the two spaces are fermionic Hilbert spaces.

source
FermionicHilbertSpaces.embedMethod
embed(Hsub => H; kwargs...)

Compute the embedding map from Hsub into H. Fermionic phase factors are included if the two spaces are fermionic Hilbert spaces.

source
FermionicHilbertSpaces.embedding_unitaryMethod
embedding_unitary(partition, basisstates, 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.
- `basisstates`: The basis 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.extendFunction
extend(m, H => Hbar, Hout = tensor_product((H, Hbar)); kwargs...)

Extend an operator or state m from Hilbert space H into a disjoint space Hbar.

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.focksymmetryMethod
focksymmetry(basisstates, qn)

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

Arguments

  • basisstates: The basisstates to iterate over
  • qn: A function that takes an integer representing a fock state and returns corresponding quantum number.
source
FermionicHilbertSpaces.generalized_kronFunction
generalized_kron(ms, Hs, H::AbstractHilbertSpace=tensor_product(Hs))

Compute the 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.number_conservationFunction
number_conservation(sectors=missing, weight_function=label -> true)

Constructs a UninstantiatedNumberConservations symmetry object that represents conservation of fermion number. 'sectors' can be an integer or a collection of integers specifying the allowed fermion numbers. 'weight_function' is a function that takes a label and returns an integer weight (which can be negative) indicating how that label contributes to the fermion number.

source
FermionicHilbertSpaces.partial_trace!Function
partial_trace!(mout, m, H::AbstractHilbertSpace, Hsub::AbstractHilbertSpace, phase_factors::Bool, complement, extend_state=StateExtender((Hsub, complement), H))

Compute the partial trace of m from H to Hsub.

source
FermionicHilbertSpaces.partial_traceMethod
partial_trace(m, H => Hsub; phase_factors=use_phase_factors(H) && use_phase_factors(Hsub), complement=complementary_subsystem(H, Hsub))

Compute the partial trace of m from H to Hsub. Fermionic phase factors are included if both H and Hsub are Fermionic, unless specified otherwise in kwargs.

source
FermionicHilbertSpaces.partial_traceMethod
partial_trace(H => Hsub; kwargs...)

Compute the partial trace map from H to Hsub, represented by a sparse matrix of dimension dim(Hsub)^2 x dim(H)^2 that can be multiplied with a vectorized density matrix.

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.single_particle_hilbert_spaceMethod
single_particle_hilbert_space(labels)

A hilbert space suitable for non-interacting systems with fermion number conservation. Matrix representations of symbolic operators give the single particle hamiltonian, without any contribution from the identity matrix.

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_productMethod
tensor_product(ms, Hs, H::AbstractHilbertSpace; kwargs...)

Compute the ordered product of the fermionic embeddings of the matrices ms in the spaces Hs into the space H. kwargs can be passed a bool phase_factors and a hilbert space complement.

source
FermionicHilbertSpaces.togglefermionsMethod
togglefermions(digitpositions, daggers, f::FockNumber)

Return (newfocknbr, fermionstatistics) where newfocknbr is the state obtained by toggling fermions at digitpositions with daggers in the Fock state f, and fermionstatistics is the phase from the Jordan-Wigner string. If the operation puts two fermions one the same site, the resulting state is undefined.

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