Skip to content

Commit ae9be4f

Browse files
author
Release Manager
committed
gh-36169: Implementation of representations of Lie algebras <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We provide an implementation of two classes of representations of Lie algebras: the trivial representation and those defined by explicitly giving the matrices. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36169 Reported by: Travis Scrimshaw Reviewer(s): Frédéric Chapoton, Travis Scrimshaw
2 parents f33213d + 2aea063 commit ae9be4f

File tree

4 files changed

+511
-5
lines changed

4 files changed

+511
-5
lines changed

src/doc/en/reference/algebras/lie_algebras.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Lie Algebras
1919
sage/algebras/lie_algebras/poincare_birkhoff_witt
2020
sage/algebras/lie_algebras/quotient
2121
sage/algebras/lie_algebras/rank_two_heisenberg_virasoro
22+
sage/algebras/lie_algebras/representation
2223
sage/algebras/lie_algebras/structure_coefficients
2324
sage/algebras/lie_algebras/subalgebra
2425
sage/algebras/lie_algebras/symplectic_derivation

src/sage/algebras/lie_algebras/lie_algebra_element.pyx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,9 +1232,9 @@ cdef class UntwistedAffineLieAlgebraElement(Element):
12321232
return type(self)(self._parent, negate(self._t_dict),
12331233
-self._c_coeff, -self._d_coeff)
12341234

1235-
cpdef _acted_upon_(self, x, bint self_on_left) noexcept:
1235+
cpdef _acted_upon_(self, scalar, bint self_on_left) noexcept:
12361236
"""
1237-
Return ``self`` acted upon by ``x``.
1237+
Return ``self`` acted upon by ``scalar``.
12381238
12391239
EXAMPLES::
12401240
@@ -1246,9 +1246,21 @@ cdef class UntwistedAffineLieAlgebraElement(Element):
12461246
sage: -2 * x
12471247
(-2*E[alpha[1]])#t^0 + (-2*h1)#t^-1 + -6*c + 4/5*d
12481248
"""
1249-
return type(self)(self._parent, scal(x, self._t_dict, self_on_left),
1250-
x * self._c_coeff,
1251-
x * self._d_coeff)
1249+
# This was copied and IDK if it still applies (TCS):
1250+
# With the current design, the coercion model does not have
1251+
# enough information to detect apriori that this method only
1252+
# accepts scalars; so it tries on some elements(), and we need
1253+
# to make sure to report an error.
1254+
scalar_parent = parent(scalar)
1255+
if scalar_parent != self._parent.base_ring():
1256+
# Temporary needed by coercion (see Polynomial/FractionField tests).
1257+
if self._parent.base_ring().has_coerce_map_from(scalar_parent):
1258+
scalar = self._parent.base_ring()(scalar)
1259+
else:
1260+
return None
1261+
return type(self)(self._parent, scal(scalar, self._t_dict, self_on_left),
1262+
scalar * self._c_coeff,
1263+
scalar * self._d_coeff)
12521264

12531265
cpdef monomial_coefficients(self, bint copy=True) noexcept:
12541266
"""

0 commit comments

Comments
 (0)