X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_element.py;h=6547668965a690b883a5ac59757ef1e625016604;hb=f1ddf1e9eee634161aad87b9c2de0194efb17879;hp=120870b7fa08b1ee0fcb936b92c62a9470a27754;hpb=4c6ab92d378613a9a053b62382b7e0cda7c450ab;p=sage.d.git diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 120870b..6547668 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -971,15 +971,16 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): - def natural_representation(self): + def to_matrix(self): """ - Return a more-natural representation of this element. + Return an (often more natural) representation of this element as a + matrix. - Every finite-dimensional Euclidean Jordan Algebra is a - direct sum of five simple algebras, four of which comprise - Hermitian matrices. This method returns the original - "natural" representation of this element as a Hermitian - matrix, if it has one. If not, you get the usual representation. + Every finite-dimensional Euclidean Jordan Algebra is a direct + sum of five simple algebras, four of which comprise Hermitian + matrices. This method returns a "natural" matrix + representation of this element as either a Hermitian matrix or + column vector. SETUP:: @@ -991,7 +992,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): sage: J = ComplexHermitianEJA(3) sage: J.one() e0 + e3 + e8 - sage: J.one().natural_representation() + sage: J.one().to_matrix() [1 0 0 0 0 0] [0 1 0 0 0 0] [0 0 1 0 0 0] @@ -1004,7 +1005,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): sage: J = QuaternionHermitianEJA(3) sage: J.one() e0 + e5 + e14 - sage: J.one().natural_representation() + sage: J.one().to_matrix() [1 0 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0] [0 0 1 0 0 0 0 0 0 0 0 0] @@ -1017,15 +1018,14 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): [0 0 0 0 0 0 0 0 0 1 0 0] [0 0 0 0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 0 0 0 0 0 1] - """ - B = self.parent().natural_basis() - W = self.parent().natural_basis_space() + B = self.parent().matrix_basis() + W = self.parent().matrix_space() # This is just a manual "from_vector()", but of course # matrix spaces aren't vector spaces in sage, so they # don't have a from_vector() method. - return W.linear_combination(zip(B,self.to_vector())) + return W.linear_combination( zip(B, self.to_vector()) ) def norm(self):