Reference
GradedArrays.AbelianBlocks — Type
AbelianBlocks{T,N,A<:AbelianGradedArray{T,N}} <: AbstractArray{AbelianSectorArray,N}Lazy view of an AbelianGradedArray's block storage, following the BlockArrays convention: getindex delegates to view(parent, Block.(I)...) (shares data), setindex! copies into the existing view.
GradedArrays.AbelianGradedArray — Type
AbelianGradedArray{T,N,D<:AbstractArray{T,N},S<:SectorRange} <: AbstractGradedArray{T,N}A graded array that stores non-zero blocks in a dictionary keyed by block indices. Each axis is a GradedOneTo carrying sectors, sector lengths, and a dual flag.
Blocks are stored as plain dense arrays of type D (default Array{T,N}). Accessing a block via a[Block(i,j)] returns a AbelianSectorArray wrapping the data with the appropriate sectors.
GradedArrays.AbelianSectorArray — Type
AbelianSectorArray{T,N,A,S} <: AbstractSectorArray{T, N}Unfused N-D data tensor for abelian symmetries. Stores one SectorRange per axis, plus a dense data array. Implements the Wigner-Eckart decomposition: the full tensor is the Kronecker product of an AbelianSectorDelta (structural) with the data array (reduced matrix elements).
GradedArrays.AbelianSectorDelta — Type
AbelianSectorDelta{T,N,S<:SectorRange} <: AbstractSectorDelta{T, N}Unfused N-D structural tensor for abelian symmetries. Stores one SectorRange per axis. For abelian symmetries, every element equals one(T) (the Kronecker delta selection rule).
GradedArrays.AbstractGradedArray — Type
AbstractGradedArray{T,N} <: AbstractArray{T,N}Abstract supertype for graded (symmetry-structured) arrays whose axes carry sector labels. Concrete subtypes include AbelianGradedArray and FusedGradedMatrix.
GradedArrays.AbstractSectorArray — Type
AbstractSectorArray{T,N} <: AbstractArray{T,N}Abstract supertype for data tensors labeled by sector information. Concrete subtypes:
AbelianSectorArray: unfused N-D abelian data tensor (one sector per axis)SectorMatrix: fused 2D data matrix (one coupled sector label)
GradedArrays.AbstractSectorDelta — Type
AbstractSectorDelta{T,N} <: AbstractArray{T,N}Abstract supertype for structural (Kronecker/identity) tensors associated to sector labels. Concrete subtypes:
AbelianSectorDelta: unfused N-D abelian structural tensor (product of Kronecker deltas)SectorIdentity: fused 2D structural factor (identity matrix per coupled sector)
GradedArrays.Data — Type
Data{N}Block-data indexing type analogous to BlockArrays.Block{N}. Indexing a graded array with Data(i, j, ...) accesses the raw data array for that block, without sector metadata wrappers.
GradedArrays.FusedGradedMatrix — Type
FusedGradedMatrix{T,D<:AbstractMatrix{T},S<:SectorRange}Block-diagonal matrix produced by matricizing an AbstractGradedArray. Each stored block corresponds to a coupled sector that lives on both the codomain and the domain.
Fields:
codomain::Dictionary{S,Int}— codomain (row) axis, mapping each sector to its row-block size. Keys are sorted and unique. Sectors are stored non-dual (codomain convention).domain::Dictionary{S,Int}— domain (column) axis, mapping each sector to its column-block size. Keys are sorted and unique. Stored non-dual; the actual axis is dual (the keys are dualed byaxes(m, 2)).blocks::Dictionary{S,D}— stored data blocks, keyed by sector. Each key must be in bothcodomainanddomain, andsize(blocks[s])must equal(codomain[s], domain[s]).
GradedArrays.FusedGradedMatrix — Method
FusedGradedMatrix(sectors::Vector{S}, blocks::Vector{D})Build a FusedGradedMatrix whose codomain and domain carry the same sector list. codomain[sectors[i]] is size(blocks[i], 1) and domain[sectors[i]] is size(blocks[i], 2).
GradedArrays.FusedGradedMatrix — Method
FusedGradedMatrix(a::AbelianGradedMatrix{T})Convert a 2D block-sparse AbelianGradedArray (as produced by matricize) into a FusedGradedMatrix. The codomain dict comes from the row axis sectors and lengths; the domain dict comes from dual.(domain_axis_sectors) and lengths. Stored entries of a populate blocks.
GradedArrays.FusedGradedVector — Type
FusedGradedVector{T,D<:AbstractVector{T},S<:SectorRange}Block-structured 1-D graded array produced by a sector-preserving operation on a FusedGradedMatrix (e.g. svd_vals, eig_vals, eigh_vals).
Fields:
axis::Dictionary{S,Int}— axis layout, mapping each sector to its block size. Keys are sorted and unique. Stored non-dual (codomain convention).blocks::Dictionary{S,D}— stored data blocks, keyed by sector. Keys are a subset ofkeys(axis)andlength(blocks[s]) == axis[s].
GradedArrays.FusedGradedVector — Method
FusedGradedVector(sectors::Vector{S}, blocks::Vector{D})Build a FusedGradedVector whose axis and blocks carry the same sector list. axis[sectors[i]] is length(blocks[i]).
GradedArrays.GradedOneTo — Type
GradedOneTo{S<:SectorRange}Represents a graded axis — a collection of sectors with sector lengths and a dual flag. This is the axis type for AbelianGradedArray.
Stores non-dual SectorRange values in nondual_sectors, sector lengths, and a single isdual flag. The sectors accessor applies the isdual flag on the fly.
GradedArrays.SectorIdentity — Type
SectorIdentity{T,S<:SectorRange} <: AbstractSectorDelta{T, 2}Fused 2D structural factor for a single coupled sector. By Schur's lemma, the structural part of each block in the fused (matricized) basis is the identity matrix for the irrep. Carries no free data — completely determined by the sector. The codomain axis is non-dual, the domain axis is dual.
GradedArrays.SectorMatrix — Type
SectorMatrix{T,D<:AbstractMatrix{T},S<:SectorRange} <: AbstractSectorArray{T, 2}Fused 2D data matrix for a single coupled sector. One block of a FusedGradedMatrix. In the representation-theoretic sense, this is an element of HomG(Vc, W_c) for coupled sector c — the reduced matrix element (degeneracy/multiplicity tensor) after Schur's lemma has factored out the structural part (SectorIdentity).
The codomain (row) axis is non-dual; the domain (column) axis is dual. The stored SectorRange is always non-dual (codomain convention).
GradedArrays.SectorOneTo — Type
SectorOneTo{S<:SectorRange}Represents one sector's index space — a SectorRange (sector label + dual flag) paired with a data length (multiplicity). This is the building block for GradedOneTo.
Stores a SectorRange and a data length. The isdual accessor is derived from the stored SectorRange.
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.SectorVector — Type
SectorVector{T, D<:AbstractVector{T}, S<:SectorRange} <: AbstractSectorArray{T, 1}A single sector with a data vector. Analogous to SectorMatrix but for 1-D data (eigenvalues, singular values, etc.). Each element is a symmetry scalar — there is no Wigner-Eckart structural factor; the sector label simply identifies which block the values belong to.
The stored SectorRange is always non-dual (codomain convention).
Base.zeros — Method
zeros(T, axs::GradedOneTo...)Create an AbelianGradedArray{T} with all allowed (zero-flux) blocks filled with zeros.
GradedArrays.contraction_twist! — Method
contraction_twist!(a::AbelianSectorArray, ndims_codomain::Int) -> aApply the twist convention for the supertrace formalism of fermionic contractions. This means that $⟨i| ⋅ |j⟩ = δᵢⱼ$, and $|i⟩ ⋅ ⟨j| = θᵢⱼ δᵢⱼ$. Here, $θᵢⱼ = ±1$ is defined as the phase from applying a self-crossing, which is always $1$ for bosonic symmetries, but can be $-1$ for odd fermion charges.
Equivalent to twist!(a, (i for i in 1:ndims_codomain if isdual(a, i))). A no-op unless BraidingStyle(sectortype(a)) is Fermionic.
See also twist!.
GradedArrays.data — Method
data(sa::AbstractSectorArray)Return the raw data array underlying the sector array.
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 GradedOneTo from pairs of SectorRange to multiplicities. All SectorRange values must have the same isdual flag. Non-dual inputs produce a non-dual axis; dual inputs produce a dual axis.
Examples
gradedrange([U1(0) => 2, U1(1) => 3]) # non-dual
gradedrange([U1(0)' => 2, U1(1)' => 3]) # dualGradedArrays.masked_inversion_parity — Method
Compute the parity of the number of inversions of a masked permutation
GradedArrays.twist! — Method
twist!(a::AbstractGradedArray, dims) -> aScale data(a) in place by prod(twist(sectoraxes(a, i)) for i in dims). Here, twist is defined as -1 for odd-parity fermionic charges and +1 otherwise.
This is a no-op unless BraidingStyle(sectortype(a)) is Fermionic.
See also contraction_twist!.