]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: simplify some calls to super(...).
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 26 Feb 2021 02:20:58 +0000 (21:20 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 26 Feb 2021 02:20:58 +0000 (21:20 -0500)
mjo/eja/TODO
mjo/eja/eja_algebra.py
mjo/eja/eja_operator.py

index 7dd4788a77ed5e77af8e375bc9c8571cfd484d80..90a49d3a120d4914c8b0664f2d2405f6a5b8b8ab 100644 (file)
@@ -14,5 +14,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
 5. Profile the construction of "large" matrix algebras (like the
    15-dimensional QuaternionHermitianAlgebra(3)) to find out why
    they're so slow.
-
-6. Use super() where it works.
index 40b4bcac6583e75f6877260f633d752b6693d8d7..ad4e2c7832f961b4893814551657a7a823ac083d 100644 (file)
@@ -1994,11 +1994,11 @@ class RealSymmetricEJA(ConcreteEJA, RealMatrixEJA):
         if n <= 1:
             associative = True
 
-        super(RealSymmetricEJA, self).__init__(self._denormalized_basis(n),
-                                               self.jordan_product,
-                                               self.trace_inner_product,
-                                               associative=associative,
-                                               **kwargs)
+        super().__init__(self._denormalized_basis(n),
+                         self.jordan_product,
+                         self.trace_inner_product,
+                         associative=associative,
+                         **kwargs)
 
         # TODO: this could be factored out somehow, but is left here
         # because the MatrixEJA is not presently a subclass of the
@@ -2088,7 +2088,7 @@ class ComplexMatrixEJA(MatrixEJA):
             True
 
         """
-        super(ComplexMatrixEJA,cls).real_embed(M)
+        super().real_embed(M)
         n = M.nrows()
 
         # We don't need any adjoined elements...
@@ -2135,7 +2135,7 @@ class ComplexMatrixEJA(MatrixEJA):
             True
 
         """
-        super(ComplexMatrixEJA,cls).real_unembed(M)
+        super().real_unembed(M)
         n = ZZ(M.nrows())
         d = cls.dimension_over_reals()
         F = cls.complex_extension(M.base_ring())
@@ -2287,11 +2287,11 @@ class ComplexHermitianEJA(ConcreteEJA, ComplexMatrixEJA):
         if n <= 1:
             associative = True
 
-        super(ComplexHermitianEJA, self).__init__(self._denormalized_basis(n),
-                                                  self.jordan_product,
-                                                  self.trace_inner_product,
-                                                  associative=associative,
-                                                  **kwargs)
+        super().__init__(self._denormalized_basis(n),
+                         self.jordan_product,
+                         self.trace_inner_product,
+                         associative=associative,
+                         **kwargs)
         # TODO: this could be factored out somehow, but is left here
         # because the MatrixEJA is not presently a subclass of the
         # FDEJA class that defines rank() and one().
@@ -2374,7 +2374,7 @@ class QuaternionMatrixEJA(MatrixEJA):
             True
 
         """
-        super(QuaternionMatrixEJA,cls).real_embed(M)
+        super().real_embed(M)
         quaternions = M.base_ring()
         n = M.nrows()
 
@@ -2429,7 +2429,7 @@ class QuaternionMatrixEJA(MatrixEJA):
             True
 
         """
-        super(QuaternionMatrixEJA,cls).real_unembed(M)
+        super().real_unembed(M)
         n = ZZ(M.nrows())
         d = cls.dimension_over_reals()
 
@@ -2598,11 +2598,11 @@ class QuaternionHermitianEJA(ConcreteEJA, QuaternionMatrixEJA):
         if n <= 1:
             associative = True
 
-        super(QuaternionHermitianEJA, self).__init__(self._denormalized_basis(n),
-                                                     self.jordan_product,
-                                                     self.trace_inner_product,
-                                                     associative=associative,
-                                                     **kwargs)
+        super().__init__(self._denormalized_basis(n),
+                         self.jordan_product,
+                         self.trace_inner_product,
+                         associative=associative,
+                         **kwargs)
 
         # TODO: this could be factored out somehow, but is left here
         # because the MatrixEJA is not presently a subclass of the
@@ -2835,11 +2835,11 @@ class BilinearFormEJA(ConcreteEJA):
         if n <= 2:
             associative = True
 
-        super(BilinearFormEJA, self).__init__(column_basis,
-                                              jordan_product,
-                                              inner_product,
-                                              associative=associative,
-                                              **kwargs)
+        super().__init__(column_basis,
+                         jordan_product,
+                         inner_product,
+                         associative=associative,
+                         **kwargs)
 
         # The rank of this algebra is two, unless we're in a
         # one-dimensional ambient space (because the rank is bounded
@@ -2944,7 +2944,7 @@ class JordanSpinEJA(BilinearFormEJA):
 
         # But also don't pass check_field=False here, because the user
         # can pass in a field!
-        super(JordanSpinEJA, self).__init__(B, **kwargs)
+        super().__init__(B, **kwargs)
 
     @staticmethod
     def _max_random_instance_size():
@@ -3002,11 +3002,11 @@ class TrivialEJA(ConcreteEJA):
         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,
-                                         associative=True,
-                                         **kwargs)
+        super().__init__(basis,
+                         jordan_product,
+                         inner_product,
+                         associative=True,
+                         **kwargs)
 
         # The rank is zero using my definition, namely the dimension of the
         # largest subalgebra generated by any element.
index 75a08205ff949bf23a62b073b6c74196f5161823..4d24b35c5d902f0dbd2824242a88be614d45562e 100644 (file)
@@ -272,8 +272,7 @@ class FiniteDimensionalEJAOperator(Map):
 
         # This should eventually delegate to _composition_ after performing
         # some sanity checks for us.
-        mor = super(FiniteDimensionalEJAOperator,self)
-        return mor.__mul__(other)
+        return super().__mul__(other)
 
 
     def _neg_(self):