Skip to content

Commit 36d2c6b

Browse files
committed
use the polynomial ring also for non-commutative baserings as _internal_poly_ring
1 parent ab1a517 commit 36d2c6b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/sage/rings/lazy_series_ring.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,6 +2716,13 @@ def __init__(self, basis, sparse=True, category=None):
27162716
...
27172717
ValueError: basis should be in GradedAlgebrasWithBasis
27182718
2719+
Check that :issue:`37625` is fixed::
2720+
2721+
sage: R = algebras.Free(QQ, ('a', 'b'), degrees=(1, 2))
2722+
sage: L = R.completion()
2723+
sage: a, b = R.gens()
2724+
sage: (L(a) + L(b))^2
2725+
a^2 + (a*b+b*a) + b^2
27192726
"""
27202727
base_ring = basis.base_ring()
27212728
self._minimal_valuation = 0
@@ -2738,11 +2745,7 @@ def __init__(self, basis, sparse=True, category=None):
27382745
Parent.__init__(self, base=base_ring, category=category)
27392746
self._sparse = sparse
27402747
self._laurent_poly_ring = basis
2741-
if self._laurent_poly_ring not in Rings().Commutative():
2742-
from sage.algebras.free_algebra import FreeAlgebra
2743-
self._internal_poly_ring = FreeAlgebra(self._laurent_poly_ring, 1, "DUMMY_VARIABLE")
2744-
else:
2745-
self._internal_poly_ring = PolynomialRing(self._laurent_poly_ring, "DUMMY_VARIABLE", sparse=sparse)
2748+
self._internal_poly_ring = PolynomialRing(self._laurent_poly_ring, "DUMMY_VARIABLE", sparse=sparse)
27462749

27472750
def _repr_(self):
27482751
"""

0 commit comments

Comments
 (0)