From ecbe4d0142b2fa7961151c1e82d63786c41439f6 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Fri, 1 Sep 2023 14:42:23 +0900 Subject: [PATCH 1/2] Fix the ascii art for the Heisenberg Lie algebras. --- src/sage/algebras/lie_algebras/heisenberg.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/sage/algebras/lie_algebras/heisenberg.py b/src/sage/algebras/lie_algebras/heisenberg.py index 629fb0a8306..519b39546b6 100644 --- a/src/sage/algebras/lie_algebras/heisenberg.py +++ b/src/sage/algebras/lie_algebras/heisenberg.py @@ -122,6 +122,21 @@ def _repr_term(self, m): """ return m + def _ascii_art_term(self, m): + r""" + Return a string representation of the term indexed by ``m``. + + EXAMPLES:: + + sage: H = lie_algebras.Heisenberg(QQ, 3) + sage: H._ascii_art_term('p1') + p1 + sage: H._ascii_art_term('z') + z + """ + from sage.typeset.ascii_art import ascii_art + return ascii_art(m) + def _latex_term(self, m): r""" Return a string representation of the term indexed by ``m``. From 098ce29ff0749d7d88cb3c850a439328c4ea4641 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Fri, 1 Sep 2023 14:57:08 +0900 Subject: [PATCH 2/2] Adding a doctest calling ascii_art on a Heisenberg Lie algebra element. --- src/sage/algebras/lie_algebras/heisenberg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/algebras/lie_algebras/heisenberg.py b/src/sage/algebras/lie_algebras/heisenberg.py index 519b39546b6..ccb43936416 100644 --- a/src/sage/algebras/lie_algebras/heisenberg.py +++ b/src/sage/algebras/lie_algebras/heisenberg.py @@ -133,6 +133,8 @@ def _ascii_art_term(self, m): p1 sage: H._ascii_art_term('z') z + sage: ascii_art(sum(i * b for i, b in enumerate(H.basis()))) + p2 + 2*p3 + 3*q1 + 4*q2 + 5*q3 + 6*z """ from sage.typeset.ascii_art import ascii_art return ascii_art(m)