Skip to content

Commit c4ac757

Browse files
committed
Fixing some details.
1 parent e47b1c5 commit c4ac757

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/sage/algebras/lie_algebras/lie_algebra_element.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ cdef class UntwistedAffineLieAlgebraElement(Element):
12341234

12351235
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

src/sage/algebras/lie_algebras/representation.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,25 @@ def __classcall_private__(cls, lie_algebra, f=None, index_set=None, on_basis=Fal
189189
190190
sage: L.<x,y> = LieAlgebra(QQ, {('x','y'): {'y':1}})
191191
sage: f = {'x': Matrix([[1,0]]), 'y': Matrix([[0,1]])}
192-
sage: R = L.representation(f)
192+
sage: L.representation(f)
193193
Traceback (most recent call last):
194194
...
195195
ValueError: all matrices must be square
196196
197197
sage: f = {'x': Matrix([[1,0],[0,0]]), 'y': Matrix([[0]])}
198-
sage: R = L.representation(f)
198+
sage: L.representation(f)
199199
Traceback (most recent call last):
200200
...
201201
ValueError: all matrices must be square of size 2
202+
203+
sage: L.representation(index_set=[1,2,3])
204+
Traceback (most recent call last):
205+
...
206+
ValueError: either 'f' or 'on_basis' must be specified
207+
sage: L.representation(on_basis=lambda x: QQ.zero())
208+
Traceback (most recent call last):
209+
...
210+
ValueError: the index set needs to be specified
202211
"""
203212
from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
204213
base = lie_algebra.base_ring()

src/sage/categories/lie_algebras.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -711,14 +711,14 @@ def trivial_representation(self):
711711
from sage.algebras.lie_algebras.representation import TrivialRepresentation
712712
return TrivialRepresentation(self)
713713

714-
def representation(self, f=None, index_set=None, on_basis=None, **kwargs):
714+
def representation(self, f=None, index_set=None, on_basis=False, **kwargs):
715715
"""
716716
Return a representation of ``self``.
717717
718718
If no arguments are given, then this returns the trivial
719719
representation.
720720
721-
Currently the only implementated method of constructing a
721+
Currently the only implemented method of constructing a
722722
representation is by explicitly specifying the action of
723723
724724
* the elements of ``self`` by matrices;
@@ -750,10 +750,8 @@ def representation(self, f=None, index_set=None, on_basis=None, **kwargs):
750750
sage: L.representation()
751751
Trivial representation of Lie algebra on 2 generators (x, y) over Rational Field
752752
"""
753-
if f is None and on_basis is None and index_set is None:
753+
if f is None and on_basis is False and index_set is None:
754754
return self.trivial_representation(**kwargs)
755-
if on_basis is None:
756-
on_basis = False
757755
from sage.algebras.lie_algebras.representation import RepresentationByMorphism
758756
return RepresentationByMorphism(self, f, index_set, on_basis, **kwargs)
759757

0 commit comments

Comments
 (0)