this algebra was constructed with ``check_axioms=False`` and
passed an invalid multiplication table.
"""
- return all( self.product_on_basis(i,j) == self.product_on_basis(i,j)
- for i in range(self.dimension())
- for j in range(self.dimension()) )
+ return all( x*y == y*x for x in self.gens() for y in self.gens() )
def _is_jordanian(self):
r"""
# And to each subsequent row, prepend an entry that belongs to
# the left-side "header column."
- M += [ [self.gens()[i]] + [ self.product_on_basis(i,j)
+ M += [ [self.gens()[i]] + [ self.gens()[i]*self.gens()[j]
for j in range(n) ]
for i in range(n) ]
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
True
"""
- super(ComplexMatrixEJA,cls).real_embed(M)
+ super().real_embed(M)
n = M.nrows()
# We don't need any adjoined elements...
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())
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().
True
"""
- super(QuaternionMatrixEJA,cls).real_embed(M)
+ super().real_embed(M)
quaternions = M.base_ring()
n = M.nrows()
True
"""
- super(QuaternionMatrixEJA,cls).real_unembed(M)
+ super().real_unembed(M)
n = ZZ(M.nrows())
d = cls.dimension_over_reals()
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
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
# 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():
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.
self.one.set_cache(self._cartesian_product_of_elements(ones))
self.rank.set_cache(sum(J.rank() for J in algebras))
+ def product_on_basis(self, i, j):
+ r"""
+ Return the product of the monomials indexed by ``i`` and ``j``.
+
+ This overrides the superclass method because here, both ``i``
+ and ``j`` will be ordered pairs.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import (ComplexHermitianEJA,
+ ....: JordanSpinEJA,
+ ....: RealSymmetricEJA)
+
+ TESTS::
+
+ sage: J1 = RealSymmetricEJA(2,field=QQ,orthonormalize=False)
+ sage: J2 = ComplexHermitianEJA(0,field=QQ,orthonormalize=False)
+ sage: J3 = JordanSpinEJA(2,field=QQ,orthonormalize=False)
+ sage: J = cartesian_product([J1,J2,J3])
+ sage: x = sum(J.gens())
+ sage: x*J.one()
+ e(0, 0) + e(0, 1) + e(0, 2) + e(2, 0) + e(2, 1)
+ sage: x*x
+ 2*e(0, 0) + 2*e(0, 1) + 2*e(0, 2) + 2*e(2, 0) + 2*e(2, 1)
+
+ """
+ factor = i[0]
+ assert(j[0] == i[0])
+ n = self.cartesian_factors()[factor].dimension()
+
+ # The superclass method indexes into a matrix, so we have to
+ # turn the tuples i and j into integers. This is easy enough
+ # given that the first coordinate of i and j corresponds to
+ # the factor, and the second coordinate corresponds to the
+ # index of the generator within that factor. And of course
+ # we should never be multiplying two elements from different
+ # factors.
+ l = n*factor + i[1]
+ m = n*factor + j[1]
+ super().product_on_basis(l, m)
+
def matrix_space(self):
r"""
Return the space that our matrix basis lives in as a Cartesian