Skip to content

Commit bb3d701

Browse files
committed
k-regular sequences: extend category to Algebra
1 parent ceb3c79 commit bb3d701

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/sage/combinat/k_regular_sequence.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,10 @@ class kRegularSequenceSpace(RecognizableSeriesSpace):
895895
Element = kRegularSequence
896896

897897
@classmethod
898-
def __normalize__(cls, k, coefficient_ring, **kwds):
898+
def __normalize__(cls, k,
899+
coefficient_ring,
900+
category=None,
901+
**kwds):
899902
r"""
900903
Normalizes the input in order to ensure a unique
901904
representation.
@@ -906,13 +909,17 @@ def __normalize__(cls, k, coefficient_ring, **kwds):
906909
907910
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
908911
sage: Seq2.category()
909-
Category of modules over Integer Ring
912+
Category of algebras over Integer Ring
910913
sage: Seq2.alphabet()
911914
{0, 1}
912915
"""
913916
from sage.arith.srange import srange
917+
from sage.categories.algebras import Algebras
918+
category = category or Algebras(coefficient_ring)
914919
nargs = super().__normalize__(coefficient_ring,
915-
alphabet=srange(k), **kwds)
920+
alphabet=srange(k),
921+
category=category,
922+
**kwds)
916923
return (k,) + nargs
917924

918925
def __init__(self, k, *args, **kwds):

0 commit comments

Comments
 (0)