Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various improvements to Lie algebras #28427

Closed
tscrim opened this issue Aug 30, 2019 · 28 comments
Closed

Various improvements to Lie algebras #28427

tscrim opened this issue Aug 30, 2019 · 28 comments

Comments

@tscrim
Copy link
Collaborator

tscrim commented Aug 30, 2019

We fix a bug in constructing the 0 element of a Lie algebra by putting that path higher in the _element_constructor_.

We make all of the Lie algebras and modules in virasoro.py know that they are graded.

Implement a fallback to the PBW basis for when the construction of the universal enveloping algebra fails for finite-dimensional Lie algebras with a basis.

Allow coercions and actions between Lie algebras to lift to the PBW bases.

CC: @darijgr

Component: algebra

Keywords: lie algebra

Author: Travis Scrimshaw

Branch/Commit: 1e2ecab

Reviewer: Frédéric Chapoton, Darij Grinberg

Issue created by migration from https://trac.sagemath.org/ticket/28427

@tscrim tscrim added this to the sage-8.9 milestone Aug 30, 2019
@tscrim
Copy link
Collaborator Author

tscrim commented Aug 30, 2019

New commits:

7217b2eVarious improvements to Lie algebras.

@tscrim

This comment has been minimized.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 30, 2019

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 30, 2019

Commit: 7217b2e

@darijgr
Copy link
Contributor

darijgr commented Aug 30, 2019

comment:2

Please fix the doc of the Virasoro degree_on_basis function: it should mention c, too.

+        We skip the grading test as we need to be able to echelonize a
+        matrix over the base ring as part of the test::
+
             sage: L = lie_algebras.pwitt(Zmod(6), 6)
-            sage: TestSuite(L).run()  # not tested -- universal envelope doesn't work
-            sage: L._test_jacobi_identity()
+            sage: TestSuite(L).run(skip="_test_grading"

What needs to be echelonized?

The runtime error check is a bit of a hack -- but it may well be fine. Are you sure Singular will always throw a runtime error if it doesn't recognize the base ring as a field, as opposed to silently responding with a wrong result?

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 30, 2019

comment:3

Replying to @darijgr:

+        We skip the grading test as we need to be able to echelonize a
+        matrix over the base ring as part of the test::
+
             sage: L = lie_algebras.pwitt(Zmod(6), 6)
-            sage: TestSuite(L).run()  # not tested -- universal envelope doesn't work
-            sage: L._test_jacobi_identity()
+            sage: TestSuite(L).run(skip="_test_grading"

What needs to be echelonized?

It is done in computing the homogeneous degree component as part of the test.

The runtime error check is a bit of a hack -- but it may well be fine. Are you sure Singular will always throw a runtime error if it doesn't recognize the base ring as a field, as opposed to silently responding with a wrong result?

The reason Singular throws the error is because it only can work over certain base rings. If it silently returns a wrong result, then there is nothing anyone can do except submit an upstream bug report.

@darijgr
Copy link
Contributor

darijgr commented Aug 30, 2019

comment:4

Does Singular say that it's not going to work over a non-field, or does it try and panic when some division fails? In the former case, what you're doing is fine; in the latter I'd be more careful.

Still not sure why the echelon form may be needed in the test suite, but you know better. I'm fine with or without the tests; the grading on the Witt algebra is so obvious there can't be any trouble from that front :)

Care to mention c in the doc of Virasoro's degree function? Everything apart of this (and the possible Singular issue, if it is one) LGTM. (Sorry for the absence of more significant code review from me lately...)

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 30, 2019

comment:5

You are way overthinking this Singular thing. Just run the test and you will see for the echelonization.

I am planning on mentioning the c, but I am not at my computer right now.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Changed commit from 7217b2e to 91db3fa

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

91db3faImproving doc, extending actions and coercions to PBW basis.

@tscrim

This comment has been minimized.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 31, 2019

comment:7

I have updated the documentation. I also was more precise about that singular is failing for the Z/6Z example (although its documentation does (implicitly) say the algebra needs to be defined over a field; at least, I am fairly certain it needs an integral domain). I also did another improvement that I think would be useful, to allow coercions and actions to lift to the PBW basis.

Here also is the traceback of what happens in the grading test:

sage: L = lie_algebras.pwitt(Zmod(6), 6)
sage: L._test_grading()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-2-fb4e02d44a27> in <module>()
----> 1 L._test_grading()

/home/uqtscrim/sage-build/local/lib/python2.7/site-packages/sage/categories/finite_dimensional_graded_lie_algebras_with_basis.pyc in _test_grading(self, **options)
     82                         (X, Y, Zdeg, i + j))
     83                 tester.assertTrue(
---> 84                     Z.to_vector() in self.homogeneous_component_as_submodule(i + j),
     85                     msg="Lie bracket [%s, %s] is not in the "
     86                         "homogeneous component of degree %s" % (X, Y, i + j))

/home/uqtscrim/sage-build/local/lib/python2.7/site-packages/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10273)()
   1947                 return cache[k]
   1948         except KeyError:
-> 1949             w = self._instance_call(*args, **kwds)
   1950             cache[k] = w
   1951             return w

/home/uqtscrim/sage-build/local/lib/python2.7/site-packages/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCaller._instance_call (build/cythonized/sage/misc/cachefunc.c:9758)()
   1823             True
   1824         """
-> 1825         return self.f(self._instance, *args, **kwds)
   1826 
   1827     cdef fix_args_kwds(self, tuple args, dict kwds):

/home/uqtscrim/sage-build/local/lib/python2.7/site-packages/sage/categories/finite_dimensional_graded_lie_algebras_with_basis.pyc in homogeneous_component_as_submodule(self, d)
    104             """
    105             B = self.homogeneous_component_basis(d)
--> 106             return self.module().submodule([X.to_vector() for X in B])
    107 
    108     class Stratified(CategoryWithAxiom_over_base_ring):

/home/uqtscrim/sage-build/local/lib/python2.7/site-packages/sage/categories/modules_with_basis.pyc in submodule(self, gens, check, already_echelonized, unitriangular, category)
    813             """
    814             if not already_echelonized:
--> 815                 gens = self.echelon_form(gens, unitriangular)
    816             from sage.modules.with_basis.subquotient import SubmoduleWithBasis
    817             return SubmoduleWithBasis(gens, ambient=self,

/home/uqtscrim/sage-build/local/lib/python2.7/site-packages/sage/categories/modules_with_basis.pyc in echelon_form(self, elements, row_reduced)
    657                     raise ValueError("unable to compute the row reduced echelon form")
    658             else:
--> 659                 mat.echelonize()
    660             return [self.from_vector(vec) for vec in mat if vec]
    661 

/home/uqtscrim/sage-build/local/lib/python2.7/site-packages/sage/matrix/matrix_modn_dense_template.pxi in sage.matrix.matrix_modn_dense_float.Matrix_modn_dense_template.echelonize (build/cythonized/sage/matrix/matrix_modn_dense_float.cpp:12657)()
   1851 
   1852         if not self.base_ring().is_field():
-> 1853             raise NotImplementedError("Echelon form not implemented over '%s'."%self.base_ring())
   1854 
   1855         if algorithm == 'linbox':

NotImplementedError: Echelon form not implemented over 'Ring of integers modulo 6'.

You can see where it needs to be able to echelonize a matrix. If we wanted to fix this, we would have to change the test itself by weakening it when it is not over a field (which should be a separate ticket as that has farther reaching implications).

Also, no problem with not doing more reviewing. I know you are starting a new tenure-track job. ;)

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 31, 2019

comment:8

Hmm...something broke with that latest push for the Verma modules. I need to investigate.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 31, 2019

comment:9

So the problem comes from extending the action of the Lie algebra to the PBW basis (i.e., not the additional coercions allowed).

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

08ca9fbFixing bug with extending the action and adding a shortcut.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Changed commit from 91db3fa to 08ca9fb

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

c9ce01cFixing bug with extending the action and adding a shortcut.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Changed commit from 08ca9fb to c9ce01c

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 31, 2019

comment:12

Okay, I fixed the problem. I forgot to also add the coefficient to the product >_<. I also added a shortcut for the action when there is a specialized PBW action implemented on a module (e.g., Verma modules).

@fchapoton
Copy link
Contributor

comment:13

some warnings, see patchbot plugins

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

1e2ecabFixing patchbot and pyflakes warnings.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2019

Changed commit from c9ce01c to 1e2ecab

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 31, 2019

comment:15

Replying to @fchapoton:

some warnings, see patchbot plugins

Fixed.

@fchapoton
Copy link
Contributor

comment:16

ok, good to go

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@tscrim
Copy link
Collaborator Author

tscrim commented Sep 1, 2019

comment:18

Thank you. I am also adding Darij as a reviewer for his comments.

@tscrim
Copy link
Collaborator Author

tscrim commented Sep 1, 2019

Changed reviewer from Frédéric Chapoton to Frédéric Chapoton, Darij Grinberg

@vbraun
Copy link
Member

vbraun commented Sep 5, 2019

Changed branch from public/lie_algebras/various_improvements-28427 to 1e2ecab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants