X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_element.py;h=eee8f69bd76ddfba49e3cb4531f55d0e970ebd1d;hb=bbd6d4c6e39870b0936949b510e70af2b5358f9e;hp=c90893f1f65e92e4032b3b51d4f66d0fc5592900;hpb=02fe7b401586d6ec76028b576b9c61ff6c65d62d;p=sage.d.git diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index c90893f..eee8f69 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -1,3 +1,7 @@ +# -*- coding: utf-8 -*- + +from itertools import izip + from sage.matrix.constructor import matrix from sage.modules.free_module import VectorSpace from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement @@ -32,7 +36,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): Return ``self`` raised to the power ``n``. Jordan algebras are always power-associative; see for - example Faraut and Koranyi, Proposition II.1.2 (ii). + example Faraut and Korányi, Proposition II.1.2 (ii). We have to override this because our superclass uses row vectors instead of column vectors! We, on the other hand, @@ -373,7 +377,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): True Ensure that the determinant is multiplicative on an associative - subalgebra as in Faraut and Koranyi's Proposition II.2.2:: + subalgebra as in Faraut and Korányi's Proposition II.2.2:: sage: set_random_seed() sage: J = random_eja().random_element().subalgebra_generated_by() @@ -458,6 +462,17 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): ... ValueError: element is not invertible + Proposition II.2.3 in Faraut and Korányi says that the inverse + of an element is the inverse of its left-multiplication operator + applied to the algebra's identity, when that inverse exists:: + + sage: set_random_seed() + sage: J = random_eja() + sage: x = J.random_element() + sage: (not x.operator().is_invertible()) or ( + ....: x.operator().inverse()(J.one()) == x.inverse() ) + True + """ if not self.is_invertible(): raise ValueError("element is not invertible") @@ -830,7 +845,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): """ B = self.parent().natural_basis() W = self.parent().natural_basis_space() - return W.linear_combination(zip(B,self.to_vector())) + return W.linear_combination(izip(B,self.to_vector())) def norm(self): @@ -1009,7 +1024,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): - def subalgebra_generated_by(self): + def subalgebra_generated_by(self, orthonormalize_basis=False): """ Return the associative subalgebra of the parent EJA generated by this element. @@ -1048,7 +1063,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): 0 """ - return FiniteDimensionalEuclideanJordanElementSubalgebra(self) + return FiniteDimensionalEuclideanJordanElementSubalgebra(self, orthonormalize_basis) def subalgebra_idempotent(self): @@ -1160,8 +1175,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): TESTS: - The trace inner product is commutative, bilinear, and satisfies - the Jordan axiom: + The trace inner product is commutative, bilinear, and associative:: sage: set_random_seed() sage: J = random_eja() @@ -1181,7 +1195,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): ....: a*x.trace_inner_product(z) ) sage: actual == expected True - sage: # jordan axiom + sage: # associative sage: (x*y).trace_inner_product(z) == y.trace_inner_product(x*z) True