...
TypeError: Illegal initializer for algebraic number
- This causes the following error when we try to scale a matrix of
- complex numbers by an inexact real number::
-
- sage: ComplexHermitianEJA(2,field=RR)
- Traceback (most recent call last):
- ...
- TypeError: Unable to coerce entries (=(1.00000000000000,
- -0.000000000000000)) to coefficients in Algebraic Real Field
-
TESTS:
The dimension of this algebra is `n^2`::
return FiniteDimensionalEJAOperator(Ji,self,Ei.matrix())
+ def subalgebra(self, basis, **kwargs):
+ r"""
+ Create a subalgebra of this algebra from the given basis.
+
+ Only overridden to allow us to use a special Cartesian product
+ subalgebra class.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import (HadamardEJA,
+ ....: QuaternionHermitianEJA)
+
+ EXAMPLES:
+
+ Subalgebras of Cartesian product EJAs have a different class
+ than those of non-Cartesian-product EJAs::
+
+ sage: J1 = HadamardEJA(2,field=QQ,orthonormalize=False)
+ sage: J2 = QuaternionHermitianEJA(0,field=QQ,orthonormalize=False)
+ sage: J = cartesian_product([J1,J2])
+ sage: K1 = J1.subalgebra((J1.one(),), orthonormalize=False)
+ sage: K = J.subalgebra((J.one(),), orthonormalize=False)
+ sage: K1.__class__ is K.__class__
+ False
+
+ """
+ from mjo.eja.eja_subalgebra import FiniteDimensionalCartesianProductEJASubalgebra
+ return FiniteDimensionalCartesianProductEJASubalgebra(self, basis, **kwargs)
FiniteDimensionalEJA.CartesianProduct = CartesianProductEJA