From 158bfdbfd8ed4c2afa660ff86cbb0fe2fbc54db0 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 21 Aug 2018 09:29:25 +1000 Subject: [PATCH] Fix to product_space() for when L is not a true subalgebra of A. --- .../finite_dimensional_lie_algebras_with_basis.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py b/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py index 8b13023683b..1fc469fde15 100644 --- a/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py @@ -663,8 +663,13 @@ def product_space(self, L, submodule=False): except AttributeError: A = self + if L not in self.category(): + # L might be a submodule of A.module() + LB = [self.from_vector(b) for b in L.basis()] + else: + LB = L.basis() + B = self.basis() - LB = L.basis() b_mat = matrix(A.base_ring(), [A.bracket(b, lb).to_vector() for b in B for lb in LB]) if submodule is True or not (self.is_ideal(A) and L.is_ideal(A)):