]>
gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/eja/euclidean_jordan_algebra.py
be281bfb99d0ef86e73fa7d4a2d3643f54d605e3
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_minimal_polynomial(x
):
12 Return the minimal polynomial of ``x`` in its parent EJA
14 return x
._x
.matrix().minimal_polynomial()
17 def eja_rn(dimension
, field
=QQ
):
19 Return the Euclidean Jordan Algebra corresponding to the set
20 `R^n` under the Hadamard product.
24 This multiplication table can be verified by hand::
27 sage: e0,e1,e2 = J.gens()
42 # The FiniteDimensionalAlgebra constructor takes a list of
43 # matrices, the ith representing right multiplication by the ith
44 # basis element in the vector space. So if e_1 = (1,0,0), then
45 # right (Hadamard) multiplication of x by e_1 picks out the first
46 # component of x; and likewise for the ith basis element e_i.
47 Qs
= [ matrix(field
, dimension
, dimension
, lambda k
,j
: 1*(k
== j
== i
))
48 for i
in xrange(dimension
) ]
49 A
= FiniteDimensionalAlgebra(QQ
,Qs
,assume_associative
=True)
50 return JordanAlgebra(A
)
53 def eja_ln(dimension
, field
=QQ
):
55 Return the Jordan algebra corresponding to the Lorenzt "ice cream"
56 cone of the given ``dimension``.
60 This multiplication table can be verified by hand::
63 sage: e0,e1,e2,e3 = J.gens()
79 In one dimension, this is the reals under multiplication::
88 id_matrix
= identity_matrix(field
,dimension
)
89 for i
in xrange(dimension
):
90 ei
= id_matrix
.column(i
)
91 Qi
= zero_matrix(field
,dimension
)
94 Qi
+= diagonal_matrix(dimension
, [ei
[0]]*dimension
)
95 # The addition of the diagonal matrix adds an extra ei[0] in the
96 # upper-left corner of the matrix.
97 Qi
[0,0] = Qi
[0,0] * ~
field(2)
100 A
= FiniteDimensionalAlgebra(QQ
,Qs
,assume_associative
=True)
101 return JordanAlgebra(A
)