Functions
FermionicHilbertSpaces.hcFermionicHilbertSpaces.FockHilbertSpaceFermionicHilbertSpaces.FockNumberFermionicHilbertSpaces.FockSymmetryFermionicHilbertSpaces.FockSymmetryFunctionFermionicHilbertSpaces.HCFermionicHilbertSpaces.JordanWignerOrderingFermionicHilbertSpaces.NoSymmetryFermionicHilbertSpaces.NumberConservationFermionicHilbertSpaces.ParityConservationFermionicHilbertSpaces.SimpleFockHilbertSpaceFermionicHilbertSpaces.SymmetricFockHilbertSpaceFermionicHilbertSpaces.basisstatesFermionicHilbertSpaces.bdg_hilbert_spaceFermionicHilbertSpaces.embedFermionicHilbertSpaces.embedFermionicHilbertSpaces.embedding_unitaryFermionicHilbertSpaces.eval_in_basisFermionicHilbertSpaces.extendFermionicHilbertSpaces.extendFermionicHilbertSpaces.fermion_sparse_matrixFermionicHilbertSpaces.fermionsFermionicHilbertSpaces.fixed_particle_number_fockstatesFermionicHilbertSpaces.focksymmetryFermionicHilbertSpaces.generalized_kronFermionicHilbertSpaces.hilbert_spaceFermionicHilbertSpaces.jwstringFermionicHilbertSpaces.majorana_hilbert_spaceFermionicHilbertSpaces.majoranasFermionicHilbertSpaces.matrix_representationFermionicHilbertSpaces.number_conservationFermionicHilbertSpaces.numberoperatorFermionicHilbertSpaces.parityoperatorFermionicHilbertSpaces.partial_traceFermionicHilbertSpaces.partial_traceFermionicHilbertSpaces.partial_trace!FermionicHilbertSpaces.removefermionFermionicHilbertSpaces.single_particle_hilbert_spaceFermionicHilbertSpaces.subregionFermionicHilbertSpaces.tensor_productFermionicHilbertSpaces.tensor_productFermionicHilbertSpaces.togglefermionsFermionicHilbertSpaces.@fermionsFermionicHilbertSpaces.@majoranas
Docstrings
FermionicHilbertSpaces.hc — Constant
FermionicHilbertSpaces.FockHilbertSpace — Type
FockHilbertSpaceA type representing a Fock Hilbert space with a given set of modes and Fock states.
sourceFermionicHilbertSpaces.FockSymmetry — Type
struct FockSymmetry{IF,FI,QN,QNfunc} <: AbstractSymmetryFockSymmetry 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.
FermionicHilbertSpaces.FockSymmetryFunction — Type
FockSymmetryFunction{F} <: AbstractSymmetryFockSymmetryFunction 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.
sourceFermionicHilbertSpaces.HC — Type
FermionicHilbertSpaces.SimpleFockHilbertSpace — Type
SimpleFockHilbertSpaceA type representing a simple Fock Hilbert space with all fock states included.
sourceFermionicHilbertSpaces.SymmetricFockHilbertSpace — Type
SymmetricFockHilbertSpaceA type representing a Fock Hilbert space with fockstates organized by their quantum number.
sourceFermionicHilbertSpaces.basisstates — Method
FermionicHilbertSpaces.bdg_hilbert_space — Method
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.
FermionicHilbertSpaces.embed — Method
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.
FermionicHilbertSpaces.embed — Method
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.
FermionicHilbertSpaces.embedding_unitary — Method
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.sourceFermionicHilbertSpaces.eval_in_basis — Method
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)sourceFermionicHilbertSpaces.extend — Function
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.
FermionicHilbertSpaces.extend — Function
extend(H => Hbar, Hout = tensor_product((H, Hbar)); kwargs...)Compute the extend map from H into a disjoint space Hbar.
FermionicHilbertSpaces.fermion_sparse_matrix — Method
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.
FermionicHilbertSpaces.fermions — Method
FermionicHilbertSpaces.fixed_particle_number_fockstates — Method
fixed_particle_number_fockstates(M, n)Generate a list of Fock states with n occupied fermions in a system with M different fermions.
FermionicHilbertSpaces.focksymmetry — Method
focksymmetry(basisstates, qn)Constructs a FockSymmetry object that represents the symmetry of a many-body system.
Arguments
basisstates: The basisstates to iterate overqn: A function that takes an integer representing a fock state and returns corresponding quantum number.
FermionicHilbertSpaces.generalized_kron — Function
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.
FermionicHilbertSpaces.hilbert_space — Method
hilbert_space(labels[, symmetry, basisstates])Construct a Hilbert space from a set of labels, with optional symmetry and Fock number specification.
sourceFermionicHilbertSpaces.jwstring — Method
FermionicHilbertSpaces.majorana_hilbert_space — Function
majorana_hilbert_space(labels, qn)Represents a hilbert space for majoranas. labels must be an even number of unique labels.
FermionicHilbertSpaces.majoranas — Function
FermionicHilbertSpaces.matrix_representation — Method
matrix_representation(op, H::AbstractFockHilbertSpace)Return the matrix representation of the symbolic operator op on the hilbert space H.
FermionicHilbertSpaces.number_conservation — Function
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.
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.
FermionicHilbertSpaces.partial_trace — Method
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.
FermionicHilbertSpaces.partial_trace — Method
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.
FermionicHilbertSpaces.removefermion — Method
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.
FermionicHilbertSpaces.single_particle_hilbert_space — Method
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.
sourceFermionicHilbertSpaces.subregion — Method
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.
FermionicHilbertSpaces.tensor_product — Method
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.
FermionicHilbertSpaces.togglefermions — Method
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.
FermionicHilbertSpaces.@fermions — Macro
@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 bcreates two species of fermions that anticommute:a[1]' * a[1] + a[1] * a[1]' == 1a[1]' * b[1] + b[1] * a[1]' == 0
@fermions a; @fermions bcreates two species of fermions that commute with each other:a[1]' * a[1] + a[1] * a[1]' == 1a[1] * b[1] - b[1] * a[1] == 0
See also @majoranas, FermionicHilbertSpaces.eval_in_basis.
FermionicHilbertSpaces.@majoranas — Macro
@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 bcreates two species of Majoranas that anticommute:a[1] * a[1] + a[1] * a[1] == 1a[1] * b[1] + b[1] * a[1] == 0
@majoranas a; @majoranas bcreates two species of Majoranas that commute with each other:a[1] * a[1] + a[1] * a[1] == 1a[1] * b[1] - b[1] * a[1] == 0
See also @fermions, FermionicHilbertSpaces.eval_in_basis.