prefix='e',
category=None,
natural_basis=None,
- check=True):
+ check_field=True,
+ check_axioms=True):
"""
SETUP::
TESTS:
- The ``field`` we're given must be real with ``check=True``::
+ The ``field`` we're given must be real with ``check_field=True``::
sage: JordanSpinEJA(2,QQbar)
Traceback (most recent call last):
...
- ValueError: field is not real
+ ValueError: scalar field is not real
- The multiplication table must be square with ``check=True``::
+ The multiplication table must be square with ``check_axioms=True``::
sage: FiniteDimensionalEuclideanJordanAlgebra(QQ,((),()))
Traceback (most recent call last):
ValueError: multiplication table is not square
"""
- if check:
+ if check_field:
if not field.is_subring(RR):
# Note: this does return true for the real algebraic
- # field, and any quadratic field where we've specified
- # a real embedding.
- raise ValueError('field is not real')
+ # field, the rationals, and any quadratic field where
+ # we've specified a real embedding.
+ raise ValueError("scalar field is not real")
+
+ # The multiplication table had better be square
+ n = len(mult_table)
+ if check_axioms:
+ if not all( len(l) == n for l in mult_table ):
+ raise ValueError("multiplication table is not square")
self._natural_basis = natural_basis
category = MagmaticAlgebras(field).FiniteDimensional()
category = category.WithBasis().Unital()
- # The multiplication table had better be square
- n = len(mult_table)
- if check:
- if not all( len(l) == n for l in mult_table ):
- raise ValueError("multiplication table is not square")
-
fda = super(FiniteDimensionalEuclideanJordanAlgebra, self)
fda.__init__(field,
range(n),
for ls in mult_table
]
- if check:
+ if check_axioms:
if not self._is_commutative():
raise ValueError("algebra is not commutative")
if not self._is_jordanian():
Whether or not this algebra's multiplication table is commutative.
This method should of course always return ``True``, unless
- this algebra was constructed with ``check=False`` and passed
- an invalid multiplication table.
+ 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())
``True`` result to be truly true, you should also check
:meth:`_is_commutative`. This method should of course always
return ``True``, unless this algebra was constructed with
- ``check=False`` and passed an invalid multiplication table.
+ ``check_axioms=False`` and passed an invalid multiplication table.
"""
return all( (self.monomial(i)**2)*(self.monomial(i)*self.monomial(j))
==
associative; that is, whether or not `B(xy,z) = B(x,yz)`.
This method should of course always return ``True``, unless
- this algebra was constructed with ``check=False`` and passed
- an invalid multiplication table.
+ this algebra was constructed with ``check_axioms=False`` and
+ passed an invalid multiplication table.
"""
# Used to check whether or not something is zero in an inexact
# ring. This number is sufficient to allow the construction of
- # QuaternionHermitianEJA(2, RDF) with check=True.
+ # QuaternionHermitianEJA(2, RDF) with check_axioms=True.
epsilon = 1e-16
for i in range(self.dimension()):
gens = tuple( self.from_vector(b) for b in eigspace.basis() )
subalg = FiniteDimensionalEuclideanJordanSubalgebra(self,
gens,
- check=False)
+ check_axioms=False)
if eigval == 0:
J0 = subalg
elif eigval == 1:
super(HadamardEJA, self).__init__(field,
mult_table,
- check=False,
+ check_axioms=False,
**kwargs)
self.rank.set_cache(n)
# Do this over the rationals and convert back at the end.
# Only works because we know the entries of the basis are
- # integers. The argument ``check=False`` is required
+ # integers. The argument ``check_axioms=False`` is required
# because the trace inner-product method for this
# class is a stub and can't actually be checked.
J = MatrixEuclideanJordanAlgebra(QQ,
basis,
normalize_basis=False,
- check=False)
+ check_field=False,
+ check_axioms=False)
a = J._charpoly_coefficients()
# Unfortunately, changing the basis does change the
basis = self._denormalized_basis(n, field)
super(RealSymmetricEJA, self).__init__(field,
basis,
- check=False,
+ check_axioms=False,
**kwargs)
self.rank.set_cache(n)
basis = self._denormalized_basis(n,field)
super(ComplexHermitianEJA,self).__init__(field,
basis,
- check=False,
+ check_axioms=False,
**kwargs)
self.rank.set_cache(n)
basis = self._denormalized_basis(n,field)
super(QuaternionHermitianEJA,self).__init__(field,
basis,
- check=False,
+ check_axioms=False,
**kwargs)
self.rank.set_cache(n)
# by the ambient dimension).
super(BilinearFormEJA, self).__init__(field,
mult_table,
- check=False,
+ check_axioms=False,
**kwargs)
self.rank.set_cache(min(n,2))
mult_table = []
super(TrivialEJA, self).__init__(field,
mult_table,
- check=False,
+ check_axioms=False,
**kwargs)
# The rank is zero using my definition, namely the dimension of the
# largest subalgebra generated by any element.
super(DirectSumEJA, self).__init__(field,
mult_table,
- check=False,
+ check_axioms=False,
**kwargs)
self.rank.set_cache(J1.rank() + J2.rank())