Functions
FermionicHilbertSpaces.FermionConservation
FermionicHilbertSpaces.FockHilbertSpace
FermionicHilbertSpaces.FockNumber
FermionicHilbertSpaces.FockSymmetry
FermionicHilbertSpaces.HC
FermionicHilbertSpaces.IndexConservation
FermionicHilbertSpaces.JordanWignerOrdering
FermionicHilbertSpaces.NoSymmetry
FermionicHilbertSpaces.ParityConservation
FermionicHilbertSpaces.SimpleFockHilbertSpace
FermionicHilbertSpaces.SymmetricFockHilbertSpace
FermionicHilbertSpaces.embedding
FermionicHilbertSpaces.embedding_unitary
FermionicHilbertSpaces.eval_in_basis
FermionicHilbertSpaces.extension
FermionicHilbertSpaces.fermion_sparse_matrix
FermionicHilbertSpaces.fermion_to_majorana
FermionicHilbertSpaces.fermionic_kron
FermionicHilbertSpaces.fermions
FermionicHilbertSpaces.fixed_particle_number_fockstates
FermionicHilbertSpaces.focknumbers
FermionicHilbertSpaces.focksymmetry
FermionicHilbertSpaces.hilbert_space
FermionicHilbertSpaces.jwstring
FermionicHilbertSpaces.majorana_to_fermion
FermionicHilbertSpaces.majoranas
FermionicHilbertSpaces.numberoperator
FermionicHilbertSpaces.parityoperator
FermionicHilbertSpaces.partial_trace
FermionicHilbertSpaces.partial_trace!
FermionicHilbertSpaces.removefermion
FermionicHilbertSpaces.subregion
FermionicHilbertSpaces.tensor_product
FermionicHilbertSpaces.tensor_product
FermionicHilbertSpaces.@fermions
FermionicHilbertSpaces.@majoranas
Docstrings
FermionicHilbertSpaces.FermionConservation
— TypeFermionConservation
A symmetry type representing conservation of total fermion number.
FermionicHilbertSpaces.FockHilbertSpace
— TypeFockHilbertSpace
A type representing a Fock Hilbert space with a given set of modes and Fock states.
FermionicHilbertSpaces.FockNumber
— TypeFockNumber
A type representing a Fock state as the bitstring of an integer.
FermionicHilbertSpaces.FockSymmetry
— Typestruct 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.
FermionicHilbertSpaces.HC
— TypeHC
Represents the Hermitian conjugate.
FermionicHilbertSpaces.IndexConservation
— TypeIndexConservation
A symmetry type representing conservation of the numbers of modes which contains a specific index or set of indices.
FermionicHilbertSpaces.JordanWignerOrdering
— TypeJordanWignerOrdering
A type representing the ordering of fermionic modes.
FermionicHilbertSpaces.NoSymmetry
— TypeNoSymmetry
A symmetry type indicating no symmetry constraints.
FermionicHilbertSpaces.ParityConservation
— TypeParityConservation
A symmetry type representing conservation of fermion parity.
FermionicHilbertSpaces.SimpleFockHilbertSpace
— TypeSimpleFockHilbertSpace
A type representing a simple Fock Hilbert space with all fock states included.
FermionicHilbertSpaces.SymmetricFockHilbertSpace
— TypeSymmetricFockHilbertSpace
A type representing a Fock Hilbert space with fockstates organized by their quantum number.
FermionicHilbertSpaces.embedding
— Functionembedding(m, H, Hnew)
Compute the fermionic embedding of a matrix m
in the basis H
into the basis Hnew
.
FermionicHilbertSpaces.embedding_unitary
— Methodembedding_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.
FermionicHilbertSpaces.eval_in_basis
— Methodeval_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)
FermionicHilbertSpaces.extension
— Functionextension(m, H, Hbar[, phase_factors])
Extend an operator or state m
from Hilbert space H
into a disjoint space Hbar
.
FermionicHilbertSpaces.fermion_sparse_matrix
— Methodfermion_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.fermion_to_majorana
— Functionfermion_to_majorana(expr)
Convert symbolic fermions to symbolic majoranas.
FermionicHilbertSpaces.fermionic_kron
— Functionfermionic_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
.
FermionicHilbertSpaces.fermions
— Methodfermions(H)
Return a dictionary of fermionic annihilation operators for the Hilbert space H
.
FermionicHilbertSpaces.fixed_particle_number_fockstates
— Methodfixed_particle_number_fockstates(M, n)
Generate a list of Fock states with n
occupied fermions in a system with M
different fermions.
FermionicHilbertSpaces.focknumbers
— Methodfocknumbers(H)
Return an iterator over all Fock states for the given Hilbert space H
.
FermionicHilbertSpaces.focksymmetry
— Methodfocksymmetry(focknumbers, qn)
Constructs a FockSymmetry
object that represents the symmetry of a many-body system.
Arguments
focknumbers
: The focknumbers to iterate overqn
: A function that takes an integer representing a fock state and returns corresponding quantum number.
FermionicHilbertSpaces.hilbert_space
— Methodhilbert_space(labels[, symmetry, focknumbers])
Construct a Hilbert space from a set of labels, with optional symmetry and Fock number specification.
FermionicHilbertSpaces.jwstring
— Methodjwstring(site, focknbr)
Parity of the number of fermions to the right of site.
FermionicHilbertSpaces.majorana_to_fermion
— Functionmajorana_to_fermion(expr)
Convert symbolic majoranas to symbolic fermions.
FermionicHilbertSpaces.majoranas
— Functionmajoranas(H)
Return a dictionary of Majorana operators for the Hilbert space H
.
FermionicHilbertSpaces.numberoperator
— Methodnumberoperator(H)
Return the number operator for the Hilbert space H
.
FermionicHilbertSpaces.parityoperator
— Methodparityoperator(H)
Return the fermionic parity operator for the Hilbert space H
.
FermionicHilbertSpaces.partial_trace!
— Functionpartial_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.
FermionicHilbertSpaces.partial_trace
— Methodpartial_trace(m::AbstractMatrix, bHfull::AbstractHilbertSpace, Hsub::AbstractHilbertSpace)
Compute the partial trace of a matrix m
, leaving the subsystem defined by the basis bsub
.
FermionicHilbertSpaces.removefermion
— Methodremovefermion(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.subregion
— Methodsubregion(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
— Functiontensor_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
.
FermionicHilbertSpaces.tensor_product
— Methodtensor_product(Hs)
Compute the tensorproduct product hilbert spaces Hs
. The symmetry of the resulting basis is computed by promotesymmetry.
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 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
.
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 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
.