Skip to content

Commit 352bc77

Browse files
committed
Fixing the linter; updating and adding some doctests.
1 parent daf2847 commit 352bc77

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

src/sage/algebras/lie_algebras/center_uea.py

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,16 +454,49 @@ class CenterUEA(CombinatorialFreeModule):
454454
sage: all(v * g == g * v for g in U.algebra_generators() for v in elts) # long time
455455
True
456456
457+
The Heisenberg Lie algebra `H_4` over a finite field; note the basis
458+
elements `b^p \in Z(U(H_4))` for the basis elements `b \in H_4`::
459+
457460
sage: g = lie_algebras.Heisenberg(GF(3), 4)
458461
sage: U = g.pbw_basis()
459462
sage: Z = U.center()
460463
sage: B = Z.basis()
461464
sage: it = iter(B)
462465
sage: center_elts = [next(it) for _ in range(12)]; center_elts
463466
[1, Z[0], Z[0]^2, Z[0]^3, Z[1], Z[2], Z[3], Z[4], Z[5], Z[6], Z[7], Z[8]]
464-
sage: elts = [U(v) for v in center_elts]; set(elts)
465-
{1, PBW['p1']^3, PBW['p2']^3, PBW['p3']^3, PBW['p4']^3, PBW['q1']^3,
466-
PBW['q2']^3, PBW['q3']^3, PBW['q4']^3, PBW['z'], PBW['z']^2, PBW['z']^3}
467+
sage: elts = [U(v) for v in center_elts]; elts
468+
[1, PBW['z'], PBW['z']^2, PBW['z']^3, PBW['p1']^3, PBW['p2']^3, PBW['p3']^3,
469+
PBW['p4']^3, PBW['q1']^3, PBW['q2']^3, PBW['q3']^3, PBW['q4']^3]
470+
sage: all(v * g == g * v for g in U.algebra_generators() for v in elts)
471+
True
472+
473+
An example with a free 4-step nilpotent Lie algebras on 2 generators::
474+
475+
sage: L = LieAlgebra(QQ, 2, step=4); L
476+
Free Nilpotent Lie algebra on 8 generators
477+
(X_1, X_2, X_12, X_112, X_122, X_1112, X_1122, X_1222) over Rational Field
478+
sage: U = L.pbw_basis()
479+
sage: Z = U.center()
480+
sage: it = iter(Z.basis())
481+
sage: center_elts = [next(it) for _ in range(10)]; center_elts
482+
[1, Z[0], Z[1], Z[2], Z[0]^2, Z[0]*Z[1], Z[0]*Z[2], Z[1]^2, Z[1]*Z[2], Z[2]^2]
483+
sage: elts = [U(v) for v in center_elts]; elts
484+
[1, PBW[(1, 1, 1, 2)], PBW[(1, 1, 2, 2)], PBW[(1, 2, 2, 2)], PBW[(1, 1, 1, 2)]^2,
485+
PBW[(1, 1, 1, 2)]*PBW[(1, 1, 2, 2)], PBW[(1, 1, 1, 2)]*PBW[(1, 2, 2, 2)],
486+
PBW[(1, 1, 2, 2)]^2, PBW[(1, 1, 2, 2)]*PBW[(1, 2, 2, 2)], PBW[(1, 2, 2, 2)]^2]
487+
sage: all(v * g == g * v for g in U.algebra_generators() for v in elts)
488+
True
489+
490+
Using the Engel Lie algebra::
491+
492+
sage: L.<X,Y,Z> = LieAlgebra(QQ, {('X','Y'): {'Z': 1}}, nilpotent=True)
493+
sage: U = L.pbw_basis()
494+
sage: Z = U.center()
495+
sage: it = iter(Z.basis())
496+
sage: center_elts = [next(it) for _ in range(6)]; center_elts
497+
[1, Z[0], Z[0]^2, Z[0]^3, Z[0]^4, Z[0]^5]
498+
sage: elts = [U(v) for v in center_elts]; elts
499+
[1, PBW['Z'], PBW['Z']^2, PBW['Z']^3, PBW['Z']^4, PBW['Z']^5]
467500
sage: all(v * g == g * v for g in U.algebra_generators() for v in elts)
468501
True
469502
"""

src/sage/algebras/lie_algebras/poincare_birkhoff_witt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,6 @@ def center(self):
584584
from sage.algebras.lie_algebras.center_uea import CenterUEA
585585
return CenterUEA(self._g, self)
586586

587-
588587
class Element(CombinatorialFreeModule.Element):
589588
def _act_on_(self, x, self_on_left):
590589
"""

src/sage/categories/finite_dimensional_lie_algebras_with_basis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,6 @@ def to_prod(vec, index):
19271927
return [UEA.sum(to_prod(vec, index) for index in vec.support())
19281928
for vec in tens]
19291929

1930-
19311930
class ElementMethods:
19321931
def adjoint_matrix(self, sparse=False): # In #11111 (more or less) by using matrix of a morphism
19331932
"""

0 commit comments

Comments
 (0)