Skip to content

Commit bc15e9c

Browse files
committed
fixing category of ncsym and dual
1 parent 1cf0c13 commit bc15e9c

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/sage/combinat/ncsym/dual.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
66
- Travis Scrimshaw (08-04-2013): Initial version
77
"""
8-
#*****************************************************************************
8+
# ****************************************************************************
99
# Copyright (C) 2013 Travis Scrimshaw <tscrim at ucdavis.edu>
1010
#
1111
# Distributed under the terms of the GNU General Public License (GPL)
12-
# http://www.gnu.org/licenses/
13-
#*****************************************************************************
12+
# https://www.gnu.org/licenses/
13+
# ****************************************************************************
1414

1515
from sage.misc.lazy_attribute import lazy_attribute
1616
from sage.misc.misc_c import prod
@@ -50,7 +50,7 @@ def __init__(self, R):
5050
# change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
5151
assert(R in Fields() or R in Rings()) # side effect of this statement assures MRO exists for R
5252
self._base = R # Won't be needed once CategoryObject won't override base_ring
53-
category = GradedHopfAlgebras(R) # TODO: .Commutative()
53+
category = GradedHopfAlgebras(R).Commutative()
5454
Parent.__init__(self, category=category.WithRealizations())
5555

5656
# Bases
@@ -103,7 +103,7 @@ def dual(self):
103103

104104
class w(NCSymBasis_abstract):
105105
r"""
106-
The Hopf algebra of symmetric functions in non-commuting variables
106+
The dual Hopf algebra of symmetric functions in non-commuting variables
107107
in the `\mathbf{w}` basis.
108108
109109
EXAMPLES::
@@ -134,10 +134,14 @@ def __init__(self, NCSymD):
134134
"""
135135
def key_func_set_part(A):
136136
return sorted(map(sorted, A))
137-
CombinatorialFreeModule.__init__(self, NCSymD.base_ring(), SetPartitions(),
137+
138+
R = NCSymD.base_ring()
139+
category = GradedHopfAlgebras(R).Commutative()
140+
category &= NCSymDualBases(NCSymD)
141+
CombinatorialFreeModule.__init__(self, R, SetPartitions(),
138142
prefix='w', bracket=False,
139143
sorting_key=key_func_set_part,
140-
category=NCSymDualBases(NCSymD))
144+
category=category)
141145

142146
@lazy_attribute
143147
def to_symmetric_function(self):

src/sage/combinat/ncsym/ncsym.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def __init__(self, R):
296296
# change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
297297
assert(R in Fields() or R in Rings()) # side effect of this statement assures MRO exists for R
298298
self._base = R # Won't be needed once CategoryObject won't override base_ring
299-
category = GradedHopfAlgebras(R) # TODO: .Cocommutative()
299+
category = GradedHopfAlgebras(R).Cocommutative()
300300
Parent.__init__(self, category=category.WithRealizations())
301301

302302
def _repr_(self):
@@ -361,9 +361,13 @@ def __init__(self, NCSym):
361361
sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
362362
sage: TestSuite(NCSym.m()).run()
363363
"""
364-
CombinatorialFreeModule.__init__(self, NCSym.base_ring(), SetPartitions(),
364+
R = NCSym.base_ring()
365+
category = GradedHopfAlgebras(R).Cocommutative()
366+
category &= NCSymBases(NCSym)
367+
368+
CombinatorialFreeModule.__init__(self, R, SetPartitions(),
365369
prefix='m', bracket=False,
366-
category=NCSymBases(NCSym))
370+
category=category)
367371

368372
@cached_method
369373
def _m_to_p_on_basis(self, A):

0 commit comments

Comments
 (0)