Algebraic Real Field
"""
- if self.base_ring() is QQ:
+ if self.base_ring() is QQ or self._rational_algebra is None:
# There's no need to construct *another* algebra over the
- # rationals if this one is already over the rationals.
+ # rationals if this one is already over the
+ # rationals. Likewise, if we never orthonormalized our
+ # basis, we might as well just use the given one.
superclass = super(RationalBasisEuclideanJordanAlgebra, self)
return superclass._charpoly_coefficients()
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.
super(HadamardEJA, self).__init__(field,
basis,
jordan_product,
inner_product,
+ orthonormalize=False,
+ check_field=False,
+ check_axioms=False,
**kwargs)
self.rank.set_cache(n)
"""
def __init__(self, n, field=AA, **kwargs):
- # This is a special case of the BilinearFormEJA with the identity
- # matrix as its bilinear form.
+ # This is a special case of the BilinearFormEJA with the
+ # identity matrix as its bilinear form.
B = matrix.identity(field, n)
- super(JordanSpinEJA, self).__init__(B, field, **kwargs)
+
+ # Don't orthonormalize because our basis is already
+ # orthonormal with respect to our inner-product.
+ super(JordanSpinEJA, self).__init__(B,
+ field,
+ orthonormalize=False,
+ check_field=False,
+ check_axioms=False,
+ **kwargs)
@staticmethod
def _max_random_instance_size():