Skip to content

Commit

Permalink
use NotAbelianStyle in categories_fusion_rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ogauthe committed Oct 3, 2024
1 parent a7a860d commit 0089c58
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions NDTensors/src/lib/Sectors/src/category_product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,23 @@ end

function shared_categories_fusion_rule(shared1, shared2)
fused = map(fusion_rule, values(shared1), values(shared2))
factorized = factorize_gradedaxes(fused)
type_fixed = recover_category_product_type(typeof(shared1), factorized)
return type_fixed
return recover_style(typeof(shared1), fused)
end

# abelian case: there is no gradedaxis
factorize_gradedaxes(fused::Tuple{Vararg{AbstractCategory}}) = fused
function recover_style(T::Type, fused)
style = reduce(combine_styles, SymmetryStyle.(fused); init=AbelianStyle())
return recover_category_product_type(style, T, fused)
end

# non-abelian case
function factorize_gradedaxes(fused::Tuple)
# here fused contains at least one GradedOneTo
g0 = reduce(×, fused)
function recover_category_product_type(::AbelianStyle, T::Type, fused)
return recover_category_product_type(T, fused)
end

function recover_category_product_type(::NotAbelianStyle, T::Type, fused)
factorized = reduce(×, fused)
# convention: keep unsorted blocklabels as produced by F order loops in ×
return g0
type_fixed = recover_category_product_type(T, factorized)
return type_fixed
end

function recover_category_product_type(T::Type, g0::AbstractGradedUnitRange)
Expand Down

0 comments on commit 0089c58

Please sign in to comment.