]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: disable axiom checking for concrete algebras.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 3 Dec 2020 17:39:49 +0000 (12:39 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 3 Dec 2020 17:39:49 +0000 (12:39 -0500)
mjo/eja/TODO
mjo/eja/eja_algebra.py

index b298e6914da8a7ec8d21483b73606b12c8511576..9f805373809bf077261973885e4c403af6cfa101 100644 (file)
@@ -20,6 +20,3 @@ sage: a0 = (1/4)*X[4]**2*X[6]**2 - (1/2)*X[2]*X[5]*X[6]**2 - (1/2)*X[3]*X[4]*X[6
 
 6. The main EJA element constructor is happy to convert between
    e.g. HadamardEJA(3) and JordanSpinEJA(3).
-
-8. Add back the check_field=False and check_axioms=False parameters
-   for the EJAs we've constructed ourselves.
index e32bc24cbb2741fca9de2285de703b7adf1497af..e075ed21ab287fcefcfbf7c9674a39281b48b69c 100644 (file)
@@ -1631,6 +1631,10 @@ class RealSymmetricEJA(ConcreteEuclideanJordanAlgebra,
         return cls(n, **kwargs)
 
     def __init__(self, n, **kwargs):
+        # We know this is a valid EJA, but will double-check
+        # if the user passes check_axioms=True.
+        if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
+
         super(RealSymmetricEJA, self).__init__(self._denormalized_basis(n),
                                                self.jordan_product,
                                                self.trace_inner_product,
@@ -1912,6 +1916,10 @@ class ComplexHermitianEJA(ConcreteEuclideanJordanAlgebra,
 
 
     def __init__(self, n, **kwargs):
+        # We know this is a valid EJA, but will double-check
+        # if the user passes check_axioms=True.
+        if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
+
         super(ComplexHermitianEJA, self).__init__(self._denormalized_basis(n),
                                                   self.jordan_product,
                                                   self.trace_inner_product,
@@ -2209,6 +2217,10 @@ class QuaternionHermitianEJA(ConcreteEuclideanJordanAlgebra,
 
 
     def __init__(self, n, **kwargs):
+        # We know this is a valid EJA, but will double-check
+        # if the user passes check_axioms=True.
+        if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
+
         super(QuaternionHermitianEJA, self).__init__(self._denormalized_basis(n),
                                                      self.jordan_product,
                                                      self.trace_inner_product,
@@ -2279,18 +2291,20 @@ class HadamardEJA(ConcreteEuclideanJordanAlgebra):
         def inner_product(x,y):
             return x.inner_product(y)
 
-        # Don't orthonormalize because our basis is already
-        # orthonormal with respect to our inner-product.
-        if not 'orthonormalize' in kwargs:
-            kwargs['orthonormalize'] = False
+        # New defaults for keyword arguments. Don't orthonormalize
+        # because our basis is already orthonormal with respect to our
+        # inner-product. Don't check the axioms, because we know this
+        # is a valid EJA... but do double-check if the user passes
+        # check_axioms=True. Note: we DON'T override the "check_field"
+        # default here, because the user can pass in a field!
+        if "orthonormalize" not in kwargs: kwargs["orthonormalize"] = False
+        if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
+
 
-        # But also don't pass check_field=False here, because the user
-        # can pass in a field!
         standard_basis = FreeModule(ZZ, n).basis()
         super(HadamardEJA, self).__init__(standard_basis,
                                           jordan_product,
                                           inner_product,
-                                          check_axioms=False,
                                           **kwargs)
         self.rank.set_cache(n)
 
@@ -2413,6 +2427,10 @@ class BilinearFormEJA(ConcreteEuclideanJordanAlgebra):
             zbar = y0*xbar + x0*ybar
             return P((z0,) + tuple(zbar))
 
+        # We know this is a valid EJA, but will double-check
+        # if the user passes check_axioms=True.
+        if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
+
         n = B.nrows()
         standard_basis = FreeModule(ZZ, n).basis()
         super(BilinearFormEJA, self).__init__(standard_basis,
@@ -2519,14 +2537,11 @@ class JordanSpinEJA(BilinearFormEJA):
 
         # Don't orthonormalize because our basis is already
         # orthonormal with respect to our inner-product.
-        if not 'orthonormalize' in kwargs:
-            kwargs['orthonormalize'] = False
+        if "orthonormalize" not in kwargs: kwargs["orthonormalize"] = False
 
         # But also don't pass check_field=False here, because the user
         # can pass in a field!
-        super(JordanSpinEJA, self).__init__(B,
-                                            check_axioms=False,
-                                            **kwargs)
+        super(JordanSpinEJA, self).__init__(B, **kwargs)
 
     @staticmethod
     def _max_random_instance_size():
@@ -2579,6 +2594,11 @@ class TrivialEJA(ConcreteEuclideanJordanAlgebra):
         jordan_product = lambda x,y: x
         inner_product = lambda x,y: 0
         basis = ()
+
+        # New defaults for keyword arguments
+        if "orthonormalize" not in kwargs: kwargs["orthonormalize"] = False
+        if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
+
         super(TrivialEJA, self).__init__(basis,
                                          jordan_product,
                                          inner_product,