@@ -15,11 +15,13 @@ CategoryProduct(c::CategoryProduct) = _CategoryProduct(categories(c))
1515
1616categories (s:: CategoryProduct ) = s. cats
1717
18- const EmptyCategoryProduct = CategoryProduct{Tuple{}}
18+ const EmptyCategory = CategoryProduct{Tuple{}}
1919
2020# ================================= Sectors interface ====================================
2121function SymmetryStyle (c:: CategoryProduct )
22- return reduce (combine_styles, map (SymmetryStyle, categories (c)); init= EmptyCategory ())
22+ return reduce (
23+ combine_styles, map (SymmetryStyle, categories (c)); init= EmptyCategoryStyle ()
24+ )
2325end
2426
2527function quantum_dimension (:: NonAbelianGroup , s:: CategoryProduct )
151153
152154# ==================================== Fusion rules ======================================
153155# generic case: fusion returns a GradedAxes, even for fusion with Empty
156+ function fusion_rule (style:: SymmetryStyle , c1:: CategoryProduct , c2:: AbstractCategory )
157+ return fusion_rule (style, c1, CategoryProduct (c2))
158+ end
159+ function fusion_rule (style:: SymmetryStyle , c1:: AbstractCategory , c2:: CategoryProduct )
160+ return fusion_rule (style, CategoryProduct (c1), c2)
161+ end
162+
154163function fusion_rule (:: SymmetryStyle , s1:: CategoryProduct , s2:: CategoryProduct )
155164 return to_gradedrange (categories_fusion_rule (categories (s1), categories (s2)))
156165end
@@ -161,29 +170,29 @@ function fusion_rule(::AbelianGroup, s1::CategoryProduct, s2::CategoryProduct)
161170end
162171
163172# Empty case
164- function fusion_rule (:: EmptyCategory , :: EmptyCategoryProduct , :: EmptyCategoryProduct )
173+ function fusion_rule (:: EmptyCategoryStyle , :: EmptyCategory , :: EmptyCategory )
165174 return sector ()
166175end
167176
168- # EmptyCategory acts as trivial on any AbstractCategory, not just CategoryProduct
169- function fusion_rule (:: SymmetryStyle , :: EmptyCategoryProduct , c:: AbstractCategory )
177+ # EmptyCategoryStyle acts as trivial on any AbstractCategory, not just CategoryProduct
178+ function fusion_rule (:: SymmetryStyle , :: EmptyCategory , c:: AbstractCategory )
170179 return to_gradedrange (c)
171180end
172- function fusion_rule (:: SymmetryStyle , :: EmptyCategoryProduct , c :: CategoryProduct )
181+ function fusion_rule (:: SymmetryStyle , c :: AbstractCategory , :: EmptyCategory )
173182 return to_gradedrange (c)
174183end
175- function fusion_rule (:: SymmetryStyle , c :: AbstractCategory , :: EmptyCategoryProduct )
184+ function fusion_rule (:: SymmetryStyle , :: EmptyCategory , c :: CategoryProduct )
176185 return to_gradedrange (c)
177186end
178- function fusion_rule (:: SymmetryStyle , c:: CategoryProduct , :: EmptyCategoryProduct )
187+ function fusion_rule (:: SymmetryStyle , c:: CategoryProduct , :: EmptyCategory )
179188 return to_gradedrange (c)
180189end
181190
182191# abelian case: return Category
183- fusion_rule (:: AbelianGroup , :: EmptyCategoryProduct , c :: AbstractCategory ) = c
184- fusion_rule (:: AbelianGroup , :: EmptyCategoryProduct , c:: CategoryProduct ) = c
185- fusion_rule (:: AbelianGroup , c:: AbstractCategory , :: EmptyCategoryProduct ) = c
186- fusion_rule (:: AbelianGroup , c :: CategoryProduct , :: EmptyCategoryProduct ) = c
192+ fusion_rule (:: AbelianGroup , c :: AbstractCategory , :: EmptyCategory ) = c
193+ fusion_rule (:: AbelianGroup , :: EmptyCategory , c:: AbstractCategory ) = c
194+ fusion_rule (:: AbelianGroup , c:: CategoryProduct , :: EmptyCategory ) = c
195+ fusion_rule (:: AbelianGroup , :: EmptyCategory , c :: CategoryProduct ) = c
187196
188197# =============================== Ordered implementation =================================
189198CategoryProduct (t:: Tuple ) = _CategoryProduct (t)
217226
218227CategoryProduct (; kws... ) = CategoryProduct ((; kws... ))
219228
220- # avoid having 2 different kinds of EmptyCategory : cast empty NamedTuple to Tuple{}
229+ # avoid having 2 different kinds of EmptyCategoryStyle : cast empty NamedTuple to Tuple{}
221230CategoryProduct (:: NamedTuple{()} ) = CategoryProduct (())
222231
223232function CategoryProduct (pairs:: Pair... )
0 commit comments