API
QuantumHamiltonianParticle.ParticleHilbertSpace — TypeParticleHilbertSpace{PS, BR, QN} <: AbstractHilbertSpace{QN}Particle Hilbert space.
Example
ParticleHilbertSpace([site1, site2, site3, site4])QuantumHamiltonianParticle.ParticleSite — TypeParticleSite{PS<:ParticleSector, BR<:Unsigned, QN<:Tuple{Vararg{<:AbstractQuantumNumber}}}Particle site.
Example
ParticleSite([state1, state2, state3, state4])QuantumHamiltonianParticle.ParticleState — TypeParticleState{PS, BR, QN}A state, represented by particle occupation.
QuantumHamiltonianParticle.ParticleState — MethodParticleState(::Type{PS}, name, occvec, ::Type{BR}=UInt)Create a particle state with no quantum number.
Arguments
PS: particle sectorname: name of the stateoccvec::AbstractVector{<:Integer}: occupation VectorBR: binary type
QuantumHamiltonianParticle.ParticleState — MethodParticleState(::Type{PS}, name, occvec, quantum_number, ::Type{BR}=UInt)Create a particle state
Arguments
PS: particle sectorname: name of the stateoccvec::AbstractVector{<:Integer}: occupation Vectorquantum_number: quantum number (tuple or integer)BR: binary type
QuantumHamiltonianParticle.Spin — TypeSpin{Species, N}Spin type. S⁺ is annihilation, and S⁻ is creation.
QuantumHamiltonian.bitoffset — Methodbitoffset(phs, iptl, isite)Get the bit offset of the particle iptl at site isite.
QuantumHamiltonian.bitwidth — Methodbitwidth(phs)Return number of bits needed to represent basis states of phs.
QuantumHamiltonian.compress — Methodcompress(hs, indexarray, [type])Return the binary representation of the basis state represented by indexarray, optionally in type type.
Arguments
hs::ParticleHilbertSpace{PS, BR, QN}indexarray::CartesianIndextype::Type{BR2}=BR
QuantumHamiltonian.extract — Methodextract(hs, occbin)Return the CartesianIndex representation of the basis state represented by occbin.
Arguments
hs::ParticleHilbertSpaceoccbin::Unsigned
QuantumHamiltonian.get_bitmask — Methodget_bitmask(phs, [iptl, isite])Get the bit mask for the particles iptl at sites isite. iptl or isite can either be integer, a vector of integers, or colon :. Bitwise or is taken over list of iptl.
QuantumHamiltonian.get_bitmask — Methodget_bitmask(phs, iptl, isite)Get the bit mask for the particles iptl at sites isite. iptl or isite can either be integer, a vector of integers, or colon (:). Bitwise or is taken over list of iptl.
QuantumHamiltonian.get_quantum_number — Methodget_quantum_number(phs, statevec)Get quantum number of the basis state statevec.
QuantumHamiltonian.get_quantum_number — Methodget_quantum_number(phs, bitrep)Get quantum number of the basis state bitrep.
QuantumHamiltonian.uncompress — Methoduncompress(hs, occbin)Return the CartesianIndex representation of the basis state represented by occbin.
Arguments
hs::ParticleHilbertSpaceoccbin::Unsigned
QuantumHamiltonianParticle.electron_system — Methodelectron_system()Create an electron particle sector and creation/annihilation operators. Returns (particle_sector, c, cdag).candcdagare functions that take site index and spin, e.g.c(3, :up),cdag(4, :↓)`
QuantumHamiltonianParticle.get_fermion_parity — Methodget_fermion_parity(phs, op, bvec)Get the fermion parity (0 or 1) for when op is applied to bvec.
QuantumHamiltonianParticle.get_fermion_parity — Methodget_fermion_parity(phs, op, bvec)Get the fermion parity (0 or 1) for when op is applied to bvec.
QuantumHamiltonianParticle.get_occupancy — Methodget_occupancy(phs, iptl, isite, bvec::Unsigned)Get occupancy of particle iptl at site isite for the given basis state bvec.
QuantumHamiltonianParticle.get_parity_bitmask — Methodget_parity_bitmask(phs, iptl, isite)Get parity bitmask (i.e. position of the Wigner-Jordan string). Nonzero only for fermions.
QuantumHamiltonianParticle.locvec2statevec — Methodlocvec2statevecparticles : Vector of (Vector of particle location)
Example
P S 1 2 3 4 5 = |0, e↓, e↑, m, m⟩
e↑ 0 0 1 0 0
e↓ 0 1 0 0 0 = c†(m,4) c†(m,5) c†(e↑,3) c†(e↓,2) |Ω⟩
m 0 0 0 1 1QuantumHamiltonianParticle.orbitalpermutation — MethodExample
orbitalpermutation(PS, :px => (:py, 1), :py => (:px, -1))QuantumHamiltonianParticle.set_occupancy — Methodset_occupancy(phs, iptl, isite, bvec::Unsigned, count)Set occupancy of particle iptl at site isite for the given basis state bvec to count.
QuantumHamiltonianParticle.set_occupancy — Methodset_occupancy(phs, iptl, isite, bvec::Unsigned, count)Set occupancy of particle iptl at site isite for the given basis state bvec to count.