Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
A better failure example for _test_generated_by_degree_one and some m…
Browse files Browse the repository at this point in the history
…ore doc.
  • Loading branch information
Travis Scrimshaw committed Aug 21, 2018
1 parent 726639f commit 8b3c585
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ class Stratified(CategoryWithAxiom_over_base_ring):
Category of finite dimensional stratified Lie algebras with a basis.
A stratified Lie algebra is a graded Lie algebra that is generated
as a Lie algebra by its homogeneous component of degree 1.
as a Lie algebra by its homogeneous component of degree 1. That is
to say, For a graded Lie algebra `L = \bigoplus_{k=0}^M L_k`,
we have `L_{k+1} = [L_1, L_k]`.
TESTS::
Expand All @@ -121,12 +123,13 @@ class Stratified(CategoryWithAxiom_over_base_ring):
class ParentMethods:
def _test_generated_by_degree_one(self, **options):
r"""
Tests that the Lie algebra is generated by the homogeneous component
of degree one.
Tests that the Lie algebra is generated by the homogeneous
component of degree one.
INPUT:
- ``options`` -- any keyword arguments accepted by :meth:`_tester`.
- ``options`` -- any keyword arguments accepted by
:meth:`_tester`
EXAMPLES::
Expand All @@ -137,15 +140,13 @@ def _test_generated_by_degree_one(self, **options):
sage: L.<x,y,z> = NilpotentLieAlgebra(QQ, sc, category=C)
sage: L._test_generated_by_degree_one()
We modify ``L`` with a different grading::
sage: L._basis_degrees = {x: 1, y: 2, z: 3}
sage: L.homogeneous_component_as_submodule.clear_cache()
sage: sc = {('x','y'): {'z': 1}, ('a','b'): {'c':1}, ('z','c'): {'m':1}}
sage: L.<a,b,c,m,x,y,z> = NilpotentLieAlgebra(QQ, sc, category=C)
sage: L._test_generated_by_degree_one()
Traceback (most recent call last):
...
AssertionError: [x] does not generate Nilpotent Lie algebra on
3 generators (x, y, z) over Rational Field
AssertionError: [a, b, x, y] does not generate Nilpotent Lie algebra
on 7 generators (a, b, c, m, x, y, z) over Rational Field
See the documentation for :class:`TestSuite` for more information.
"""
Expand Down
4 changes: 4 additions & 0 deletions src/sage/categories/graded_lie_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class Stratified(CategoryWithAxiom_over_base_ring):
r"""
Category of stratified Lie algebras.
A graded Lie algebra `L = \bigoplus_{k=0}^M L_k` (where
possibly `M = \infty`) is called *stratified* if it is generated
by `L_1`; in other words, we have `L_{k+1} = [L_1, L_k]`.
TESTS::
sage: C = LieAlgebras(QQ).Graded().Stratified()
Expand Down

0 comments on commit 8b3c585

Please sign in to comment.