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
Manual
QuantumLattices.QuantumNumbers.Abelian
— Typeconst Abelian = AbelianQuantumNumber
Type alias for AbelianQuantumNumber
.
QuantumLattices.QuantumNumbers.AbelianGradedSpace
— TypeAbelianGradedSpace(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 argumentordercheck
istrue
, 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 bothordercheck==true
andduplicatecheck==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 argumentdegeneracycheck
istrue
, 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 assumedual==true
corresponds to the in-arrow anddual==false
corresponds to the out-arrow.
QuantumLattices.QuantumNumbers.AbelianGradedSpace
— TypeAbelianGradedSpace{QN<:AbelianQuantumNumber} <: RepresentationSpace{QN}
A quantum representation space of an Abelian group that has been decomposed into the direct sum of its irreducible representations.
QuantumLattices.QuantumNumbers.AbelianGradedSpace
— MethodAbelianGradedSpace(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.
QuantumLattices.QuantumNumbers.AbelianGradedSpaceProd
— TypeAbelianGradedSpaceProd{N, QN<:AbelianQuantumNumber} <: CompositeAbelianGradedSpace{N, QN}
Direct product of Abelian graded spaces.
QuantumLattices.QuantumNumbers.AbelianGradedSpaceSum
— TypeAbelianGradedSpaceSum{N, QN<:AbelianQuantumNumber} <: CompositeAbelianGradedSpace{N, QN}
Direct sum of Abelian graded spaces.
QuantumLattices.QuantumNumbers.AbelianQuantumNumber
— TypeAbelianQuantumNumber
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.
QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd
— TypeAbelianQuantumNumberProd{T<:Tuple{Vararg{SimpleAbelianQuantumNumber}}} <: AbelianQuantumNumber
Deligne tensor product of simple Abelian quantum numbers.
QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd
— MethodAbelianQuantumNumberProd(contents::SimpleAbelianQuantumNumber...)
AbelianQuantumNumberProd(contents::Tuple{Vararg{SimpleAbelianQuantumNumber}})
Construct a Deligne tensor product of simple Abelian quantum numbers.
QuantumLattices.QuantumNumbers.AbelianQuantumNumberProd
— MethodAbelianQuantumNumberProd{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.
QuantumLattices.QuantumNumbers.CompositeAbelianGradedSpace
— TypeCompositeAbelianGradedSpace{N, QN<:AbelianQuantumNumber} <: RepresentationSpace{QN}
Abstract type of composite Abelian graded spaces.
QuantumLattices.QuantumNumbers.Graded
— Typeconst Graded = AbelianGradedSpace
Type alias for AbelianGradedSpace
.
QuantumLattices.QuantumNumbers.Momenta
— TypeMomenta{P<:𝕂} <: RepresentationSpace{P}
Complete allowed set of momenta.
QuantumLattices.QuantumNumbers.RepresentationSpace
— TypeRepresentationSpace{QN<:AbelianQuantumNumber} <: VectorSpace{QN}
Abstract type of quantum representation spaces of Abelian groups.
QuantumLattices.QuantumNumbers.SimpleAbelianQuantumNumber
— TypeSimpleAbelianQuantumNumber <: AbelianQuantumNumber
Abstract type of simple Abelian quantum numbers. That is, it contains only one label.
QuantumLattices.QuantumNumbers.ℕ
— Typeℕ <: <: 𝕌₁
Concrete Abelian quantum number of the particle number.
QuantumLattices.QuantumNumbers.ℤ
— Typeℤ{N} <: SimpleAbelianQuantumNumber
ℤₙ quantum numbers.
QuantumLattices.QuantumNumbers.ℤ₁
— Typeconst ℤ₁ = ℤ{1}
const ℤ₂ = ℤ{2}
const ℤ₃ = ℤ{3}
const ℤ₄ = ℤ{4}
Alias for ℤ₁/ℤ₂/ℤ₃/ℤ₄ quantum numbers.
QuantumLattices.QuantumNumbers.𝕂
— Typeconst 𝕂 = AbelianQuantumNumberProd{<:Tuple{Vararg{ℤ}}}
const 𝕂¹{N} = AbelianQuantumNumberProd{Tuple{ℤ{N}}}
const 𝕂²{N₁, N₂} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}}}
const 𝕂³{N₁, N₂, N₃} = AbelianQuantumNumberProd{Tuple{ℤ{N₁}, ℤ{N₂}, ℤ{N₃}}}
Type alias for the Abelian quantum numbers of 1d, 2d and 3d momentum.
QuantumLattices.QuantumNumbers.𝕂¹
— Method𝕂¹{N}(k::Integer) where N
𝕂²{N}(k₁::Integer, k₂::Integer) where N
𝕂²{N₁, N₂}(k₁::Integer, k₂::Integer) where {N₁, N₂}
𝕂³{N}(k₁::Integer, k₂::Integer, k₃::Integer) where N
𝕂³{N₁, N₂, N₃}(k₁::Integer, k₂::Integer, k₃::Integer) where {N₁, N₂, N₃}
Construct 1d, 2d and 3d momentum.
QuantumLattices.QuantumNumbers.𝕊ᶻ
— Type𝕊ᶻ <: 𝕌₁
Concrete Abelian quantum number of the z-component of a spin.
QuantumLattices.QuantumNumbers.𝕌₁
— Type𝕌₁ <: SimpleAbelianQuantumNumber
Abstract type of 𝕌₁ quantum numbers.
Base.:+
— Method+(qn::AbelianQuantumNumber) -> typeof(qn)
Overloaded +
operator for AbelianQuantumNumber
.
Base.:+
— Method+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:AbelianQuantumNumberProd} -> QN
Overloaded +
operator for AbelianQuantumNumberProd
.
To ensure type stability, two AbelianQuantumNumberProd
can be added together if and only if they are of the same type.
Base.:+
— Method+(qn₁::QN, qn₂::QN, qns::QN...) where {QN<:SimpleAbelianQuantumNumber} -> QN
Overloaded +
operator for SimpleAbelianQuantumNumber
.
To ensure type stability, two SimpleAbelianQuantumNumber
can be added together if and only if they are of the same type.
Base.:-
— Method-(qn::AbelianQuantumNumberProd) -> typeof(qn)
-(qn₁::QN, qn₂::QN) where {QN<:AbelianQuantumNumberProd} -> QN
Overloaded -
operator for AbelianQuantumNumberProd
.
To ensure type stability, a AbelianQuantumNumberProd
can be subtracted by another AbelianQuantumNumberProd
if and only if they are of the same type.
Base.:-
— Method-(qn::SimpleAbelianQuantumNumber) -> typeof(qn)
-(qn₁::QN, qn₂::QN) where {QN<:SimpleAbelianQuantumNumber} -> QN
Overloaded -
operator for SimpleAbelianQuantumNumber
.
To ensure type stability, a SimpleAbelianQuantumNumber
can be subtracted by another SimpleAbelianQuantumNumber
if and only if they are of the same type.
Base.adjoint
— Methodadjoint(gs::AbelianGradedSpace) -> typeof(gs)
Get the dual of an Abelian graded space.
Base.cumsum
— Methodcumsum(rs::RepresentationSpace, i::Union{Integer, CartesianIndex}) -> Int
Get the accumulative degenerate dimension up to the ith Abelian quantum number contained in a representation space.
Base.cumsum
— Methodcumsum(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.
Base.getindex
— Methodgetindex(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.
Base.getindex
— Methodgetindex(qn::AbelianQuantumNumberProd, i::Integer) -> SimpleAbelianQuantumNumber
Get the ith simple Abelian quantum number in a Deligne tensor product.
Base.getindex
— Methodgetindex(::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.
Base.in
— Methodin(qn::QN, gs::AbelianGradedSpace{QN}) where {QN<:AbelianQuantumNumber} -> Bool
Check whether an Abelian quantum number is contained in an Abelian graded space.
Base.inv
— Functioninv(qn::AbelianQuantumNumber, bool::Bool=true) -> typeof(qn)
Get the inverse of an Abelian quantum number qn
if bool
is true. Otherwise, return qn
itself.
Base.length
— Methodlength(gs::AbelianGradedSpace) -> Int
Get the number of inequivalent irreducible representations (i.e., the Abelian quantum numbers) of an Abelian graded space.
Base.length
— Methodlength(qn::AbelianQuantumNumberProd) -> Int
Get the length of a Deligne tensor product.
Base.merge
— Methodmerge(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.
Base.pairs
— Methodpairs(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.
Base.range
— Methodrange(gs::AbelianGradedSpace, qn::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.
Base.range
— Methodrange(rs::AbelianGradedSpaceProd, i::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.
Base.range
— Methodrange(rs::AbelianGradedSpaceSum, i::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.
Base.range
— Methodrange(rs::RepresentationSpace, i::Integer)
Get the slice of the degenerate dimension of the ith Abelian quantum number contained in a representation space.
Base.range
— Methodrange(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.
Base.split
— Methodsplit(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.
Base.values
— Methodvalues(qn::AbelianQuantumNumberProd) -> NTuple{rank(qn), Number}
Get the values of the simple Abelian quantum numbers in a Deligne tensor product.
Base.values
— Methodvalues(qn::SimpleAbelianQuantumNumber) -> Tuple{Number}
Get the value of a simple Abelian quantum number and return it as the sole element of a tuple.
Base.zero
— Methodzero(qn::AbelianQuantumNumber) -> typeof(qn)
zero(::Type{QN}) where {QN<:AbelianQuantumNumber} -> QN
Get the zero Abelian quantum number.
LinearAlgebra.rank
— Methodrank(qn::AbelianQuantumNumberProd) -> Int
rank(::Type{<:AbelianQuantumNumberProd}) -> Int
Get the rank of a Deligne tensor product of simple Abelian quantum numbers.
LinearAlgebra.rank
— Methodrank(rs::CompositeAbelianGradedSpace) -> Int
rank(::Type{<:CompositeAbelianGradedSpace{N}}) where N -> Int
Get the number of Abelian graded spaces in the direct sum.
QuantumLattices.:⊕
— Method⊕(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.
QuantumLattices.:⊗
— Method⊗(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.
QuantumLattices.:⊗
— Method⊗(qns::AbelianQuantumNumber...) -> eltype(qns)
Get the direct product of some AbelianQuantumNumber
s.
QuantumLattices.:⊠
— Method⊠(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.
QuantumLattices.:⊠
— Method⊠(QNS::Type{<:SimpleAbelianQuantumNumber}...) -> Type{AbelianQuantumNumberProd{Tuple{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.
QuantumLattices.QuantumNumbers.findindex
— Methodfindindex(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
.
QuantumLattices.QuantumNumbers.period
— Methodperiod(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.
QuantumLattices.QuantumNumbers.period
— Methodperiod(qn::SimpleAbelianQuantumNumber) -> Number
period(::Type{QN}) where {QN<:SimpleAbelianQuantumNumber} -> Number
Get the period of a simple Abelian quantum number.
QuantumLattices.QuantumNumbers.periods
— Methodperiods(qn::AbelianQuantumNumber) -> Tuple{Vararg{Number}}
periods(::Type{QN}) where {QN<:AbelianQuantumNumber} -> Tuple{Vararg{Number}}
Get the periods of Abelian quantum numbers.
QuantumLattices.QuantumNumbers.regularize!
— Methodregularize!(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.
QuantumLattices.QuantumNumbers.regularize
— Methodregularize(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!
.
QuantumLattices.decompose
— Methoddecompose(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.
QuantumLattices.dimension
— Methoddimension(gs::AbelianGradedSpace, qn::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.
QuantumLattices.dimension
— Methoddimension(rs::AbelianGradedSpaceProd, i::CartesianIndex) -> Int
Get the degenerate dimension of the ith Abelian quantum number in the direct product of several Abelian graded spaces.
QuantumLattices.dimension
— Methoddimension(rs::AbelianGradedSpaceProd) -> Int
Get the total dimension of the direct product of several Abelian graded spaces.
QuantumLattices.dimension
— Methoddimension(rs::AbelianGradedSpaceSum, i::CartesianIndex) -> Int
Get the degenerate dimension of the ith Abelian quantum number in the direct sum of several Abelian graded spaces.
QuantumLattices.dimension
— Methoddimension(rs::AbelianGradedSpaceSum) -> Int
Get the total dimension of the direct sum of several Abelian graded spaces.
QuantumLattices.dimension
— Methoddimension(gs::AbelianGradedSpace) -> Int
Get the total dimension of an Abelian graded space.
QuantumLattices.dimension
— Methoddimension(rs::RepresentationSpace, i::Integer) -> Int
Get the degenerate dimension of the ith Abelian quantum number contained in a representation space.
QuantumLattices.dimension
— Methoddimension(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.
QuantumLattices.value
— Methodvalue(qn::AbelianQuantumNumberProd, i::Integer) -> Number
Get the value of the ith simple Abelian quantum number in a Deligne tensor product.
QuantumLattices.value
— Methodvalue(qn::SimpleAbelianQuantumNumber) -> Number
Get the value of a simple Abelian quantum number.