33# TBD
44# compatibility with TensorKit conventions?
55
6- using GradedArrays: GradedArrays, AbstractGradedUnitRange, flip, isdual, sector_type
7- using GradedArrays. SymmetrySectors :
6+ using GradedArrays:
7+ GradedArrays,
88 × ,
9+ AbstractGradedUnitRange,
910 AbstractSector,
1011 SectorProduct,
11- SymmetrySectors,
1212 arguments,
13+ flip,
14+ flip_dual,
15+ isdual,
1316 nsymbol,
17+ sector_multiplicities,
18+ sector_type,
19+ sectors,
1420 to_gradedrange,
1521 trivial
1622using TensorAlgebra: flatten_tuples
@@ -41,7 +47,7 @@ using TensorProducts: ⊗
4147#
4248#
4349# The interface uses AbstractGradedArrays as input for interface simplicity
44- # however only blocklabels are used and blocklengths are never read.
50+ # however only sectors are used and blocklengths are never read.
4551
4652struct SectorFusionTree{S,N,M}
4753 leaves:: NTuple{N,S} # TBD rename outer_sectors or leave_sectors?
@@ -98,8 +104,7 @@ function GradedArrays.flip(f::SectorFusionTree)
98104 )
99105end
100106
101- # SymmetrySectors interface
102- function SymmetrySectors.:× (f1:: SectorFusionTree , f2:: SectorFusionTree )
107+ function GradedArrays.:× (f1:: SectorFusionTree , f2:: SectorFusionTree )
103108 @assert arrows (f1) == arrows (f2)
104109 product_leaves = .× (leaves (f1), leaves (f2))
105110 product_root_sector = root_sector (f1) × root_sector (f2)
@@ -120,7 +125,7 @@ function SymmetrySectors.:×(f1::SectorFusionTree, f2::SectorFusionTree)
120125 )
121126end
122127
123- function SymmetrySectors . arguments (f:: SectorFusionTree{<:SectorProduct} )
128+ function GradedArrays . arguments (f:: SectorFusionTree{<:SectorProduct} )
124129 transposed_indices = outer_multiplicity_split .(
125130 Base. tail (leaves (f)),
126131 branch_sectors (f),
@@ -144,11 +149,11 @@ function SymmetrySectors.arguments(f::SectorFusionTree{<:SectorProduct})
144149 )
145150end
146151
147- function SymmetrySectors . arguments (f:: SectorFusionTree{<:SectorProduct,0} )
152+ function GradedArrays . arguments (f:: SectorFusionTree{<:SectorProduct,0} )
148153 return map (arg -> SectorFusionTree ((), (), arg, (), ()), arguments (root_sector (f)))
149154end
150155
151- function SymmetrySectors . arguments (f:: SectorFusionTree{<:SectorProduct,1} )
156+ function GradedArrays . arguments (f:: SectorFusionTree{<:SectorProduct,1} )
152157 arguments_root = arguments (root_sector (f))
153158 arguments_leave = arguments (only (leaves (f)))
154159 # use map(keys) to stay agnostic with respect to SectorProduct implementation
@@ -164,7 +169,7 @@ fusiontree_eltype(::Type{<:AbstractSector}) = Float64
164169function build_trees (legs:: Vararg{AbstractGradedUnitRange} )
165170 # construct all authorized trees for each outer block in legs
166171 tree_arrows = isdual .(legs)
167- return mapreduce (vcat, Iterators. product (blocklabels .( legs)... )) do it
172+ return mapreduce (vcat, Iterators. product (sectors .( flip_dual .( legs) )... )) do it
168173 return build_trees (it, tree_arrows)
169174 end
170175end
@@ -240,7 +245,9 @@ function fuse_next_sector(
240245 parent_tree:: SectorFusionTree , branch_sector:: AbstractSector , level_arrow:: Bool
241246)
242247 new_space = to_gradedrange (root_sector (parent_tree) ⊗ branch_sector)
243- return mapreduce (vcat, zip (blocklabels (new_space), blocklengths (new_space))) do (la, n)
248+ return mapreduce (
249+ vcat, zip (sectors (new_space), sector_multiplicities (new_space))
250+ ) do (la, n)
244251 return [
245252 append_tree_leave (parent_tree, branch_sector, level_arrow, la, outer_mult) for
246253 outer_mult in 1 : n
0 commit comments