Skip to content

Commit 4ffbe41

Browse files
committed
Fixing doctest failures due to changes in the plural ring implementation.
1 parent 4f929a7 commit 4ffbe41

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

src/sage/algebras/lie_algebras/lie_algebra_element.pyx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,21 @@ cdef class LieAlgebraElement(IndexedFreeModuleElement):
156156
PBW[-1] + PBW[0] - 3*PBW[1]
157157
"""
158158
UEA = self._parent.universal_enveloping_algebra()
159-
try:
160-
gen_dict = UEA.algebra_generators()
161-
except (TypeError, AttributeError):
162-
gen_dict = UEA.gens_dict()
163159
s = UEA.zero()
164160
if not self:
165161
return s
166162
# Special hook for when the index set of the parent of ``self``
167163
# does not match the generators index set of the UEA.
168164
if hasattr(self._parent, '_UEA_names_map'):
169165
names_map = self._parent._UEA_names_map
166+
gen_dict = UEA.gens_dict()
170167
for t, c in self._monomial_coefficients.items():
171168
s += c * gen_dict[names_map[t]]
172169
else:
170+
try:
171+
gen_dict = UEA.algebra_generators()
172+
except (TypeError, AttributeError):
173+
gen_dict = UEA.gens_dict()
173174
for t, c in self._monomial_coefficients.items():
174175
s += c * gen_dict[t]
175176
return s

src/sage/categories/finite_dimensional_lie_algebras_with_basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
# ****************************************************************************
10-
# Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com>
10+
# Copyright (C) 2013-2024 Travis Scrimshaw <tcscrims at gmail.com>
1111
#
1212
# This program is free software: you can redistribute it and/or modify
1313
# it under the terms of the GNU General Public License as published by

src/sage/categories/lie_algebras_with_basis.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"""
88

99
#*****************************************************************************
10-
# Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com>
10+
# Copyright (C) 2013-2024 Travis Scrimshaw <tcscrims at gmail.com>
1111
#
1212
# This program is free software: you can redistribute it and/or modify
1313
# it under the terms of the GNU General Public License as published by
1414
# the Free Software Foundation, either version 2 of the License, or
1515
# (at your option) any later version.
16-
# http://www.gnu.org/licenses/
16+
# https://www.gnu.org/licenses/
1717
#*****************************************************************************
1818

1919
from sage.misc.abstract_method import abstract_method
@@ -239,20 +239,21 @@ def lift(self):
239239
"""
240240
P = self.parent()
241241
UEA = P.universal_enveloping_algebra()
242-
try:
243-
gen_dict = UEA.algebra_generators()
244-
except (TypeError, AttributeError):
245-
gen_dict = UEA.gens_dict()
246242
s = UEA.zero()
247243
if not self:
248244
return s
249245
# Special hook for when the index set of the parent of ``self``
250246
# does not match the generators index set of the UEA.
251247
if hasattr(P, '_UEA_names_map'):
252248
names_map = P._UEA_names_map
249+
gen_dict = UEA.gens_dict()
253250
for t, c in self.monomial_coefficients(copy=False).items():
254251
s += c * gen_dict[names_map[t]]
255252
else:
253+
try:
254+
gen_dict = UEA.algebra_generators()
255+
except (TypeError, AttributeError):
256+
gen_dict = UEA.gens_dict()
256257
for t, c in self.monomial_coefficients(copy=False).items():
257258
s += c * gen_dict[t]
258259
return s

src/sage/rings/polynomial/plural.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,12 @@ cdef class NCPolynomialRing_plural(Ring):
863863
EXAMPLES::
864864
865865
sage: A.<x,y,z> = FreeAlgebra(QQ, 3)
866-
sage: P = A.g_algebra(relations={y*x:-x*y}, order = 'lex')
866+
sage: P = A.g_algebra(relations={y*x:-x*y}, order='lex')
867867
sage: P.algebra_generators()
868-
Family (x, y, z)
868+
Finite family {'x': x, 'y': y, 'z': z}
869869
"""
870870
from sage.sets.family import Family
871-
return Family(self.gens())
871+
return Family(self.gens_dict())
872872

873873
def ideal(self, *gens, **kwds):
874874
"""

0 commit comments

Comments
 (0)