Skip to content

Commit 1a3893d

Browse files
committed
rename to subblockstructure
1 parent 543953d commit 1a3893d

5 files changed

Lines changed: 16 additions & 47 deletions

File tree

‎src/tensors/abstracttensor.jl‎

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -345,39 +345,8 @@ Verify whether a tensor has a block corresponding to a coupled sector `c`.
345345
"""
346346
hasblock(t::AbstractTensorMap, c::Sector) = c ∈ blocksectors(t)
347347

348-
# TODO: convenience methods, do we need them?
349-
# """
350-
# blocksize(t::AbstractTensorMap, c::Sector) -> Tuple{Int,Int}
351-
352-
# Return the size of the matrix block of a tensor corresponding to a coupled sector `c`.
353-
354-
# See also [`blockdim`](@ref) and [`blockrange`](@ref).
355-
# """
356-
# function blocksize(t::AbstractTensorMap, c::Sector)
357-
# return fusionblockstructure(t).blockstructure[c][1]
358-
# end
359-
360-
# """
361-
# blockdim(t::AbstractTensorMap, c::Sector) -> Int
362-
363-
# Return the total dimension (length) of the matrix block of a tensor corresponding to
364-
# a coupled sector `c`.
365-
366-
# See also [`blocksize`](@ref) and [`blockrange`](@ref).
367-
# """
368-
# function blockdim(t::AbstractTensorMap, c::Sector)
369-
# return *(blocksize(t, c)...)
370-
# end
371-
372-
# """
373-
# blockrange(t::AbstractTensorMap, c::Sector) -> UnitRange{Int}
374-
375-
# Return the range at which to find the matrix block of a tensor corresponding to a
376-
# coupled sector `c`, within the total data vector of length `dim(t)`.
377-
# """
378-
# function blockrange(t::AbstractTensorMap, c::Sector)
379-
# return fusionblockstructure(t).blockstructure[c][2]
380-
# end
348+
blockstructure(t::AbstractTensorMap) = blockstructure(space(t))
349+
subblockstructure(t::AbstractTensorMap) = subblockstructure(space(t))
381350

382351
"""
383352
fusiontrees(t::AbstractTensorMap)

‎src/tensors/braidingtensor.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function block(b::BraidingTensor, s::Sector)
145145

146146
base_offset = first(blockstructure(b)[s][2]) - 1
147147

148-
for ((f1, f2), (sz, str, off)) in pairs(fusiontreestructure(space(b)))
148+
for ((f1, f2), (sz, str, off)) in pairs(subblockstructure(space(b)))
149149
if (f1.uncoupled != reverse(f2.uncoupled)) || !(f1.coupled == f2.coupled == s)
150150
continue
151151
end

‎src/tensors/tensor.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ end
487487
function subblock(
488488
t::TensorMap{T, S, N₁, N₂}, (f₁, f₂)::Tuple{FusionTree{I, N₁}, FusionTree{I, N₂}}
489489
) where {T, S, N₁, N₂, I <: Sector}
490-
fts = fusiontreestructure(space(t))
490+
fts = subblockstructure(space(t))
491491
found, token = gettoken(fts, (f₁, f₂))
492492
@boundscheck found || throw(SectorMismatch(lazy"fusion tree pair ($(f₁, f₂)) is not present"))
493493
@inbounds begin

‎src/tensors/tensorstructure.jl‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ strides that depend on the degeneracy (multiplicity) dimensions. Specific to a g
6363
- `totaldim`: total number of elements in the flat data vector.
6464
- `blockstructure`: `Vector` of `((d₁, d₂), range)` values, one per coupled sector, in the
6565
same order as [`sectorstructure`](@ref)`.blocksectors`.
66-
- `fusiontreestructure`: `Vector` of [`StridedStructure`](@ref) `(sizes, strides, offset)`
66+
- `subblockstructure`: `Vector` of [`StridedStructure`](@ref) `(sizes, strides, offset)`
6767
values, one per fusion tree pair, in the same order as
6868
[`sectorstructure`](@ref)`.fusiontrees`.
6969
@@ -72,7 +72,7 @@ See also [`degeneracystructure`](@ref), [`SectorStructure`](@ref).
7272
struct DegeneracyStructure{N}
7373
totaldim::Int
7474
blockstructure::Vector{Tuple{Tuple{Int, Int}, UnitRange{Int}}}
75-
fusiontreestructure::Vector{StridedStructure{N}}
75+
subblockstructure::Vector{StridedStructure{N}}
7676
end
7777

7878
function degeneracystructuretype(W::HomSpace)
@@ -135,7 +135,7 @@ Compute the [`DegeneracyStructure`](@ref) for `W`, describing block sizes, data
135135
sub-block strides. The result is cached per `HomSpace` instance (keyed by object identity,
136136
since degeneracy dimensions affect the block sizes and offsets).
137137
138-
See also [`sectorstructure`](@ref), [`blockstructure`](@ref), [`fusiontreestructure`](@ref).
138+
See also [`sectorstructure`](@ref), [`blockstructure`](@ref), [`subblockstructure`](@ref).
139139
""" degeneracystructure(::HomSpace)
140140
@cached function degeneracystructure(W::HomSpace)::degeneracystructuretype(W)
141141
codom = codomain(W)
@@ -235,7 +235,7 @@ cached based on the sector structure of `W` (ignoring degeneracy dimensions), so
235235
`HomSpace`s that share the same sectors, dualities, and index count will reuse the same
236236
object.
237237
238-
See also [`sectorstructure`](@ref), [`fusiontreestructure`](@ref).
238+
See also [`sectorstructure`](@ref), [`subblockstructure`](@ref).
239239
"""
240240
fusiontrees(W::HomSpace) = sectorstructure(W).fusiontrees
241241

@@ -250,22 +250,22 @@ Return a `Dictionary` mapping each coupled sector `c::I` to a tuple `((d₁, d
250250
where `d₁` and `d₂` are the block dimensions for the codomain and domain respectively,
251251
and `r` is the corresponding index range in the flat data vector.
252252
253-
See also [`degeneracystructure`](@ref), [`fusiontreestructure`](@ref).
253+
See also [`degeneracystructure`](@ref), [`subblockstructure`](@ref).
254254
"""
255255
function blockstructure(W::HomSpace)
256256
return Dictionary(sectorstructure(W).blocksectors, degeneracystructure(W).blockstructure)
257257
end
258258

259259
"""
260-
fusiontreestructure(W::HomSpace) -> Dictionary
260+
subblockstructure(W::HomSpace) -> Dictionary
261261
262262
Return a `Dictionary` mapping each fusion tree pair `(f₁, f₂)` to its
263263
[`StridedStructure`](@ref) `(sizes, strides, offset)`.
264264
265265
See also [`degeneracystructure`](@ref), [`blockstructure`](@ref).
266266
"""
267-
function fusiontreestructure(W::HomSpace)
268-
return Dictionary(sectorstructure(W).fusiontrees, degeneracystructure(W).fusiontreestructure)
267+
function subblockstructure(W::HomSpace)
268+
return Dictionary(sectorstructure(W).fusiontrees, degeneracystructure(W).subblockstructure)
269269
end
270270

271271
# Diagonal ranges

‎src/tensors/treetransformers.jl‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ end
1616
function AbelianTreeTransformer(transform, p, Vdst, Vsrc)
1717
t₀ = Base.time()
1818
permute(Vsrc, p) == Vdst || throw(SpaceMismatch("Incompatible spaces for permuting."))
19-
fts_src = fusiontreestructure(Vsrc)
20-
fts_dst = fusiontreestructure(Vdst)
19+
fts_src = subblockstructure(Vsrc)
20+
fts_dst = subblockstructure(Vdst)
2121
L = length(fts_src)
2222
T = sectorscalartype(sectortype(Vdst))
2323
N = numind(Vsrc)
@@ -55,8 +55,8 @@ end
5555
function GenericTreeTransformer(transform, p, Vdst, Vsrc)
5656
t₀ = Base.time()
5757
permute(Vsrc, p) == Vdst || throw(SpaceMismatch("Incompatible spaces for permuting."))
58-
fusionstructure_dst = fusiontreestructure(Vdst)
59-
fusionstructure_src = fusiontreestructure(Vsrc)
58+
fusionstructure_dst = subblockstructure(Vdst)
59+
fusionstructure_src = subblockstructure(Vsrc)
6060
I = sectortype(Vsrc)
6161

6262
treelist_src = keys(fusionstructure_src)

0 commit comments

Comments
 (0)