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

Commit

Permalink
Changing r=10 as cutoff to requiring a linear ordering.
Browse files Browse the repository at this point in the history
  • Loading branch information
tscrim committed Aug 23, 2018
1 parent a60ef68 commit 664fbec
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ class FreeNilpotentLieAlgebra(NilpotentLieAlgebra_dense):
- ``naming`` -- (optional) a string; the naming scheme to use for
the basis; valid values are:
* ``'index'`` - (default for `r \leq 10`) the basis elements are
* ``'index'`` - (default for `r < 10`) the basis elements are
``names_w``, where ``w`` are Lyndon words indexing the basis
* ``'linear'`` - (default for `r > 10`) the basis is indexed
* ``'linear'`` - (default for `r \geq 10`) the basis is indexed
``names_1``, ..., ``names_n`` in the ordering of the Lyndon basis
.. NOTE::
The ``'index'`` naming scheme is not supported if `r > 10` since
it leads to ambiguous names.
The ``'index'`` naming scheme is not supported if `r \geq 10`
since it leads to ambiguous names.
EXAMPLES:
Expand Down Expand Up @@ -218,7 +218,7 @@ class FreeNilpotentLieAlgebra(NilpotentLieAlgebra_dense):
A fully custom naming scheme on the Heisenberg algebra::
sage: L = LieAlgebra(ZZ, 2, step=2, names = ('X', 'Y', 'Z'))
sage: L = LieAlgebra(ZZ, 2, step=2, names=('X', 'Y', 'Z'))
sage: a, b, c = L.basis()
sage: L.basis().list()
[X, Y, Z]
Expand Down Expand Up @@ -364,17 +364,17 @@ def __init__(self, R, r, s, names, naming, category, **kwds):

if len(names) == 1 and len(index_set) > 1:
if not naming:
if r > 10:
if r >= 10:
naming = 'linear'
else:
naming = 'index'
if naming == 'linear':
names = ['%s_%d' % (names[0], k + 1)
for k in range(len(index_set))]
elif naming == 'index':
if r > 10:
if r >= 10:
raise ValueError("'index' naming scheme not supported for "
"over 10 generators")
"10 or more generators")
names = ['%s_%s' % (names[0], "".join(str(s) for s in w))
for w in index_set]
else:
Expand Down

0 comments on commit 664fbec

Please sign in to comment.