Skip to content

Commit 77ef307

Browse files
committed
split shared and diff category
1 parent f325011 commit 77ef307

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

NDTensors/src/lib/Sectors/src/category_product.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ categories_isless(::Tuple, ::NamedTuple) = throw(ArgumentError("Not implemented"
7474
categories_type(::Type{<:CategoryProduct{T}}) where {T} = T
7575

7676
function categories_fusion_rule(cats1, cats2)
77+
shared_cat = shared_categories_fusion_rule(categories_common(cats1, cats2)...)
7778
diff_cat = CategoryProduct(categories_diff(cats1, cats2))
78-
shared1, shared2 = categories_common(cats1, cats2)
79+
return shared_cat × diff_cat
80+
end
81+
82+
function shared_categories_fusion_rule(shared1, shared2)
7983
fused = map(fusion_rule, values(shared1), values(shared2))
8084
factorized = factorize_gradedaxes(fused)
8185
type_fixed = recover_category_product_type(typeof(shared1), factorized)
82-
return type_fixed × diff_cat
86+
return type_fixed
8387
end
8488

8589
# abelian case: there is no gradedaxis

0 commit comments

Comments
 (0)