Reference
GradedArrays.GradedArray — Type
GradedArray{T,S,N,NC,ND,M} <: AbstractArray{T,N}Always-fused symmetric array: an N-dimensional graded array split into NC codomain and ND domain legs (NC + ND == N), backed by a matricized FusedGradedMatrix. The external axes are GradedOneTo and may be unfused or unsorted (a sector repeated, or out of SectorRange order); the matricized backing is always over the fused-sorted coupled space, and the per-leg sort permutation relates the two.
GradedArrays.GradedArray — Method
GradedArray(m::AbstractFusedGradedMatrix)Wrap a matrix-level fused graded matrix as its tensor-level {1,1} GradedArray, with the matrix's own coupled axes as the codomain and domain axes. The wrap shares storage.
GradedArrays.GradedArray — Method
GradedArray(t::TK.AbstractTensorMap)Build a GradedArray from a TensorMap, taking the per-leg external axes from its codomain and domain spaces. This copies the data; to_gradedarray is the zero-copy view counterpart.
GradedArrays.SectorRange — Type
SectorRange(sector::TKS.Sector, isdual::Bool)Unit range with elements of type Int that additionally stores a sector to denote the grading. Equivalent to Base.OneTo(length(sector)). Additionally holds a flag to denote the duality.
GradedArrays.gradedrange — Method
gradedrange(xs::AbstractVector{<:Pair})Generic fallback that converts sector keys via to_sector before constructing GradedOneTo. This supports NamedTuple keys (for sector products) and other non-standard key types.
GradedArrays.gradedrange — Method
gradedrange(xs::AbstractVector{<:Pair{<:SectorRange, <:Integer}})Construct a non-dual GradedOneTo from sector => multiplicity pairs. The sectors must be non-dual; wrap the result in dual for a dual axis.
Examples
gradedrange([U1(0) => 2, U1(1) => 3]) # non-dual
dual(gradedrange([U1(0) => 2, U1(1) => 3])) # dualGradedArrays.with_block_indexing — Function
with_block_indexing(f, allow = true)Run f() with block indexing of graded arrays enabled (or, with allow = false, disabled) for its dynamic extent, e.g. with_block_indexing() do ... end or with_block_indexing(false) do ... end.
GradedArrays.with_scalar_indexing — Function
with_scalar_indexing(f, allow = true)Run f() with scalar indexing of graded arrays enabled (or, with allow = false, disabled) for its dynamic extent, e.g. with_scalar_indexing() do ... end or with_scalar_indexing(false) do ... end.