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.basicoptions — Constant
const basicoptions = (
    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",
    release = "release or not the cache for the construction of the sparse matrix representation of the Hamiltonian"
)

Basic options of computation tasks for exact diagonalization method.

source
ExactDiagonalization.notimer — Constant
const notimer = TimerOutput()

Shared disabled timer for all exact diagonalization methods: the @timeit instrumentation against it is a no-op. It serves as the default timer of the parallel (ntasks>1) code paths, since TimerOutput is not thread-safe.

source
ExactDiagonalization.AbelianBases — Type
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 combined via direct product 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.AbelianBases — Method
AbelianBases(locals::AbstractVector{Int}, partition::NTuple{N, AbstractVector{Int}}=partition(length(locals))) where N

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

source
ExactDiagonalization.AbelianBases — Method
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.AbelianGradedSpace — Type
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.AbelianGradedSpace — Type
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.AbelianGradedSpace — Method
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.AbelianQuantumNumber — Type
AbelianQuantumNumber

Abstract type of Abelian quantum numbers.

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

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

Construct a Deligne tensor product of simple Abelian quantum numbers.

source
ExactDiagonalization.AbelianQuantumNumberProd — Method
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.BandLanczosMethod — Type
BandLanczosMethod(
    orthᵣ::Orthogonalizer=ModifiedGramSchmidt2(), orthₒ::Orthogonalizer=ModifiedGramSchmidt();
    tol::Real=2e-8, tolᵣ::Real=1e-8, keepvecs::Bool=true, maxdim::Integer=200, ntasks::Integer=1
)

Construct a BandLanczosMethod for computing the zero-temperature Green function.

  • orthᵣ: Orthogonalizer used in block_qr! for rank determination of initial and residual blocks.
  • orthₒ: Orthogonalizer used in block_reorthogonalize! for reorthogonalization against the Krylov basis during the Lanczos recurrence.
  • tol: Lanczos convergence tolerance — iteration stops when normres < tol.
  • tolᵣ: QR rank determination tolerance in block_qr! — a vector with norm < tolᵣ is considered numerically zero.
  • ntasks: number of parallel tasks over which the GreenFunction constructors distribute the independent target-sector computations (requires Julia to be started with multiple threads, e.g. julia -t auto, to take effect). The default 1 is serial; the parallel construction gives results identical to the serial one. Note that the peak memory usage grows with the number of concurrent tasks, and that the default timer of the parallel construction is the disabled notimer (TimerOutput is not thread-safe), so the per-sector progress messages may interleave.
source
ExactDiagonalization.BinaryBases — Method
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.BinaryBases — Method
BinaryBases(spindws, spinups, sz::𝕊ᶻ)

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

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

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

source
ExactDiagonalization.BinaryBasis — Type
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.BinaryBasis — Method
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.DiskCSCMatrix — Type
DiskCSCMatrix{V, I<:Integer} <: AbstractSparseMatrix{V, I}

A sparse matrix in CSC format whose payload is either held strongly in memory (isnothing(path), for small or uncached matrices, never evicted) or held weakly with backing files on disk: in the latter case the garbage collector may reclaim the payload under memory pressure, and the next access transparently reloads it via memory mapping.

Only read-only access is supported; no mutating methods are defined, so accidental in-place modification of a cached matrix is a MethodError rather than silent corruption of the backing files.

sparse reload is thread-safe (guarded by the per-entry lock). When a DiskCSCMatrix is serialized to another process, the payload is materialized and the received object is a detached in-memory proxy (path=nothing): the session-local backing files never leak across process boundaries.

source
ExactDiagonalization.DiskCSCMatrix — Method
DiskCSCMatrix(M::SparseMatrixCSC) -> DiskCSCMatrix

Wrap a sparse matrix into an in-memory DiskCSCMatrix proxy (strongly held, never evicted, nothing written to disk, not entered into any cache).

source
ExactDiagonalization.DiskCache — Type
DiskCache

A session-scoped disk-backed store of sparse matrices (DiskCSCMatrix) keyed by serialized content (see cachekey), with GC-driven eviction and transparent reload. Since the Dict keys are the full content bytes, distinct contents can never be confused, regardless of hash collisions. The on-disk directories are named by a monotonic counter: deduplication is the dictionary's job, not the file names'.

Entries are accessed exclusively through get! with a lazy default (get!(f, cache, key): f produces the matrix only on a miss) and removed through empty!. Thread-safe: they are serialized by the per-cache lock, and the disk writes of a new entry happen outside the lock under a directory name that is unique by construction. Process-safe by isolation: each process (and each DiskCache instance) writes to its own fresh temporary directory, so no cross-process coordination is needed.

source
ExactDiagonalization.DiskCache — Method
DiskCache(; parent::AbstractString=tempdir(), threshold::Integer=1<<20) -> DiskCache

Create a DiskCache whose files live in a fresh subdirectory of parent (use a fast local disk, e.g. an NVMe scratch area, for parent when available; on Unix the default tempdir() honors the TMPDIR environment variable). Matrices smaller than threshold bytes are wrapped in in-memory proxies and never written to disk. The directory is removed (best effort) at the end of the session. The on-disk format is native binary and valid only within the current session.

source
ExactDiagonalization.ED — Type
ED(system::OperatorGenerator, dtype::Type{<:Number}=scalartype(system))
ED(lattice::Union{AbstractLattice, Nothing}, system::OperatorGenerator, dtype::Type{<:Number}=scalartype(system))
ED(system::OperatorGenerator, quantumnumbers::OneOrMore{Abelian}, dtype::Type{<:Number}=scalartype(system))
ED(lattice::Union{AbstractLattice, Nothing}, system::OperatorGenerator, quantumnumbers::OneOrMore{Abelian}, dtype::Type{<:Number}=scalartype(system))

Construct the exact diagonalization method from a pre-built OperatorGenerator with/without quantum numbers.

source
ExactDiagonalization.ED — Type
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}, 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 with/without quantum numbers.

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

Exact diagonalization method of a quantum lattice system.

source
ExactDiagonalization.EDEigen — Method
EDEigen(sectors::Union{Abelian, Sector}...; nev::Int=1, which::Symbol=:SR)
EDEigen(sectors::Tuple{Vararg{Union{Abelian, Sector}}}; nev::Int=1, which::Symbol=:SR)

Construct an EDEigen. nev is the number of eigenvalues to be computed and which the type of eigenvalues to be computed.

source
ExactDiagonalization.EDEigenData — Type
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.EDMatrix — Type
EDMatrix{M<:DiskCSCMatrix, S<:Sector} <: OperatorPack{M, Tuple{S, S}}

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

source
ExactDiagonalization.EDMatrix — Method
EDMatrix(m::Union{DiskCSCMatrix, SparseMatrixCSC}, sector::Sector)
EDMatrix(m::Union{DiskCSCMatrix, SparseMatrixCSC}, braket::NTuple{2, Sector})
EDMatrix(m::Union{DiskCSCMatrix, 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.

The sparse matrix payload is wrapped into an in-memory DiskCSCMatrix proxy.

source
ExactDiagonalization.EDMatrixization — Method
(matrixization::EDMatrixization)(m::Union{Operator, Operators}; cached::Bool=true, kwargs...) -> OperatorSum{<:EDMatrix}

Get the matrix representation of an operator or a set of operators on the target Hilbert space as an OperatorSum of EDMatrix blocks, one per braket of matrixization. With cached=true (the default), each block is memoized in the session-wide DiskCache under its cachekey (see matrix), so that identical systems share the blocks without reconstructing them.

source
ExactDiagonalization.EDMatrixization — Method
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.Graded — Method
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.GreenFunction — Type
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::ED, kind::GreaterOrLesserKind, method::Union{ExactMethod, BandLanczosMethod}=BandLanczosMethod();
    e₀::Union{Real, Nothing}=nothing, v₀::Union{AbstractVector{<:Number}, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, callback=nothing, timer::Union{TimerOutput, Nothing}=nothing, kwargs...
)

Construct a zero-temperature GreenFunction, by full diagonalization of each target sector for ExactMethod and by the band Lanczos method for BandLanczosMethod.

The independent target-sector computations are distributed over ntasks(method) parallel tasks (requires Julia to be started with multiple threads, e.g. julia -t auto, to take effect), with results identical to the serial construction. Note that the peak memory usage grows with the number of concurrent tasks, and that the default timer is edtimer for the serial construction and the disabled notimer for the parallel one (TimerOutput is not thread-safe), in which case the per-sector progress messages may interleave.

When supplied, callback is invoked once with a GreenFunctionInfo after construction. At zero temperature, Ω==e₀ and Z==1.

source
ExactDiagonalization.GreenFunction — Type
GreenFunction(operators::AbstractVector{<:QuantumOperator}, ed::Algorithm{<:ED}, kind::GreenFunctionKind, method::GreenFunctionMethod=BandLanczosMethod(); kwargs...)

Construct a GreenFunction from a vector of quantum operators, an exact diagonalization algorithm, a kind marker (GreenFunctionKind), and a Green function method.

The keyword arguments are passed to the underlying constructor.

The default timer is ed.timer for the serial construction (ntasks(method)==1) and the disabled notimer for the parallel one.

source
ExactDiagonalization.GreenFunction — Type
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::ED, kind::GreenFunctionKind{:retarded}, method::Union{BandLanczosMethod, ExactMethod}=BandLanczosMethod();
    sign::Bool=false, e₀::Union{Real, Nothing}=nothing, v₀::Union{AbstractVector{<:Number}, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, callback=nothing, timer::Union{TimerOutput, Nothing}=nothing, kwargs...
)

Construct the zero-temperature retarded Green function as the single merged pole sum of the greater and lesser parts (via the +/- algebra of GreenFunction), which are constructed by the zero-temperature GreenFunction constructor with the same method (BandLanczosMethod or ExactMethod) and share the same ground state.

With ntasks(method)>1, the greater and lesser parts are constructed concurrently, each distributing its target-sector computations over up to max(1, ntasks(method)÷2) tasks; the results are identical to the serial construction. Note that the peak memory usage grows with the number of concurrent tasks, and that the default timer is edtimer for the serial construction and the disabled notimer for the parallel one (TimerOutput is not thread-safe).

When supplied, callback is invoked once with a GreenFunctionInfo after construction. At zero temperature, Ω==e₀ and Z==1.

source
ExactDiagonalization.GreenFunction — Type
GreenFunction{T<:Number, V<:Real} <: Function

Green function expressed as a sum of simple poles,

G[i, j](ω) = sum(L[i, k]*R[j, k]/(ω-E[k]) for k in eachindex(E)),

where L and R are the left and right amplitudes of each pole.

For Green's functions with a single initial state (e.g., the zero-temperature one), R==conj(L) and the pole amplitudes reduce to the single-amplitude-matrix form L[i, k]*conj(L[j, k]).

source
ExactDiagonalization.GreenFunction — Method
GreenFunction(Q::AbstractMatrix{<:Number}, E::AbstractVector{<:Number})

Construct a GreenFunction from the single amplitude matrix Q, equivalent to GreenFunction(Q, conj(Q), E).

source
ExactDiagonalization.GreenFunction — Method
(gf::GreenFunction)(dest::AbstractMatrix{<:Number}, ω::Number; workspace=nothing) -> typeof(dest)

Get the values of a GreenFunction at ω and overwrite dest with the result.

The pole sum is evaluated as L*Diagonal(inv.(ω.-E))*transpose(R) using BLAS. For repeated evaluations, preallocated workspace (size size(gf.L)) can be supplied.

source
ExactDiagonalization.GreenFunction — Method
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::ED, kind::GreaterOrLesserKind, method::ThermalExactMethod;
    E₀::Union{AbstractVector{<:Real}, Nothing}=nothing, U₀::Union{AbstractMatrix{<:Number}, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, callback=nothing, timer::TimerOutput=edtimer, kwargs...
)

Construct the finite-temperature Green function at inverse temperature method.β by exact method.

The trace is taken over the ground-state sector only, i.e. the canonical ensemble with all conserved quantum numbers fixed to the ground-state sector's values.

  • E₀ and U₀: the optional precomputed spectrum (all eigen values and eigen vectors) of the ground-state sector, which must be provided together; reused as provided (e.g. shared between the two kinds by the GreenFunctionKind(:retarded) constructor), and computed internally by dense diagonalization of sector₀ when absent.
  • sector₀: the ground-state sector; computed internally when absent. The Boltzmann weights are relative to its lowest eigen energy E₀[1].

When supplied, callback is invoked once with a GreenFunctionInfo after construction. Its Ω is the finite-temperature thermodynamic potential.

source
ExactDiagonalization.GreenFunction — Method
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::ED, kind::GreaterOrLesserKind, method::ThermalSeedBandLanczosMethod;
    e₀::Union{Real, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, callback=nothing, timer::Union{TimerOutput, Nothing}=nothing, kwargs...
)

Construct the finite-temperature Green function at inverse temperature method.β by the thermally-weighted seed band Lanczos method.

The trace is taken over the ground-state sector only, i.e. the canonical ensemble with all conserved quantum numbers fixed to the ground-state sector's values.

The Green functions of the individual random vectors are stored in method.samples for statistical analysis (overwritten at each construction).

  • e₀, sector₀: the ground-state energy and sector; recomputed each call when absent, by a Lanczos eigen solver with a random initial vector (see ThermalSeedBandLanczosMethod for the reproducibility implications).

The independent random-vector computations are distributed over ntasks(method) parallel tasks (requires Julia to be started with multiple threads, e.g. julia -t auto, to take effect), and the sector computations within each sample over up to max(1, ntasks(method)÷min(ntasks(method), method.nrandom)) nested tasks. The random vectors are drawn from per-sample generators derived from method.seed (see samplerngs), so the results are reproducible for a nonzero seed and identical for the serial and all parallel constructions. Note that the peak memory usage grows with the number of concurrent samples, and that the default timer is edtimer for the serial construction and the disabled notimer for the parallel one (TimerOutput is not thread-safe), in which case the progress messages may interleave.

When supplied, callback is invoked once with a GreenFunctionInfo after construction. Its Ω is estimated from the same random samples.

source
ExactDiagonalization.GreenFunction — Method
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::ED, kind::GreenFunctionKind{:retarded}, method::ThermalExactMethod;
    sign::Bool=false, E₀::Union{AbstractVector{<:Real}, Nothing}=nothing, U₀::Union{AbstractMatrix{<:Number}, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, callback=nothing, timer::TimerOutput=edtimer, kwargs...
)

Construct the finite-temperature retarded Green function at inverse temperature method.β by the exact method, as the single merged pole sum of the greater and lesser parts (via the +/- algebra of GreenFunction), which share the same ground-state sector spectrum: computed internally, or reused from E₀ and U₀ provided together.

When supplied, callback is invoked once with a GreenFunctionInfo after construction. Its Ω is the finite-temperature thermodynamic potential.

source
ExactDiagonalization.GreenFunction — Method
GreenFunction(
    operators::AbstractVector{<:QuantumOperator}, ed::ED, kind::GreenFunctionKind{:retarded}, method::ThermalSeedBandLanczosMethod;
    sign::Bool=false, e₀::Union{Real, Nothing}=nothing, sector₀::Union{Sector, Nothing}=nothing, callback=nothing, timer::Union{TimerOutput, Nothing}=nothing, kwargs...
)

Construct the finite-temperature retarded Green function at inverse temperature method.β by the thermally-weighted seed band Lanczos method, as the single merged pole sum of the greater and lesser parts (via the +/- algebra of GreenFunction), which share the same per-sample data of the first Lanczos runs: each random vector is used for both parts (exactly paired), and the merged per-sample Green functions are stored in method.samples.

The independent random-vector computations are distributed over ntasks(method) parallel tasks (requires Julia to be started with multiple threads, e.g. julia -t auto, to take effect); within each sample, the greater and lesser parts are constructed concurrently, each distributing its sector computations over up to max(1, ntasks(method)÷(2*min(ntasks(method), method.nrandom))) nested tasks. The random vectors are drawn from per-sample generators derived from method.seed (see samplerngs), so the results are reproducible for a nonzero seed and identical for the serial and all parallel constructions. Note that the peak memory usage grows with the number of concurrent samples, and that the default timer is edtimer for the serial construction and the disabled notimer for the parallel one (TimerOutput is not thread-safe), in which case the progress messages may interleave.

When supplied, callback is invoked once with a GreenFunctionInfo after construction. Its Ω is estimated from the same random samples.

source
ExactDiagonalization.GreenFunction — Method
GreenFunction(sample::ThermalSample, operators::AbstractVector{<:QuantumOperator}, ed::ED, kind::GreaterOrLesserKind, method::ThermalSeedBandLanczosMethod; sector₀::Sector, timer::Union{TimerOutput, Nothing}=nothing) -> GreenFunction

Construct the Green function for a single random vector (carried by sample) of the thermally-weighted seed method, in the mandatory ground-state sector sector₀.

The operators are grouped by the sectors their adjoints map to from sector₀ (see sectorgroups), and the Hamiltonian and operator matrices of each sector are constructed on the fly inside the loop (cheaply, via the disk caches). The constructed GreenFunction is unnormalized and serves as a data container: divide its L by sample.z for the Green function of the individual sample, or accumulate the poles over the samples and divide by the total partition function for the combined Green function.

The independent target-sector computations are distributed over ntasks(method) parallel tasks (requires Julia to be started with multiple threads, e.g. julia -t auto, to take effect); the default timer is edtimer for the serial construction and the disabled notimer for the parallel one.

source
ExactDiagonalization.GreenFunctionInfo — Type
GreenFunctionInfo{T<:Real, S<:Sector}

Thermodynamic information collected during a Green-function construction.

Z is the partition function relative to the ground-state energy, Ω is the thermodynamic potential, and sector₀ is the ground-state sector.

Use the callback keyword of a GreenFunction constructor to receive this information once after a successful construction.

source
ExactDiagonalization.GreenFunctionInfo — Method
GreenFunctionInfo(e₀::Real, Z::Real, sector₀::Sector, β::Real) -> GreenFunctionInfo

Construct finite-temperature information with Ω=e₀-log(Z)/β where e₀ is the ground-state energy and β is the inverse temperature.

source
ExactDiagonalization.GreenFunctionInfo — Method
GreenFunctionInfo(e₀::Real, sector₀::Sector) -> GreenFunctionInfo

Construct zero-temperature information with Z==1 and Ω==e₀ where e₀ is the ground-state energy.

source
ExactDiagonalization.GreenFunctionKind — Type
GreenFunctionKind{K}

The kind marker of a Green function construction, enabling dispatch on it: GreenFunctionKind(:greater), GreenFunctionKind(:lesser) and GreenFunctionKind(:retarded) select the greater, lesser and retarded Green function, respectively.

source
ExactDiagonalization.RawStderrLogger — Type
RawStderrLogger <: AbstractLogger

A minimal logger that prints messages verbatim to stderr (no level tag, no metadata, no newline), used for the in-place (\r-overwritten) progress display.

source
ExactDiagonalization.Sector — Type
Sector(hilbert::Hilbert{<:Fock}, basistype::Type{<:Unsigned}=UInt) -> BinaryBases
Sector(::ℤ₁, hilbert::Hilbert{<:Fock}, basistype::Type{<:Unsigned}=UInt; table::AbstractDict=Table(hilbert, Metric(EDKind(hilbert), hilbert))) -> 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.Sector — Type
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.Sector — Type
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.SectorFilter — Type
SectorFilter{S} <: LinearTransformation

Filter the target bra and ket Hilbert spaces.

It is a linear projection on EDMatrix: the matrix is kept if its id is contained in brakets, and zeroed otherwise. Since an OperatorSum never contains zero entries (zeros are always dropped by add!), applied to an OperatorSum{<:EDMatrix} the excluded entries are effectively removed from the result.

source
ExactDiagonalization.SpinCoherentState — Type
(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.SpinCoherentState — Type
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.SpinCoherentState — Method
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.SpinCoherentStateProjection — Method
SpinCoherentStateProjection(configuration::SpinCoherentState, polars::AbstractVector{<:Real}, azimuths::AbstractVector{<:Real})
SpinCoherentStateProjection(configuration::SpinCoherentState, np::Integer, na::Integer)

Construct a SpinCoherentStateProjection.

source
ExactDiagonalization.SpinCoherentStateProjectionData — Type
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.StaticTwoPointCorrelatorData — Type
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
ExactDiagonalization.ThermalExactMethod — Type
ThermalExactMethod <: GreenFunctionMethod

Exact diagonalization method for the finite-temperature Green function.

The trace is taken over the ground-state sector only, i.e. the canonical ensemble with all conserved quantum numbers fixed to the ground-state sector's values.

Suitable for small Hilbert spaces and as the benchmark of ThermalSeedBandLanczosMethod.

source
ExactDiagonalization.ThermalExactMethod — Method
ThermalExactMethod(; β::Real, cutoff::Real=0.0)

Construct a ThermalExactMethod for computing the finite-temperature Green function at inverse temperature β by exact diagonalization.

  • β: the inverse temperature.
  • cutoff: Boltzmann weight threshold (dimensionless). Only eigenstates with exp(-β*(Eₙ-e₀))>=cutoff are kept as initial states. The default 0.0 keeps all eigenstates (strictly exact).
source
ExactDiagonalization.ThermalSample — Type
ThermalSample{T<:Number, V<:Real}

The per-sample data of the first Lanczos run (thermal state preparation) of the thermally-weighted seed method (see ThermalSeedBandLanczosMethod) for a single random vector |r⟩.

Let oᵢ = ⟨r|ψᵢ⟩ denote the overlaps of the random vector with the Ritz states:

  • φ::Vector{T}: the thermally-weighted state |φ⟩ = ∑ᵢ exp(-βεᵢ/2)conj(oᵢ)|ψᵢ⟩ (the TPQ state);
  • energies::Vector{V}: the Ritz energies εᵢ of the kept states (absolute energies);
  • states::Matrix{T}: the kept Ritz states |ψᵢ⟩, stored as columns;
  • weights::Vector{T}: the per-state weights wᵢ = exp(-βεᵢ/2)oᵢ (signed or complex, as they carry the overlaps oᵢ);
  • z::V: the sample partition function z = ∑ₗ |oₗ|²exp(-βεₗ).
source
ExactDiagonalization.ThermalSample — Method
ThermalSample(H₀::AbstractMatrix{<:Number}, method::ThermalSeedBandLanczosMethod, e₀::Real; timer::TimerOutput=edtimer, rng::AbstractRNG=default_rng()) -> ThermalSample

Construct a ThermalSample for a single random vector of the thermally-weighted seed method, by running the first Lanczos (thermal state preparation) on the ground-state-sector Hamiltonian H₀ with ground-state energy e₀.

The random vector is drawn from rng, which defaults to the global RNG; the GreenFunction constructors pass per-sample generators (see samplerngs).

source
ExactDiagonalization.ThermalSeedBandLanczosMethod — Type
ThermalSeedBandLanczosMethod{OQ<:Orthogonalizer, OR<:Orthogonalizer} <: GreenFunctionMethod

Thermally-weighted seed band Lanczos method for the finite-temperature Green function (the Kokalj variant of the low-temperature Lanczos method).

The trace is taken over the ground-state sector only, i.e. the canonical ensemble with all conserved quantum numbers fixed to the ground-state sector's values.

For each of nrandom random vectors, a first Lanczos run prepares the approximate thermally-weighted pure state |TPQ⟩=∑ₗexp(-βεₗ/2)⟨ψₗ|r⟩|ψₗ⟩ and a second band Lanczos run seeded by A†|TPQ⟩ resolves the spectral function. Both runs keep the Krylov basis for full reorthogonalization.

The field samples is lazily initialized: empty at construction; overwritten by each GreenFunction construction with the Green functions of the individual random vectors (of the constructed kind, merged per sample for the GreenFunctionKind(:retarded) construction).

source
ExactDiagonalization.ThermalSeedBandLanczosMethod — Type
ThermalSeedBandLanczosMethod(
    orthᵣ::Orthogonalizer=ModifiedGramSchmidt2(), orthₒ::Orthogonalizer=ModifiedGramSchmidt();
    β::Real, cutoff::Real=1e-3, nrandom::Integer=10, maxdim₁::Integer=200, maxdim₂::Integer=200, seed::Integer=0, tol::Real=2e-8, tolᵣ::Real=1e-8, ntasks::Integer=1
)

Construct a ThermalSeedBandLanczosMethod for computing the finite-temperature Green function at inverse temperature β.

  • β: the inverse temperature.
  • cutoff: dimensionless weight threshold for the kept Lanczos eigenstates: only those with exp(-β(εᵢ-e₀)/2)>=cutoff are kept in the thermally-weighted seed, where e₀ is the ground state energy. The discarded states bias the Green function by O(cutoff²) relatively.
  • nrandom: number of random vectors.
  • maxdim₁: number of Lanczos iterations of the first (state-preparing) run.
  • maxdim₂: number of Lanczos iterations of the second (resolvent) run.
  • seed: seed of the random number generator for reproducibility; 0 means not reseeding (truly random samples). For fully deterministic results, pass e₀ and sector₀ explicitly to the constructors, otherwise they are recomputed each call by a Lanczos eigen solver with a random initial vector, which may flip the signs of some LAPACK eigenvectors in the poles (the Green function values are invariant under these sign flips). An independent generator is derived from (seed, r) for the r-th random vector (see samplerngs), so for a nonzero seed the results are reproducible and identical for the serial and all parallel constructions.
  • tol: Lanczos convergence tolerance. Iteration stops when normres < tol.
  • tolᵣ: QR rank determination tolerance in block_qr!. A vector with norm < tolᵣ is considered numerically zero.
  • orthᵣ: Orthogonalizer used in block_qr! for rank determination of initial and residual blocks.
  • orthₒ: Orthogonalizer used in block_reorthogonalize! for reorthogonalization against the Krylov basis during the Lanczos recurrence.
  • ntasks: number of parallel tasks over which the GreenFunction constructors distribute the nrandom independent random-vector computations, with the sector computations within each sample nested over up to max(1, ntasks÷min(ntasks, nrandom)) tasks (halved once more for the retarded construction, whose greater and lesser parts are also concurrent). The default 1 is serial; for a nonzero seed, the parallel results are reproducible and independent of the number of tasks. Note that the peak memory usage grows with the number of concurrent samples, and that the default timer of the parallel construction is the disabled notimer (TimerOutput is not thread-safe), so the progress messages may interleave.
source
QuantumLattices.DegreesOfFreedom.InternalIndex — Method
(index::InternalIndex)(quantumnumber::AbelianQuantumNumberProd) -> AbelianQuantumNumberProd

Get the resulting Deligne tensor product of Abelian quantum numbers after an InternalIndex acts upon each component of an AbelianQuantumNumberProd.

source
QuantumLattices.QuantumSystems.FockIndex — Method
(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
QuantumLattices.QuantumSystems.SpinIndex — Method
(index::SpinIndex)(quantumnumber::ℤ₁) -> ℤ₁
(index::SpinIndex)(quantumnumber::𝕊ᶻ) -> 𝕊ᶻ

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

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

Overloaded + operator for AbelianQuantumNumber.

source
Base.:+ — Method
+(g₁::GreenFunction, g₂::GreenFunction) -> GreenFunction
-(g₁::GreenFunction, g₂::GreenFunction) -> GreenFunction
-(g::GreenFunction) -> GreenFunction

The algebra of Green functions: addition/subtraction is the concatenation of the pole sets (E = [E₁; E₂], L = [L₁ ±L₂], R = [R₁ R₂]), which is exact since G(ω) is linear in the poles. The ranks must match.

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.broadcast — Method
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.broadcast — Method
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 bases based on the quantum numbers and a Hilbert space.

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

Get the dual of an Abelian graded space.

source
Base.count — Method
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.count — Method
count(data::EDEigenData) -> Int

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

source
Base.count — Method
count(gf::GreenFunction) -> Int

Count the number of poles contributing to a GreenFunction.

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

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

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

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

source
Base.eltype — Method
eltype(gf::GreenFunction)
eltype(::Type{<:GreenFunction{T}}) where {T<:Number}

Get the eltype of a GreenFunction.

source
Base.empty! — Method
empty!(cache::DiskCache) -> DiskCache

Remove all entries of cache and delete their files (best effort), extending Base.empty!. The directory-name counter is deliberately not reset, so that directories whose deletion failed (e.g. due to live memory mappings) are never reused for new contents.

Thread-safe: the entry table is cleared under the per-cache lock, and the files of each entry are deleted under the per-entry lock so that a concurrent sparse reload cannot race the deletion.

source
Base.get! — Method
get!(f::Function, cache::DiskCache, key::String) -> DiskCSCMatrix

Get the proxy cached under key; on a miss, invoke f() to produce the matrix, store it under key, and return its proxy, extending Base.get!. This is the sole entry accessor of DiskCache: the returned value is always the proxy associated with key after the call, so two concurrent calls with the same key both return the winner's proxy. Matrices smaller than cache.threshold bytes are wrapped in an in-memory proxy (strongly held, never evicted) and are not written to disk.

Thread-safe: the key lookup, the allocation of the on-disk directory name, and the registration of the new entry happen under the per-cache lock, while f() and the disk writes happen outside it. Two concurrent calls with the same key may both invoke f() (the expensive construction is deliberately not serialized); the loser discards its files and returns the winner's proxy.

source
Base.getindex — Method
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.getindex — Method
getindex(gs::AbelianGradedSpace, i::Union{Integer, CartesianIndex})

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

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

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

source
Base.getindex — Method
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-product Abelian quantum numbers.

source
Base.in — Method
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.inv — Function
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.inv — Method
inv(gf::GreenFunction, ω::Number; kwargs...)

Compute the inverse of a GreenFunction at ω, forwarding all workspace keywords to the in-place method.

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

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

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

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

source
Base.iterate — Function
iterate(basis::BinaryBasis)
iterate(basis::BinaryBasis, state)

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

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

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

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

Get the length of a Deligne tensor product.

source
Base.match — Method
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.merge — Method
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.one — Method
one(basis::BinaryBasis, state::Integer) -> BinaryBasis

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

source
Base.pairs — Method
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.range — Method
range(bs::AbelianBases) -> AbstractVector{Int}

Get the range of the target sector of an AbelianBases in the combined via direct product bases.

source
Base.range — Method
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.range — Method
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.range — Method
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.range — Method
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.size — Method
size(gf::GreenFunction) -> NTuple{2, Int}

Get the size of a GreenFunction.

source
Base.split — Method
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.values — Method
values(qn::AbelianQuantumNumberProd) -> NTuple{rank(qn), Number}

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

source
Base.values — Method
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.zero — Method
zero(qn::AbelianQuantumNumber) -> typeof(qn)
zero(::Type{QN}) where {QN<:AbelianQuantumNumber} -> QN

Get the zero Abelian quantum number.

source
Base.zero — Method
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.assemble — Method
assemble(blocks, nops::Int, T) -> (L, R, E)

Assemble the pole blocks of the sector groups into the full pole arrays of a GreenFunction.

Each block is a tuple (Lₚ, Rₚ, Eₚ, ranks) with the poles of one sector group, where ranks are the global operator indices of the group and nops is the total number of operators.

source
ExactDiagonalization.basistype — Method
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.cachekey — Method
cachekey(ops::Union{Operator, Operators}, braket::NTuple{2, Sector}, table::AbstractDict, dtype::Type{<:Number}) -> String

The content key of the matrix of an operator or a set of operators between the bases of braket, used by the memoized matrix wrapper: the serialized content of the operator(s) (including the coefficients), the defining content of the two bases (type, id, dimension), the index table, and the matrix element type. The key is the raw serialization bytes held in a String container (an opaque binary blob, not valid UTF-8 text; only hash/isequal/dictionary lookups are meaningful on it). Since the full content bytes are the key, distinct contents are never confused, regardless of hash collisions.

For an Operators, the key depends on the iteration order of the set (the insertion order of its OrderedDict contents): identical construction paths yield identical keys, while the same terms assembled in a different order yield a different key (a benign cache miss, never an error).

source
ExactDiagonalization.diskcache! — Method
diskcache!(cache::DiskCache) -> DiskCache

Set the process-wide default disk cache (e.g., to customize the parent directory of its files or the size threshold). The previous default is discarded (its directory is removed on a best-effort basis).

Thread-safe: the swap of the default is atomic; the previous default is emptied afterwards.

source
ExactDiagonalization.diskcache — Method
diskcache() -> DiskCache

Get the process-wide default DiskCache, creating it lazily on first use. Since the cache is keyed by serialized content, sharing it across different systems is safe: identical contents map to identical matrices, and distinct contents are never confused.

Thread-safe: the lazy initialization is serialized by a global lock.

source
ExactDiagonalization.findindex — Method
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.normalize — Method
normalize(term::Term) -> Term
normalize(terms::OneAtLeast{Term}) -> OneAtLeast{Term}

Normalize the terms for exact diagonalization.

For a Pairing term, its factor is multiplied by 1//2 because in contrast to the BdG-form convention, the exact diagonalization method does not need to symmetrize the pairing operators, so the coefficient should not be doubled.

source
ExactDiagonalization.ntasks — Method
ntasks(method::GreenFunctionMethod) -> Int

Get the number of parallel tasks over which the GreenFunction constructors distribute the independent computations of method.

This requires Julia to be started with multiple threads, e.g. julia -t auto, to take effect.

The default is 1 (serial); BandLanczosMethod and ThermalSeedBandLanczosMethod carry it as a field that can be specified.

source
ExactDiagonalization.poles — Method
poles(
    S̃::AbstractMatrix{<:Number}, D̃::AbstractMatrix{<:Number}, Ẽ::AbstractVector{<:Real}, weight::Number, ref::Real;
    kind::Symbol=:greater
) -> (L, R, E)

Assemble the poles of the resolvent for a single initial state with the given weight and reference energy ref, from the amplitudes S̃[a, k] = ⟨seedₐ|ψ̃ₖ⟩ and D̃[a, k] = ⟨probeₐ|ψ̃ₖ⟩ resolved against the (approximate) eigen pairs {(Ẽ[k], ψ̃ₖ)} of the target sector (see resolve).

The pole at k has energy ±(Ẽ[k]-ref) (+ for kind==:greater, - otherwise) and left/right amplitudes

  • L[a, k] = weight * D̃[a, k], R[a, k] = conj(S̃[a, k]) for kind==:greater;
  • L[a, k] = weight * conj(S̃[a, k]), R[a, k] = D̃[a, k] for kind==:lesser.
source
ExactDiagonalization.poles — Method
poles(
    Xs::AbstractVector{<:AbstractMatrix}, states::AbstractMatrix{<:Number}, Ψ̃::AbstractMatrix{<:Number}, Ẽ::AbstractVector{<:Real}, weights::AbstractVector{<:Number}, refs::AbstractVector{<:Real};
    kind::Symbol=:greater, S̃::Union{Nothing, AbstractMatrix{<:Number}}=nothing
) -> (Lₚ, Rₚ, Eₚ)

Assemble the pole block of one target sector over all kept initial states, calling the single-state poles for each.

states stores the kept initial states as columns, Ψ̃ and Ẽ are the (approximate) eigen vectors and energies of the target sector, and weights/refs give the per-state weights and reference energies. The probe vectors are formed one state at a time, so that the full set of probes is never materialized. The seed amplitudes default to S̃ = D̃ per state (seeds identical to probes, e.g. ThermalExactMethod); pass a fixed S̃ (the amplitudes against the thermally-weighted seeds) for ThermalSeedBandLanczosMethod.

source
ExactDiagonalization.prepare! — Method
prepare!(ed::ED; timer::TimerOutput=edtimer) -> ED
prepare!(ed::Algorithm{<:ED}; timer::TimerOutput=ed.timer) -> 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.regularize — Method
regularize(quantumnumbers::AbstractVector{<:AbelianQuantumNumber}, dimension::AbstractVector{<:Integer}; check::Bool=false) -> Tuple{Vector{eltype(quantumnumbers)}, Vector{Int}, Vector{Int}}

Regularize 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) -> ED

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

source
ExactDiagonalization.resolve — Method
resolve(H::AbstractMatrix{<:Number}, seeds::AbstractVector{<:AbstractVector{<:Number}}, method::ExactMethod) -> (E, S)

Exact variant of resolve: the Ritz pairs are the full eigen pairs {(E[k], ψₖ)} of H, and the amplitudes are S[a, k] = ⟨seedsₐ|ψₖ⟩.

source
ExactDiagonalization.resolve — Method
resolve(H::AbstractMatrix{<:Number}, seeds::AbstractVector{<:AbstractVector{<:Number}}, method::ThermalSeedBandLanczosMethod) -> (Ẽ, Ψ̃)

Run the second band Lanczos (resolvent resolution) of the thermally-weighted seed method, seeded by seeds (the operators acting on the thermally-weighted state), returning the Ritz values Ẽ and the Ritz vectors Ψ̃ of H as columns of a dense matrix.

The amplitudes against the individual initial states are not resolved here; they are computed afterwards from Ψ̃, one state at a time, so that the full set of probe vectors is never materialized. The Krylov basis is always kept, as required by the deferred resolution.

source
ExactDiagonalization.resolve — Method
resolve(H::AbstractMatrix{<:Number}, seeds::AbstractVector{<:AbstractVector{<:Number}}, method::BandLanczosMethod) -> (Ẽ, S̃)

Resolve the band seeds against the Ritz pairs {(Ẽ[k], ψ̃ₖ)} of H obtained by the band Lanczos method, returning the Ritz energies Ẽ and the amplitudes S̃[a, k] = ⟨seedsₐ|ψ̃ₖ⟩.

source
ExactDiagonalization.samplerngs — Method
samplerngs(method::ThermalSeedBandLanczosMethod) -> Vector{Xoshiro}

Return the random number generators for the method.nrandom random vectors of the thermally-weighted seed method, one per sample; the r-th sample is drawn from samplerngs(method)[r].

The generators are derived from method.seed independently of the task scheduling: for a nonzero method.seed, the r-th generator is fully determined by (method.seed, r), hence the results are reproducible and identical for the serial and all parallel constructions; for method.seed==0, the seeds are drawn from the global RNG, hence truly random.

source
ExactDiagonalization.sectorgroups — Method
sectorgroups(operators::AbstractVector{<:QuantumOperator}, ed::ED, sector₀::Sector) -> OrderedDict{typeof(sector₀), Vector{Int}}

Decompose the resolvent into independent sector blocks: Aₐ† maps a state in the ground-state sector sector₀ with the quantum number qn₀≣Abelian(sector₀) into the target sector Aₐ†(qn₀), and the Green function is block-diagonal in these target sectors. Return the operator ranks (indices into operators) grouped by their target sector, in order of first appearance.

source
ExactDiagonalization.with_ntasks — Method
with_ntasks(method::BandLanczosMethod, ntasks::Integer) -> BandLanczosMethod

Rebuild method with a different number of parallel tasks, everything else preserved.

Used internally to split the task budget among the concurrently constructed parts of a Green function.

source
ExactDiagonalization.with_ntasks — Method
with_ntasks(method::ThermalSeedBandLanczosMethod, ntasks::Integer) -> ThermalSeedBandLanczosMethod

Rebuild method with a different number of parallel tasks, everything else preserved.

Used internally to split the task budget among the concurrently constructed samples of a Green function.

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

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

source
LinearAlgebra.eigen — Method
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.

When v₀ is an integer, it is interpreted as the dimension of the Hilbert space and a random initial vector of eltype scalartype(m) is used; when v₀ is a vector, it is used as the initial vector of the restarted Lanczos method and the eltype is inferred from v₀ itself.

source
LinearAlgebra.eigen — Method
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(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 KrylovKit package.

The initial vectors/dimensions of the restarted Lanczos method can be assigned to the individual sectors by v₀, whose keys can be either the sectors or their corresponding Abelian quantum numbers, and whose values can be either vectors (used as the initial vectors) or integers (interpreted as the dimensions of the sectors, in which case random initial vectors are used). Sectors missing from v₀ fall back to random initial vectors. An error is raised if any key of v₀ matches no sector of ms.

source
LinearAlgebra.inv! — Method
inv!(dest::AbstractMatrix{<:Number}, gf::GreenFunction, ω::Number; kwargs...)

Compute the inverse of a GreenFunction at ω into dest, overwriting its previous contents. Workspace keywords are forwarded to gf(dest,ω).

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

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

source
LinearAlgebra.rank — Method
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.matrix — Function
matrix(ops::Operators, braket::NTuple{2, Sector}, table::AbstractDict, dtype=scalartype(ops); cached::Bool=false) -> DiskCSCMatrix{dtype, Int}

Get the sparse matrix representation of a set of operators between the bases of braket as a DiskCSCMatrix proxy (the sum of the per-operator proxies; see matrix). The recursive bisection construction is always anonymous: intermediate sums are neither cached nor written to disk. With cached=true, only the final block is memoized: its cachekey is looked up in the session-wide DiskCache before construction (a hit skips the construction entirely), and a miss is stored under that key afterwards. A length-1 set is delegated to the operator-level method so that identical contents share the same key.

Here, table specifies the order of the operator indexes.

source
QuantumLattices.QuantumOperators.matrix — Function
matrix(op::Operator, braket::NTuple{2, Sector}, table::AbstractDict, dtype=scalartype(op); cached::Bool=false) -> DiskCSCMatrix{dtype, Int}

Get the sparse matrix representation of an operator between the bases of braket as a DiskCSCMatrix proxy. With cached=false (the default), the proxy is anonymous: it is neither written to disk nor entered into the cache, and neither is anything derived from it by the algebra of DiskCSCMatrix. With cached=true, the matrix is stored in the session-wide DiskCache under its cachekey (on disk when larger than the threshold), and identical (operator, bases, table, element type) contents return the shared proxy without reconstructing. The construction is done by sparse.

Here, table specifies the order of the operator indexes.

source
QuantumLattices.QuantumOperators.matrix — Function
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.matrix — Function
matrix(op::OperatorIndex, braket::NTuple{2, Sector}, table::AbstractDict, dtype=Int; cached::Bool=false) -> DiskCSCMatrix{dtype, Int}

Get the sparse matrix representation of an operator index as a DiskCSCMatrix proxy. The keyword cached is forwarded to the memoization wrapper of matrix.

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

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

source
QuantumLattices.Spatials.period — Method
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.period — Method
period(qn::SimpleAbelianQuantumNumber) -> Number
period(::Type{QN}) where {QN<:SimpleAbelianQuantumNumber} -> Number

Get the period of a simple Abelian quantum number.

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

Get the periods of Abelian quantum numbers.

source
QuantumLattices.add! — Method
add!(destination, transformation::EDMatrixization, ops::OperatorSet; kwargs...)

Add the matrix representation of a whole set of operators to destination, specializing the generic element-wise contract of add! for EDMatrixization: the set is matrixized as a whole (the result coincides by linearity), so that the memoization happens at the level of the merged block under the set-level cachekey instead of per operator.

source
QuantumLattices.decompose — Method
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.derivative! — Method
derivative!(dest::AbstractMatrix{<:Number}, gf::GreenFunction, ω::Number; workspace=nothing)

Compute ∂G[i,j]/∂ω = -Σₖ L[i,k]R[j,k]/(ω-E[k])² into dest, overwriting its previous contents. Preallocated workspace can be supplied.

source
QuantumLattices.derivative — Method
derivative(gf::GreenFunction, ω::Number; kwargs...)

Compute the frequency derivative of a GreenFunction at ω, forwarding all workspace keywords to the in-place method.

source
QuantumLattices.dimension — Method
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.dimension — Method
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.dimension — Method
dimension(rs::AbelianGradedSpaceProd) -> Int

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

source
QuantumLattices.dimension — Method
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.dimension — Method
dimension(rs::AbelianGradedSpaceSum) -> Int

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

source
QuantumLattices.dimension — Method
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.kind — Method
kind(ed::Union{ED, Algorithm{<:ED}}) -> EDKind
kind(::Type{<:ED{K}}) where K -> EDKind
kind(::Type{<:Algorithm{L}}) where {L<:ED} -> EDKind

Get the kind of an exact diagonalization method.

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

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

source
Serialization.deserialize — Method
deserialize(s::AbstractSerializer, ::Type{DiskCSCMatrix{V, I}}) where {V, I} -> DiskCSCMatrix{V, I}

Deserialize a DiskCSCMatrix received from another process, extending Serialization.deserialize: the result is a detached in-memory proxy (path=nothing), independent of the sender's backing files (see serialize).

source
Serialization.serialize — Method
serialize(s::AbstractSerializer, dm::DiskCSCMatrix)

Serialize a DiskCSCMatrix for cross-process transfer, extending Serialization.serialize: the payload is materialized and only the dimensions and the content are written, so the received object is a detached in-memory proxy (path=nothing). Serialization.serialize_cycle keeps the object identity of shared proxies within one serialized graph.

source
SparseArrays.sparse — Method
sparse(ed::ED, sector::Sector; timer::TimerOutput=edtimer) -> SparseMatrixCSC

Get the sparse matrix representation of a quantum lattice system in a single sector, extending SparseArrays.sparse. The construction reuses the cached operator blocks from the session-wide DiskCache implicitly.

source
SparseArrays.sparse — Method
sparse(dm::DiskCSCMatrix) -> SparseMatrixCSC

Get the payload of a DiskCSCMatrix as a plain SparseMatrixCSC, extending SparseArrays.sparse. If the payload has been garbage-collected, it is transparently reloaded from disk via memory mapping (without copying).

The returned matrix is the shared payload rather than a copy, so it must not be mutated in place.

Thread-safe: the reload (mmap + WeakRef swap) is serialized by the per-entry lock; the fast paths (strongly held or still-alive payload) are lock-free.

source
SparseArrays.sparse — Method
sparse(op::Operator{V, <:OneAtLeast{OperatorIndex}}, braket::NTuple{2, AbelianBases}, table::AbstractDict, dtype=V) where V -> SparseMatrixCSC{dtype, Int}

Get the sparse matrix representation of an operator between the bases of braket, extending SparseArrays.sparse. For the memoized variant, see matrix.

Here, table specifies the order of the operator indexes.

source
SparseArrays.sparse — Method
sparse(op::Operator{V, <:OneAtLeast{OperatorIndex}}, braket::NTuple{2, BinaryBases}, table::AbstractDict, dtype=V) where V -> SparseMatrixCSC{dtype, Int}

Get the sparse matrix representation of an operator between the bases of braket, extending SparseArrays.sparse. For the memoized variant, see matrix.

Here, table specifies the order of the operator indexes.

source
SparseArrays.sparse — Method
sparse(op::Operator{V, Tuple{}}, braket::NTuple{2, Sector}, table::AbstractDict, dtype=V) where V -> SparseMatrixCSC{dtype, Int}

Get the sparse matrix representation of a scalar operator between the bases of braket, extending SparseArrays.sparse. For the memoized variant, see matrix.

source