]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix one() in the trivial HadamardEJA.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 22 Nov 2020 16:03:16 +0000 (11:03 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 22 Nov 2020 16:03:16 +0000 (11:03 -0500)
mjo/eja/eja_algebra.py

index e436bf144970a8398794903db00d52c86c3ce07e..c40c8be4c371255f9bc174f99862ef0a7a204555 100644 (file)
@@ -2070,7 +2070,11 @@ class HadamardEJA(RationalBasisEuclideanJordanAlgebra):
                                           check_axioms=False,
                                           **kwargs)
         self.rank.set_cache(n)
-        self.one.set_cache( sum(self.gens()) )
+
+        if n == 0:
+            self.one.set_cache( self.zero() )
+        else:
+            self.one.set_cache( sum(self.gens()) )
 
     @staticmethod
     def _max_random_instance_size():