# Canonical Fermionic and Hard-core Bosonic Systems

ExactDiagonalization.CanonicalFockSystems.BinaryBasesMethod
BinaryBases(states, nparticle::Integer)
BinaryBases(nstate::Integer, nparticle::Integer)
BinaryBases{A}(states, nparticle::Integer; kwargs...) where {A<:AbelianNumber}
BinaryBases{A}(nstate::Integer, nparticle::Integer; kwargs...) where {A<:AbelianNumber}

Construct a set of binary bases that preserves the particle number conservation.

ExactDiagonalization.CanonicalFockSystems.BinaryBasesMethod
BinaryBases(states)
BinaryBases(nstate::Integer)
BinaryBases{A}(states) where {A<:AbelianNumber}
BinaryBases{A}(nstate::Integer) where {A<:AbelianNumber}

Construct a set of binary bases that subject to no quantum number conservation.

ExactDiagonalization.EDCore.SectorType
Sector(hilbert::Hilbert{<:Fock}, basistype=UInt) -> BinaryBases
Sector(hilbert::Hilbert{<:Fock}, quantumnumber::ParticleNumber, basistype=UInt; table=Table(hilbert, Metric(EDKind(hilbert), hilbert))) -> BinaryBases
Sector(hilbert::Hilbert{<:Fock}, quantumnumber::SpinfulParticle, basistype=UInt; table=Table(hilbert, Metric(EDKind(hilbert), hilbert))) -> BinaryBases

Construct the binary bases of a Hilbert space with the specified quantum number.

ExactDiagonalization.EDCore.TargetSpaceType
TargetSpace(hilbert::Hilbert{<:Fock}, basistype=UInt)
TargetSpace(hilbert::Hilbert{<:Fock}, quantumnumbers::Union{AbelianNumber, Tuple{AbelianNumber, Vararg{AbelianNumber}}}, basistype=UInt; table=Table(hilbert, Metric(EDKind(hilbert), hilbert)))

Construct a target space from the total Hilbert space and the associated quantum numbers.

Base.countMethod
count(basis::BinaryBasis) -> Int
count(basis::BinaryBasis, start::Integer, stop::Integer) -> Int

Count the number of occupied single-particle states.

Base.isoneMethod
isone(basis::BinaryBasis, state::Integer) -> Bool

Judge whether the specified single-particle state is occupied for a basis.

Base.iszeroMethod
iszero(basis::BinaryBasis, state::Integer) -> Bool

Judge whether the specified single-particle state is unoccupied for a basis.

Base.iterateFunction
iterate(basis::BinaryBasis, state=nothing)

Iterate over the numbers of the occupied single-particle orbitals.

Base.oneMethod
one(basis::BinaryBasis, state::Integer) -> BinaryBasis

Get a new basis with the specified single-particle state occupied.

Base.zeroMethod
zero(basis::BinaryBasis, state::Integer) -> BinaryBasis

Get a new basis with the specified single-particle state unoccupied.

QuantumLattices.:⊗Method
⊗(bs₁::BinaryBases, bs₂::BinaryBases) -> BinaryBases

Get the direct product of two sets of binary bases.

QuantumLattices.:⊗Method
⊗(basis₁::BinaryBasis, basis₂::BinaryBasis) -> BinaryBasis

Get the direct product of two binary bases.

QuantumLattices.QuantumOperators.matrixFunction
matrix(op::Operator, braket::NTuple{2, BinaryBases}, table, dtype=valtype(op)) -> SparseMatrixCSC{dtype, Int}

Get the CSC-formed sparse matrix representation of an operator.

Here, table specifies the order of the operator ids.