Reference

GradedArrays.GradedArrayType
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.

source
GradedArrays.GradedArrayMethod
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.

source
GradedArrays.GradedArrayMethod
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.

source
GradedArrays.SectorRangeType
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.

source
GradedArrays.gradedrangeMethod
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.

source
GradedArrays.gradedrangeMethod
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]))    # dual
source
GradedArrays.with_block_indexingFunction
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.

Warning

Block indexing is experimental and its output type may change.

Warning

Like scalar indexing, this is a convenience, not an efficient access pattern, and should be avoided in performance-critical code.

source
GradedArrays.with_scalar_indexingFunction
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.

Warning

Scalar indexing is a convenience for interactive use and correctness checks, not an efficient access pattern. It should be avoided in performance-critical code, which should operate on whole blocks or the reduced data instead.

source