X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_subalgebra.py;h=92fd296b3003a06e7bafb79f9d9c37d9cb6b13cb;hb=843814d06f42e6a97e31079173266fa6165e8c6a;hp=e2d12d26b01a0deaedeb190d450dfd14ede3c262;hpb=3baadd6fb5c765caab2bd57d1d6ed764b03d53b3;p=sage.d.git diff --git a/mjo/eja/eja_subalgebra.py b/mjo/eja/eja_subalgebra.py index e2d12d2..92fd296 100644 --- a/mjo/eja/eja_subalgebra.py +++ b/mjo/eja/eja_subalgebra.py @@ -1,11 +1,7 @@ from sage.matrix.constructor import matrix -from sage.combinat.free_module import CombinatorialFreeModule_CartesianProduct - -from mjo.eja.eja_algebra import (CartesianProductEJA, - FiniteDimensionalEJA) -from mjo.eja.eja_element import (CartesianProductEJAElement, - FiniteDimensionalEJAElement) +from mjo.eja.eja_algebra import FiniteDimensionalEJA +from mjo.eja.eja_element import FiniteDimensionalEJAElement class FiniteDimensionalEJASubalgebraElement(FiniteDimensionalEJAElement): """ @@ -75,15 +71,15 @@ class FiniteDimensionalEJASubalgebraElement(FiniteDimensionalEJAElement): We can convert back and forth faithfully:: sage: set_random_seed() - sage: J = random_eja() + sage: J = random_eja(field=QQ, orthonormalize=False) sage: x = J.random_element() - sage: A = x.subalgebra_generated_by() + sage: A = x.subalgebra_generated_by(orthonormalize=False) sage: A(x).superalgebra_element() == x True sage: y = A.random_element() sage: A(y.superalgebra_element()) == y True - sage: B = y.subalgebra_generated_by() + sage: B = y.subalgebra_generated_by(orthonormalize=False) sage: B(y).superalgebra_element() == y True @@ -114,11 +110,11 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): ....: [0,0] ]) sage: E22 = matrix(AA, [ [0,0], ....: [0,1] ]) - sage: K1 = FiniteDimensionalEJASubalgebra(J, (J(E11),)) + sage: K1 = FiniteDimensionalEJASubalgebra(J, (J(E11),), associative=True) sage: K1.one().to_matrix() [1 0] [0 0] - sage: K2 = FiniteDimensionalEJASubalgebra(J, (J(E22),)) + sage: K2 = FiniteDimensionalEJASubalgebra(J, (J(E22),), associative=True) sage: K2.one().to_matrix() [0 0] [0 1] @@ -174,6 +170,7 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): super().__init__(matrix_basis, jordan_product, inner_product, + field=field, prefix=prefix, **kwargs) @@ -198,7 +195,10 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): ....: [1,0,0] ]) sage: x = J(X) sage: basis = ( x, x^2 ) # x^2 is the identity matrix - sage: K = FiniteDimensionalEJASubalgebra(J, basis, orthonormalize=False) + sage: K = FiniteDimensionalEJASubalgebra(J, + ....: basis, + ....: associative=True, + ....: orthonormalize=False) sage: K(J.one()) f1 sage: K(J.one() + x) @@ -234,24 +234,3 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): Element = FiniteDimensionalEJASubalgebraElement - - - -class CartesianProductEJASubalgebraElement(CartesianProductEJAElement, - FiniteDimensionalEJASubalgebraElement): - pass - -class CartesianProductEJASubalgebra(CartesianProductEJA, - FiniteDimensionalEJASubalgebra): - - def __init__(self, superalgebra, basis, **kwargs): - CombinatorialFreeModule_CartesianProduct.__init__(self, - superalgebra.cartesian_factors()) - FiniteDimensionalEJASubalgebra.__init__(self, - superalgebra, - basis, - cartesian_product=True, - **kwargs) - - - Element = CartesianProductEJASubalgebraElement