]>
gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/eja/euclidean_jordan_algebra.py
e0a6f2da12982932838c2dbef2ae0e3d0fe8a1b0
2 Euclidean Jordan Algebras. These are formally-real Jordan Algebras;
3 specifically those where u^2 + v^2 = 0 implies that u = v = 0. They
4 are used in optimization, and have some additional nice methods beyond
5 what can be supported in a general Jordan Algebra.
10 def eja_rn(dimension
, field
=QQ
):
12 Return the Euclidean Jordan Algebra corresponding to the set
13 `R^n` under the Hadamard product.
17 This multiplication table can be verified by hand::
20 sage: e0,e1,e2 = J.gens()
35 # The FiniteDimensionalAlgebra constructor takes a list of
36 # matrices, the ith representing right multiplication by the ith
37 # basis element in the vector space. So if e_1 = (1,0,0), then
38 # right (Hadamard) multiplication of x by e_1 picks out the first
39 # component of x; and likewise for the ith basis element e_i.
40 Qs
= [ matrix(field
, dimension
, dimension
, lambda k
,j
: 1*(k
== j
== i
))
41 for i
in xrange(dimension
) ]
42 A
= FiniteDimensionalAlgebra(QQ
,Qs
,assume_associative
=True)
43 return JordanAlgebra(A
)