From 58c6ee3de5d4ee8f8349011c789132d7800b34e9 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 9 Nov 2020 09:28:21 -0500 Subject: [PATCH] eja: pass check=False for known-good constructions. --- mjo/eja/eja_algebra.py | 48 +++++++++++++++++++++---------- mjo/eja/eja_element_subalgebra.py | 3 +- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 0da3eef..b681296 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1049,8 +1049,10 @@ class HadamardEJA(FiniteDimensionalEuclideanJordanAlgebra): mult_table = [ [ V.gen(i)*(i == j) for j in range(n) ] for i in range(n) ] - fdeja = super(HadamardEJA, self) - fdeja.__init__(field, mult_table, **kwargs) + super(HadamardEJA, self).__init__(field, + mult_table, + check=False, + **kwargs) self.rank.set_cache(n) def inner_product(self, x, y): @@ -1139,9 +1141,10 @@ class MatrixEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebra): Qs = self.multiplication_table_from_matrix_basis(basis) - fdeja = super(MatrixEuclideanJordanAlgebra, self) - fdeja.__init__(field, Qs, natural_basis=basis, **kwargs) - return + super(MatrixEuclideanJordanAlgebra, self).__init__(field, + Qs, + natural_basis=basis, + **kwargs) @cached_method @@ -1409,7 +1412,10 @@ class RealSymmetricEJA(RealMatrixEuclideanJordanAlgebra): def __init__(self, n, field=AA, **kwargs): basis = self._denormalized_basis(n, field) - super(RealSymmetricEJA, self).__init__(field, basis, **kwargs) + super(RealSymmetricEJA, self).__init__(field, + basis, + check=False, + **kwargs) self.rank.set_cache(n) @@ -1705,7 +1711,10 @@ class ComplexHermitianEJA(ComplexMatrixEuclideanJordanAlgebra): def __init__(self, n, field=AA, **kwargs): basis = self._denormalized_basis(n,field) - super(ComplexHermitianEJA,self).__init__(field, basis, **kwargs) + super(ComplexHermitianEJA,self).__init__(field, + basis, + check=False, + **kwargs) self.rank.set_cache(n) @@ -2006,7 +2015,10 @@ class QuaternionHermitianEJA(QuaternionMatrixEuclideanJordanAlgebra): def __init__(self, n, field=AA, **kwargs): basis = self._denormalized_basis(n,field) - super(QuaternionHermitianEJA,self).__init__(field, basis, **kwargs) + super(QuaternionHermitianEJA,self).__init__(field, + basis, + check=False, + **kwargs) self.rank.set_cache(n) @@ -2089,8 +2101,10 @@ class BilinearFormEJA(FiniteDimensionalEuclideanJordanAlgebra): # The rank of this algebra is two, unless we're in a # one-dimensional ambient space (because the rank is bounded # by the ambient dimension). - fdeja = super(BilinearFormEJA, self) - fdeja.__init__(field, mult_table, **kwargs) + super(BilinearFormEJA, self).__init__(field, + mult_table, + check=False, + **kwargs) self.rank.set_cache(min(n,2)) def inner_product(self, x, y): @@ -2182,7 +2196,7 @@ class JordanSpinEJA(BilinearFormEJA): def __init__(self, n, field=AA, **kwargs): # This is a special case of the BilinearFormEJA with the identity # matrix as its bilinear form. - return super(JordanSpinEJA, self).__init__(n, field, **kwargs) + super(JordanSpinEJA, self).__init__(n, field, **kwargs) class TrivialEJA(FiniteDimensionalEuclideanJordanAlgebra): @@ -2216,10 +2230,12 @@ class TrivialEJA(FiniteDimensionalEuclideanJordanAlgebra): """ def __init__(self, field=AA, **kwargs): mult_table = [] - fdeja = super(TrivialEJA, self) + super(TrivialEJA, self).__init__(field, + mult_table, + check=False, + **kwargs) # The rank is zero using my definition, namely the dimension of the # largest subalgebra generated by any element. - fdeja.__init__(field, mult_table, **kwargs) self.rank.set_cache(0) @@ -2265,6 +2281,8 @@ class DirectSumEJA(FiniteDimensionalEuclideanJordanAlgebra): p = (J2.monomial(i)*J2.monomial(j)).to_vector() mult_table[n1+i][n1+j] = V([field.zero()]*n1 + p.list()) - fdeja = super(DirectSumEJA, self) - fdeja.__init__(field, mult_table, **kwargs) + super(DirectSumEJA, self).__init__(field, + mult_table, + check=False, + **kwargs) self.rank.set_cache(J1.rank() + J2.rank()) diff --git a/mjo/eja/eja_element_subalgebra.py b/mjo/eja/eja_element_subalgebra.py index 608cbc2..a4d7d1f 100644 --- a/mjo/eja/eja_element_subalgebra.py +++ b/mjo/eja/eja_element_subalgebra.py @@ -52,7 +52,8 @@ class FiniteDimensionalEuclideanJordanElementSubalgebra(FiniteDimensionalEuclide fdeja = super(FiniteDimensionalEuclideanJordanElementSubalgebra, self) fdeja.__init__(self._superalgebra, superalgebra_basis, - category=category) + category=category, + check=False) # The rank is the highest possible degree of a minimal # polynomial, and is bounded above by the dimension. We know -- 2.44.2