ExactDiagonalization

Quantum numbers

Quantum numbers can be considered as the conserved labels for the bases of a Hilbert space when a quantum system hosts some symmetries. Here we only implement Abelian quantum numbers because non-Abelian ones are far more complicated yet much less used.

AbelianQuantumNumber

RepresentationSpace

Core of ExactDiagonalization

BinaryBases

AbelianBases

Manual

ExactDiagonalization.basicoptionsConstant
const basicoptions = (
    nev = "number of eigenvalues to be computed",
    which = "type of eigenvalues to be computed",
    tol = "tolerance of the computation",
    maxiter = "maximum iteration of the computation",
    v₀ = "initial state",
    krylovdim = "maximum dimension of the Krylov subspace that will be constructed",
    verbosity = "verbosity level"
)

Basic options of actions for exact diagonalization method.

source
ExactDiagonalization.AbelianBasesType
AbelianBases{A<:Abelian, N} <: Sector

A set of Abelian bases, that is, a set of bases composed from the product of local Abelian Graded spaces.

To improve the efficiency of the product of local Abelian Graded spaces, we adopt a two-step strategy:

  1. partition the local spaces into several groups in each of which the local spaces are direct producted and rearranged according to the Abelian quantum numbers, and then
  2. glue the results obtained in the previous step so that a sector with a certain Abelian quantum number can be targeted.

In principle, a binary-tree strategy can be more efficient, but our two-step strategy is enough for a quantum system that can be solved by the exact diagonalization method.

The partition of the local Abelian Graded spaces is assigned by a NTuple{N, Vector{Int}}, with each of its element contains the sequences of the grouped local spaces specified by a table.

source
ExactDiagonalization.AbelianBasesMethod
AbelianBases(locals::AbstractVector{Int}, partition::NTuple{N, AbstractVector{Int}}=partition(length(locals))) where N

Construct a set of spin bases that subjects to no quantum number conservation.

source
ExactDiagonalization.AbelianBasesMethod
AbelianBases(locals::Vector{Graded{A}}, quantumnumber::A, partition::NTuple{N, AbstractVector{Int}}=partition(length(locals))) where {N, A<:Abelian}

Construct a set of spin bases that preserves a certain symmetry specified by the corresponding Abelian quantum number.

source
ExactDiagonalization.AbelianGradedSpaceType
AbelianGradedSpace(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimensions::AbstractVector{<:Integer}, dual::Bool=false; ordercheck::Bool=false, duplicatecheck::Bool=false, degeneracycheck::Bool=false)

Construct an Abelian graded space.

Here:

  • quantumnumbers specifies the Abelian quantum numbers labeling the irreducible representations of the corresponding Abelian group which must be sorted in the ascending order. Such an ordering should be manually guaranteed by the user. When and only when the keyword argument ordercheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't. Besides, quantumnumbers must not contain duplicate Abelian quantum numbers, manually guaranteed by the user as well. This condition can be checked when and only when both ordercheck==true and duplicatecheck==true. An error will be raised if this check fails.
  • dimensions specifies the degenerate dimensions of the corresponding Abelian quantum numbers. Apparently, each degenerate dimension must be positive, which should also be manually guaranteed by the user. When and only when the keyword argument degeneracycheck is true, the constructor will check whether this condition is satisfied and raise an error if it doesn't.
  • dual specifies whether the graded space is the dual representation of the corresponding Abelian group, which roughly speaking, can be viewed as the direction of the arrow of the Abelian quantum numbers labeling the irreducible representations. We assume dual==true corresponds to the in-arrow and dual==false corresponds to the out-arrow.
source
ExactDiagonalization.AbelianGradedSpaceType
AbelianGradedSpace{QN<:AbelianQuantumNumber} <: RepresentationSpace{QN}

A quantum representation space of an Abelian group that has been decomposed into the direct sum of its irreducible representations.

source
ExactDiagonalization.AbelianGradedSpaceMethod
AbelianGradedSpace(pairs; dual::Bool=false)
AbelianGradedSpace(pairs::Pair...; dual::Bool=false)
AbelianGradedSpace{QN}(pairs; dual::Bool=false) where {QN<:AbelianQuantumNumber}
AbelianGradedSpace{QN}(pairs::Pair...; dual::Bool=false) where {QN<:AbelianQuantumNumber}

Construct an Abelian graded space.

In this function, the Abelian quantum numbers will be sorted automatically, therefore, their orders need not be worried. Duplicate and dimension checks of the quantum numbers are also carried out and errors will be raised if either such checks fails.

source
ExactDiagonalization.AbelianQuantumNumberType
AbelianQuantumNumber

Abstract type of Abelian quantum numbers.

An Abelian quantum number is the label of a irreducible representation of an Abelian group acted on a quantum representation space.

source
ExactDiagonalization.AbelianQuantumNumberProdMethod
AbelianQuantumNumberProd(contents::SimpleAbelianQuantumNumber...)
AbelianQuantumNumberProd(contents::Tuple{Vararg{SimpleAbelianQuantumNumber}})

Construct a Deligne tensor product of simple Abelian quantum numbers.

source
ExactDiagonalization.AbelianQuantumNumberProdMethod
AbelianQuantumNumberProd{T}(vs::Vararg{Number, N}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}
AbelianQuantumNumberProd{T}(vs::NTuple{N, Number}) where {N, T<:NTuple{N, SimpleAbelianQuantumNumber}}

Construct a Deligne tensor product of simple Abelian quantum numbers by their values.

source
ExactDiagonalization.AbstractGreenFunctionMethod
(gf::AbstractGreenFunction)(ω::Number; sign::Bool=false) -> Matrix{promote_type(typeof(ω), eltype(gf))}

Get the values of an AbstractGreenFunction at ω.

When sign is true, the opposite will be taken in the result.

source
ExactDiagonalization.BinaryBasesMethod
BinaryBases(spindws, spinups, spinfulparticle::Abelian[ℕ ⊠ 𝕊ᶻ])
BinaryBases(spindws, spinups, spinfulparticle::Abelian[𝕊ᶻ ⊠ ℕ])

Construct a set of binary bases that preserves both the particle number and the spin z-component conservation.

source
ExactDiagonalization.BinaryBasesMethod
BinaryBases(spindws, spinups, sz::𝕊ᶻ)

Construct a set of binary bases that preserves the spin z-component but not the particle number conservation.

source
ExactDiagonalization.BinaryBasesMethod
BinaryBases(states, particle::ℕ)
BinaryBases(nstate::Integer, particle::ℕ)

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

source
ExactDiagonalization.BinaryBasisType
BinaryBasis{I<:Unsigned}

Binary basis represented by an unsigned integer.

Here, we adopt the following common rules:

  1. In a binary basis, a bit of an unsigned integer represents a single-particle state that can be occupied (1) or unoccupied (0).
  2. The position of this bit in the unsigned integer counting from the right corresponds to the sequence of the single-particle state specified by a table.
  3. When representing a many-body state by creation operators, they are arranged in ascending order according to their sequences.

In this way, any many-body state of canonical fermionic or hardcore bosonic systems can be represented ambiguously by the binary bases, e.g., $c^†_2c^†_3c^†_4|\text{Vacuum}\rangle$ is represented by $1110$.

source
ExactDiagonalization.BinaryBasisMethod
BinaryBasis(states; filter=index->true)
BinaryBasis{I}(states; filter=index->true) where {I<:Unsigned}

Construct a binary basis with the given occupied states.

source
ExactDiagonalization.EDType
ED(
    lattice::AbstractLattice, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain, dtype::Type{<:Number}=valtype(terms);
    neighbors::Union{Int, Neighbors}=nneighbor(terms)
)
ED(
    lattice::AbstractLattice, hilbert::Hilbert, terms::OneOrMore{Term}, table::AbstractDict, sectors::OneOrMore{Sector}=Sector(hilbert; table=table), boundary::Boundary=plain, dtype::Type{<:Number}=valtype(terms);
    neighbors::Union{Int, Neighbors}=nneighbor(terms)
)

Construct the exact diagonalization method for a quantum lattice system.

source
ExactDiagonalization.EDType
ED(system::Generator{<:Operators}, table::AbstractDict, sectors::OneOrMore{Sector}, dtype::Type{<:Number}=scalartype(system))
ED(lattice::Union{AbstractLattice, Nothing}, system::Generator{<:Operators}, table::AbstractDict, sectors::OneOrMore{Sector}, dtype::Type{<:Number}=scalartype(system))

Construct the exact diagonalization method for a quantum lattice system.

source
ExactDiagonalization.EDType
ED(
    lattice::AbstractLattice, hilbert::Hilbert, terms::OneOrMore{Term}, quantumnumbers::OneOrMore{Abelian}, boundary::Boundary=plain, dtype::Type{<:Number}=valtype(terms);
    neighbors::Union{Int, Neighbors}=nneighbor(terms)
)
ED(
    lattice::AbstractLattice, hilbert::Hilbert, terms::OneOrMore{Term}, table::AbstractDict, quantumnumbers::OneOrMore{Abelian}, boundary::Boundary=plain, dtype::Type{<:Number}=valtype(terms);
    neighbors::Union{Int, Neighbors}=nneighbor(terms)
)

Construct the exact diagonalization method for a quantum lattice system.

source
ExactDiagonalization.EDType
ED{K<:EDKind, L<:Union{AbstractLattice, Nothing}, S<:Generator{<:Operators}, M<:EDMatrixization, H<:CategorizedGenerator{<:OperatorSum{<:EDMatrix}}} <: Frontend

Exact diagonalization method of a quantum lattice system.

source
ExactDiagonalization.EDEigenDataType
EDEigenData{V<:Number, T<:Number, S<:Sector} <: Data

Eigen decomposition in exact diagonalization method.

Compared to the usual eigen decomposition Eigen, EDEigenData contains a :sectors attribute to store the sectors of Hilbert space in which the eigen values and eigen vectors are computed. Furthermore, given that in different sectors the dimensions of the sub-Hilbert spaces can also be different, the :vectors attribute of EDEigenData is a vector of vector instead of a matrix.

source
ExactDiagonalization.EDMatrixType
EDMatrix{M<:SparseMatrixCSC, S<:Sector} <: OperatorPack{M, Tuple{S, S}}

Matrix representation of quantum operators between a ket Hilbert space and a bra Hilbert space.

source
ExactDiagonalization.EDMatrixMethod
EDMatrix(m::SparseMatrixCSC, sector::Sector)
EDMatrix(m::SparseMatrixCSC, braket::NTuple{2, Sector})
EDMatrix(m::SparseMatrixCSC, bra::Sector, ket::Sector)

Construct a matrix representation when

  1. the bra and ket Hilbert spaces share the same bases;
  2. the bra and ket Hilbert spaces may be different;
  3. the bra and ket Hilbert spaces may or may not be the same.
source
ExactDiagonalization.EDMatrixizationMethod
EDMatrixization{D}(table::AbstractDict, sector::S, sectors::S...) where {D<:Number, S<:Sector}
EDMatrixization{D}(table::AbstractDict, brakets::Vector{Tuple{S, S}}) where {D<:Number, S<:Sector}

Construct a matrixization.

source
ExactDiagonalization.GradedMethod
Graded{ℤ₁}(spin::Spin)
Graded{𝕊ᶻ}(spin::Spin)

Decompose a local spin space into an Abelian graded space that preserves 1) no symmetry, and 2) spin-z component symmetry.

source
ExactDiagonalization.GreenFunctionType
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::Algorithm{<:ED}, sign::Bool=false;
    E₀::Union{Real, Nothing}=nothing, Ω::Union{AbstractVector{<:Number}, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, maxdim::Integer=200, kwargs...
)
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::ED, sign::Bool=false;
    E₀::Union{Real, Nothing}=nothing, Ω::Union{AbstractVector{<:Number}, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, maxdim::Integer=200, timer::TimerOutput=edtimer, kwargs...
)

Construct a GreenFunction.

source
ExactDiagonalization.GreenFunctionMethod
(gf::GreenFunction)(dest::AbstractMatrix{<:Number}, ω::Number; sign::Bool=false) -> typeof(dest)

Get the values of a GreenFunction at ω and add the result to dest.

source
ExactDiagonalization.RetardedGreenFunctionMethod
RetardedGreenFunction(operators::AbstractVector{<:QuantumOperator}, ed::Algorithm{<:ED}, sign::Bool; maxdim::Integer=200, kwargs...)
RetardedGreenFunction(operators::AbstractVector{<:QuantumOperator}, ed::ED, sign; maxdim::Integer=200, timer::TimerOutput=edtimer, kwargs...)

Construct a RetardedGreenFunction.

source
ExactDiagonalization.SectorType
Sector(hilbert::Hilbert{<:Spin}, partition::Tuple{Vararg{AbstractVector{Int}}}=partition(length(hilbert))) -> AbelianBases
Sector(
    quantumnumber::Abelian, hilbert::Hilbert{<:Spin}, partition::Tuple{Vararg{AbstractVector{Int}}}=partition(length(hilbert));
    table::AbstractDict=Table(hilbert, Metric(EDKind(hilbert), hilbert))
) -> AbelianBases

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

source
ExactDiagonalization.SectorType
Sector

A sector of the Hilbert space which forms the bases of an irreducible representation of the Hamiltonian of a quantum lattice system.

source
ExactDiagonalization.SectorType
Sector(hilbert::Hilbert{<:Fock}, basistype::Type{<:Unsigned}=UInt) -> BinaryBases
Sector(quantumnumber::ℕ, hilbert::Hilbert{<:Fock}, basistype::Type{<:Unsigned}=UInt; table::AbstractDict=Table(hilbert, Metric(EDKind(hilbert), hilbert))) -> BinaryBases
Sector(quantumnumber::Union{𝕊ᶻ, Abelian[ℕ ⊠ 𝕊ᶻ], Abelian[𝕊ᶻ ⊠ ℕ]}, hilbert::Hilbert{<:Fock}, basistype::Type{<:Unsigned}=UInt; table::AbstractDict=Table(hilbert, Metric(EDKind(hilbert), hilbert))) -> BinaryBases

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

source
ExactDiagonalization.SpinCoherentStateType
(state::SpinCoherentState)(bases::AbelianBases, table::AbstractDict, dtype=ComplexF64) -> Vector{dtype}

Get the vector representation of a spin coherent state with the given Abelian bases and table.

source
ExactDiagonalization.SpinCoherentStateType
SpinCoherentState <: CompositeDict{Int, Tuple{Float64, Float64}}

Spin coherent state on a block of lattice sites.

The structure of the spin coherent state is specified by a Dict{Int, Tuple{Float64, Float64}}, which contains the site-(θ, ϕ) pairs with site being the site index in a lattice and (θ, ϕ) denoting the polar and azimuth angles in radians of the classical magnetic moment on this site.

source
ExactDiagonalization.SpinCoherentStateMethod
SpinCoherentState(structure::AbstractDict{Int, <:AbstractVector{<:Number}})
SpinCoherentState(structure::AbstractDict{Int, <:NTuple{2, Number}}; unit::Symbol=:radian)

Construct a spin coherent state on a block of lattice sites.

source
ExactDiagonalization.SpinCoherentStateProjectionMethod
SpinCoherentStateProjection(configuration::SpinCoherentState, polars::AbstractVector{<:Real}, azimuths::AbstractVector{<:Real})
SpinCoherentStateProjection(configuration::SpinCoherentState, np::Integer, na::Integer)

Construct a SpinCoherentStateProjection.

source
ExactDiagonalization.SpinCoherentStateProjectionDataType
SpinCoherentStateProjectionData <: Data

Data of spin coherent state projection, including:

  1. polars::Vector{Float64}: global polar angles of the spin coherent states.
  2. azimuths::Vector{Float64}: global azimuth angles of the spin coherent states.
  3. values::Matrix{Float64}: projection of the state obtained by exact diagonalization method onto the spin coherent states.
source
ExactDiagonalization.StaticTwoPointCorrelatorDataType
StaticTwoPointCorrelatorData{R<:ReciprocalSpace, V<:Array{Float64}} <: Data

Data of static two-point correlation function, including:

  1. reciprocalspace::R: reciprocal space to compute the static two-point correlation function.
  2. values::V: values of the static two-point correlation function.
source
QuantumLattices.QuantumSystems.FockIndexMethod
(index::FockIndex)(quantumnumber::ℤ₁) -> ℤ₁
(index::FockIndex)(quantumnumber::ℕ) -> ℕ
(index::FockIndex)(quantumnumber::𝕊ᶻ) -> 𝕊ᶻ
(index::FockIndex)(quantumnumber::(ℕ ⊠ 𝕊ᶻ)) -> ℕ ⊠ 𝕊ᶻ
(index::FockIndex)(quantumnumber::(𝕊ᶻ ⊠ ℕ)) -> 𝕊ᶻ ⊠ ℕ

Get the resulting Abelian quantum number after a FockIndex acts upon an initial Abelian quantum number.

source
Base.:+Method
+(qn::AbelianQuantumNumber) -> typeof(qn)

Overloaded + operator for AbelianQuantumNumber.

source
Base.:+Method
+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:AbelianQuantumNumberProd} -> QN

Overloaded + operator for AbelianQuantumNumberProd.

Note

To ensure type stability, two AbelianQuantumNumberProd can be added together if and only if they are of the same type.

source
Base.:+Method
+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:SimpleAbelianQuantumNumber} -> QN

Overloaded + operator for SimpleAbelianQuantumNumber.

Note

To ensure type stability, two SimpleAbelianQuantumNumber can be added together if and only if they are of the same type.

source
Base.:-Method
-(qn::AbelianQuantumNumberProd) -> typeof(qn)
-(qn₁::QN, qn₂::QN) where {QN<:AbelianQuantumNumberProd} -> QN

Overloaded - operator for AbelianQuantumNumberProd.

Note

To ensure type stability, a AbelianQuantumNumberProd can be subtracted by another AbelianQuantumNumberProd if and only if they are of the same type.

source
Base.:-Method
-(qn::SimpleAbelianQuantumNumber) -> typeof(qn)
-(qn₁::QN, qn₂::QN) where {QN<:SimpleAbelianQuantumNumber} -> QN

Overloaded - operator for SimpleAbelianQuantumNumber.

Note

To ensure type stability, a SimpleAbelianQuantumNumber can be subtracted by another SimpleAbelianQuantumNumber if and only if they are of the same type.

source
Base.Broadcast.broadcastMethod
broadcast(::Type{Sector}, quantumnumbers::OneAtLeast{Abelian}, hilbert::Hilbert, args...; table::AbstractDict=Table(hilbert, Metric(EDKind(hilbert), hilbert))) -> NTuple{fieldcount(typeof(quantumnumbers)), Sector}

Construct a set of sectors based on the quantum numbers and a Hilbert space.

source
Base.Broadcast.broadcastMethod
broadcast(
    ::Type{Sector}, quantumnumbers::OneAtLeast{Abelian}, hilbert::Hilbert{<:Spin}, partition::NTuple{N, AbstractVector{Int}}=partition(length(hilbert));
    table::AbstractDict=Table(hilbert, Metric(EDKind(hilbert), hilbert))
) where N -> NTuple{fieldcount(typeof(quantumnumbers)), AbelianBases}

Construct a set of Abelian based based on the quantum numbers and a Hilbert space.

source
Base.adjointMethod
adjoint(gs::AbelianGradedSpace) -> typeof(gs)

Get the dual of an Abelian graded space.

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

Count the number of occupied single-particle states for a binary basis.

source
Base.countMethod
count(data::EDEigenData) -> Int

Count the number of eigen value-vector-sector groups contained in an EDEigenData.

source
Base.cumsumMethod
cumsum(rs::RepresentationSpace, i::Union{Integer, CartesianIndex}) -> Int

Get the accumulative degenerate dimension up to the ith Abelian quantum number contained in a representation space.

source
Base.cumsumMethod
cumsum(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int

Get the accumulative dimension of an Abelian graded space up to a certain Abelian quantum number contained in an Abelian graded space.

source
Base.eltypeMethod
eltype(gf::AbstractGreenFunction)
eltype(::Type{<:AbstractGreenFunction{T}}) where {T<:Number}

Get the eltype of an AbstractGreenFunction.

source
Base.getindexMethod
getindex(gs::AbelianGradedSpace, indexes::AbstractVector{<:Integer}) -> typeof(gs)
getindex(gs::AbelianGradedSpace{QN}, quantumnumbers::AbstractVector{QN}) where {QN<:AbelianQuantumNumber} -> AbelianGradedSpace{QN}

Get a subset of an Abelian graded space.

source
Base.getindexMethod
getindex(gs::AbelianGradedSpace, i::Union{Integer, CartesianIndex})

Get the ith Abelian quantum number contained in an Abelian graded space.

source
Base.getindexMethod
getindex(qn::AbelianQuantumNumberProd, i::Integer) -> SimpleAbelianQuantumNumber

Get the ith simple Abelian quantum number in a Deligne tensor product.

source
Base.getindexMethod
getindex(::Type{Abelian}, ::Type{T}) where {T<:AbelianQuantumNumber} -> Type{T}

Overloaded [] for Abelian, i.e., the support of syntax Abelian[T] where T<:AbelianQuantumNumber, which is helpful for the construction of tensor producted Abelian quantum numbers.

source
Base.inMethod
in(qn::QN, gs::AbelianGradedSpace{QN}) where {QN<:AbelianQuantumNumber} -> Bool

Check whether an Abelian quantum number is contained in an Abelian graded space.

source
Base.invFunction
inv(qn::AbelianQuantumNumber, bool::Bool=true) -> typeof(qn)

Get the inverse of an Abelian quantum number qn if bool is true. Otherwise, return qn itself.

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

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

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

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

source
Base.iterateFunction
iterate(basis::BinaryBasis)
iterate(basis::BinaryBasis, state)

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

source
Base.lengthMethod
length(gs::AbelianGradedSpace) -> Int

Get the number of inequivalent irreducible representations (i.e., the Abelian quantum numbers) of an Abelian graded space.

source
Base.lengthMethod
length(qn::AbelianQuantumNumberProd) -> Int

Get the length of a Deligne tensor product.

source
Base.matchMethod
match(sector₁::Sector, sector₂::Sector) -> Bool

Judge whether two sectors match each other, that is, whether they can be used together as the bra and ket spaces.

source
Base.mergeMethod
merge(rs::AbelianGradedSpaceProd) -> Tuple{AbelianGradedSpace{eltype(rs)}, Dict{eltype(rs), Vector{NTuple{rank(rs), eltype(rs)}}}}

Get the decomposition of the direct product of several Abelian graded spaces and its corresponding fusion processes.

For a set of Abelian graded spaces (gs₁, gs₂, ...), their direct product space can contain several equivalent irreducible representations because for different sets of Abelian quantum numbers (qn₁, qn₂, ...) where qnᵢ∈gsᵢ, the fusion, i.e., ⊗(qn₁, qn₂, ...) may give the same result qn. This function returns the decomposition of the direct product of (gs₁, gs₂, ...) as well as all the fusion processes of each quantum number contained in the decomposition.

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

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

source
Base.pairsMethod
pairs(rs::RepresentationSpace, ::typeof(dimension)) -> RepresentationSpacePairs
pairs(rs::RepresentationSpace, ::typeof(range)) -> RepresentationSpacePairs

Return an iterator that iterates over the pairs of the Abelian quantum numbers and their corresponding (slices of the) degenerate dimensions contained in a representation space.

source
Base.rangeMethod
range(bs::AbelianBases) -> AbstractVector{Int}

Get the range of the target sector of an AbelianBases in the direct producted bases.

source
Base.rangeMethod
range(gs::AbelianGradedSpace, qn::Union{Integer, CartesianIndex}) -> UnitRange{Int}
range(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> UnitRange{Int}

Get the slice of the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceProd, i::Union{Integer, CartesianIndex}) -> AbstractVector{Int}

Get the slice of the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceSum, i::Union{Integer, CartesianIndex}) -> UnitRange{Int}

Get the slice of the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.

source
Base.rangeMethod
range(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> AbstractVector{Int}

Get the slice of the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.

source
Base.sizeMethod
size(gf::AbstractGreenFunction) -> NTuple{2, Int}

Get the size of an AbstractGreenFunction.

source
Base.splitMethod
split(target::QN, rs::AbelianGradedSpaceProd{N, QN}; nmax::Real=20) where {N, QN<:AbelianQuantumNumber} -> Set{NTuple{N, QN}}

Find a set of splittings of the target Abelian quantum number with respect to the direct product of several Abelian graded spaces.

source
Base.valuesMethod
values(qn::AbelianQuantumNumberProd) -> NTuple{rank(qn), Number}

Get the values of the simple Abelian quantum numbers in a Deligne tensor product.

source
Base.valuesMethod
values(qn::SimpleAbelianQuantumNumber) -> Tuple{Number}

Get the value of a simple Abelian quantum number and return it as the sole element of a tuple.

source
Base.zeroMethod
zero(qn::AbelianQuantumNumber) -> typeof(qn)
zero(::Type{QN}) where {QN<:AbelianQuantumNumber} -> QN

Get the zero Abelian quantum number.

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

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

source
ExactDiagonalization.:⊠Method
⊠(bs::BinaryBases, another::Abelian) -> BinaryBases
⊠(another::Abelian, bs::BinaryBases) -> BinaryBases

Deligne tensor product the quantum number of a set of binary bases with another quantum number.

source
ExactDiagonalization.:⊠Method
⊠(qn::SimpleAbelianQuantumNumber, qns::SimpleAbelianQuantumNumber...) -> AbelianQuantumNumberProd
⊠(qn₁::SimpleAbelianQuantumNumber, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd
⊠(qn₁::AbelianQuantumNumberProd, qn₂::SimpleAbelianQuantumNumber) -> AbelianQuantumNumberProd
⊠(qn₁::AbelianQuantumNumberProd, qn₂::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd

Deligne tensor product of Abelian quantum numbers.

source
ExactDiagonalization.:⊠Method
⊠(QN::Type{<:SimpleAbelianQuantumNumber}, QNS::Type{<:SimpleAbelianQuantumNumber}...) -> Type{AbelianQuantumNumberProd{Tuple{QN, QNS...}}}
⊠(::Type{QN}, ::Type{AbelianQuantumNumberProd{T}}) where {QN<:SimpleAbelianQuantumNumber, T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{QN, fieldtypes(T)...}}}
⊠(::Type{AbelianQuantumNumberProd{T}}, ::Type{QN}) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, QN<:SimpleAbelianQuantumNumber} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T)...}, QN}}
⊠(::Type{AbelianQuantumNumberProd{T₁}}, ::Type{AbelianQuantumNumberProd{T₂}}) where {T₁<:Tuple{Vararg{SimpleAbelianQuantumNumber}}, T₂<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Type{AbelianQuantumNumberProd{Tuple{fieldtypes(T₁)..., fieldtypes(T₂)...}}}

Deligne tensor product of Abelian quantum numbers.

source
ExactDiagonalization.basistypeMethod
basistype(i::Integer)
basistype(::Type{I}) where {I<:Integer}

Get the binary basis type corresponding to an integer or a type of an integer.

source
ExactDiagonalization.findindexMethod
findindex(position::Integer, gs::AbelianGradedSpace, guess::Integer) -> Int

Find the index of an Abelian quantum number in an Abelian graded space beginning at guess whose position in the complete dimension range is position.

source
ExactDiagonalization.prepare!Method
prepare!(ed::ED; timer::TimerOutput=edtimer) -> ED
prepare!(ed::Algorithm{<:ED}) -> Algorithm{<:ED}

Prepare the matrix representation.

source
ExactDiagonalization.regularize!Method
regularize!(quantumnumbers::Vector{<:AbelianQuantumNumber}, dimensions::Vector{Int}; check::Bool=false) -> Tuple{typeof(quantumnumbers), typeof(dimensions), Vector{Int}}

In place regularization of the input Abelian quantum numbers and their corresponding degenerate dimensions.

After the regularization, the Abelian quantum numbers will be sorted in the ascending order and duplicates will be merged together. The degenerate dimensions will be processed accordingly. When check is true, this function also check whether all input degenerate dimensions are positive. The regularized Abelian quantum numbers and degenerate dimensions, as well as the permutation vector that sorts the input Abelian quantum numbers, will be returned.

source
ExactDiagonalization.regularizeMethod
regularize(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimension::AbstractVector{<:Integer}; check::Bool=false) -> Tuple{Vector{eltype(quantumnumbers)}, Vector{Int}, Vector{Int}}

Regularize of the input Abelian quantum numbers and their corresponding degenerate dimensions.

See regularize!.

source
ExactDiagonalization.release!Method
release!(ed::ED; gc::Bool=true) -> ED
release!(ed::Algorithm{<:ED}; gc::Bool=true) -> Algorithm{<:ED}

Release the memory source used in preparing the matrix representation. If gc is true, call the garbage collection immediately.

source
LinearAlgebra.eigenMethod
eigen(ed::ED, sectors::Union{Abelian, Sector}...; timer::TimerOutput=edtimer, release::Bool=false, kwargs...) -> EDEigenData
eigen(ed::Algorithm{<:ED}, sectors::Union{Abelian, Sector}...; release::Bool=false, kwargs...) -> EDEigenData

Solve the eigen problem by the restarted Lanczos method provided by the Arpack package.

source
LinearAlgebra.eigenMethod
eigen(m::EDMatrix; nev::Int=1, which::Symbol=:SR, tol::Real=1e-12, maxiter::Int=300, v₀::Union{AbstractVector{<:Number}, Int}=dimension(m.bra), krylovdim::Int=max(20, 2*nev+1), verbosity::Int=0) -> EDEigenData

Solve the eigen problem by the restarted Lanczos method provided by the KrylovKit package.

source
LinearAlgebra.eigenMethod
eigen(
    ms::OperatorSum{<:EDMatrix};
    nev::Int=1,
    which::Symbol=:SR,
    tol::Real=1e-12,
    maxiter::Int=300,
    v₀::Union{Dict{<:Abelian, <:Union{AbstractVector{<:Number}, Int}}, Dict{<:Sector, <:Union{AbstractVector{<:Number}, Int}}}=Dict(Abelian(m.ket)=>dimension(m.ket) for m in ms),
    krylovdim::Int=max(20, 2*nev+1),
    verbosity::Int=0,
    timer::TimerOutput=edtimer
) -> EDEigenData

Solve the eigen problem by the restarted Lanczos method provided by the Arpack package.

source
LinearAlgebra.rankMethod
rank(qn::AbelianQuantumNumberProd) -> Int
rank(::Type{<:AbelianQuantumNumberProd}) -> Int

Get the rank of a Deligne tensor product of simple Abelian quantum numbers.

source
LinearAlgebra.rankMethod
rank(rs::CompositeAbelianGradedSpace) -> Int
rank(::Type{<:CompositeAbelianGradedSpace{N}}) where N -> Int

Get the number of Abelian graded spaces in the direct sum.

source
QuantumLattices.:⊕Method
⊕(gs::AbelianGradedSpace, gses::AbelianGradedSpace...) -> AbelianGradedSpaceSum
⊕(gs::AbelianGradedSpace, rs::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum
⊕(rs::AbelianGradedSpaceSum, gs::AbelianGradedSpace) -> AbelianGradedSpaceSum
⊕(rs₁::AbelianGradedSpaceSum, rs₂::AbelianGradedSpaceSum) -> AbelianGradedSpaceSum

Get the direct sum of some Abelian graded spaces.

source
QuantumLattices.:⊗Method
⊗(gs::AbelianGradedSpace, gses::AbelianGradedSpace...) -> AbelianGradedSpaceProd
⊗(gs::AbelianGradedSpace, rs::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd
⊗(rs::AbelianGradedSpaceProd, gs::AbelianGradedSpace) -> AbelianGradedSpaceProd
⊗(rs₁::AbelianGradedSpaceProd, rs₂::AbelianGradedSpaceProd) -> AbelianGradedSpaceProd

Get the direct product of some Abelian graded spaces.

source
QuantumLattices.:⊗Method
⊗(qn::AbelianQuantumNumber, qns::AbelianQuantumNumber...) -> eltype(qns)

Get the direct product of some AbelianQuantumNumbers.

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

Get the direct product of two sets of binary bases.

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

Get the direct product of two binary bases.

source
QuantumLattices.QuantumOperators.matrixFunction
matrix(ops::Operators, braket::NTuple{2, Sector}, table::AbstractDict, dtype=scalartype(ops)) -> SparseMatrixCSC{dtype, Int}

Get the CSC-formed sparse matrix representation of a set of operators.

Here, table specifies the order of the operator indexes.

source
QuantumLattices.QuantumOperators.matrixFunction
matrix(index::OperatorIndex, graded::Graded, dtype::Type{<:Number}=ComplexF64) -> Matrix{dtype}

Get the matrix representation of an OperatorIndex on an Abelian graded space.

source
QuantumLattices.QuantumOperators.matrixMethod
matrix(ed::ED, sectors::Union{Abelian, Sector}...; timer::TimerOutput=edtimer, release::Bool=false) -> OperatorSum{<:EDMatrix}
matrix(ed::Algorithm{<:ED}, sectors::Union{Abelian, Sector}...; release::Bool=false) -> OperatorSum{<:EDMatrix}

Get the sparse matrix representation of a quantum lattice system in the target space.

source
QuantumLattices.QuantumOperators.matrixMethod
matrix(op::Operator{V, <:OneAtLeast{OperatorIndex}}, braket::NTuple{2, AbelianBases}, table::AbstractDict, dtype=V) where V -> SparseMatrixCSC{dtype, Int}

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

Here, table specifies the order of the operator indexes.

source
QuantumLattices.QuantumOperators.matrixMethod
matrix(op::Operator{V, <:OneAtLeast{OperatorIndex}}, braket::NTuple{2, BinaryBases}, table::AbstractDict, dtype=V) where V -> SparseMatrixCSC{dtype, Int}

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

Here, table specifies the order of the operator indexes.

source
QuantumLattices.QuantumOperators.matrixMethod
matrix(op::Operator{V, Tuple{}}, braket::NTuple{2, Sector}, table::AbstractDict, dtype=V) where V -> SparseMatrixCSC{V, Int}

Get the CSC-formed sparse matrix representation of a scalar operator.

source
QuantumLattices.Spatials.periodMethod
period(qn::AbelianQuantumNumberProd, i::Integer) -> Number
period(::Type{AbelianQuantumNumberProd{T}}, i::Integer) where {T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} -> Number

Get the period of the ith simple Abelian number contained in a Deligne tensor product.

source
QuantumLattices.Spatials.periodMethod
period(qn::SimpleAbelianQuantumNumber) -> Number
period(::Type{QN}) where {QN<:SimpleAbelianQuantumNumber} -> Number

Get the period of a simple Abelian quantum number.

source
QuantumLattices.Spatials.periodsMethod
periods(qn::AbelianQuantumNumber) -> Tuple{Vararg{Number}}
periods(::Type{QN}) where {QN<:AbelianQuantumNumber} -> Tuple{Vararg{Number}}

Get the periods of Abelian quantum numbers.

source
QuantumLattices.decomposeMethod
decompose(rs::CompositeAbelianGradedSpace; expand::Bool=true) -> Tuple{AbelianGradedSpace{eltype(rs)}, Vector{Int}}

Decompose a composite of several Abelian graded spaces to the canonical one.

When expand is false, the corresponding permutation vector that sorts the Abelian quantum numbers will be returned as well. When expand is true, the expanded dimension indexes of the permutation vector that sorts the Abelian quantum numbers will be returned as well.

source
QuantumLattices.dimensionMethod
dimension(gs::AbelianGradedSpace, qn::Union{Integer, CartesianIndex}) -> Int
dimension(gs::AbelianGradedSpace{QN}, qn::QN) where {QN<:AbelianQuantumNumber} -> Int

Get the degenerate dimension of an Abelian quantum number contained in an Abelian graded space.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd, i::Union{Integer, CartesianIndex}) -> Int

Get the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd) -> Int

Get the total dimension of the direct product of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceSum, i::Union{Integer, CartesianIndex}) -> Int

Get the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceSum) -> Int

Get the total dimension of the direct sum of several Abelian graded spaces.

source
QuantumLattices.dimensionMethod
dimension(rs::AbelianGradedSpaceProd{N, QN}, qns::NTuple{N, QN}) where {N, QN<:AbelianQuantumNumber} -> Int

Get the degenerate dimension of the Abelian quantum number fused by qns in the direct product of several Abelian graded spaces.

source
QuantumLattices.reset!Method
reset!(
    gf::GreenFunction, H::AbstractMatrix{<:Number}, V::AbstractVector{AbstractVector{<:Number}}, E₀::Real;
    ranks::AbstractVector{<:Integer}=1:rank(gf), dimensions::AbstractVector{<:Integer}=1:dimension(gf)
) -> typeof(gf)

Reset (a block) of GreenFunction.

source
QuantumLattices.valueMethod
value(qn::AbelianQuantumNumberProd, i::Integer) -> Number

Get the value of the ith simple Abelian quantum number in a Deligne tensor product.

source