]>
gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/eja/euclidean_jordan_algebra.py
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
) ]
50 # Assuming associativity is wrong here, but it works to
51 # temporarily trick the Jordan algebra constructor into using the
52 # multiplication table.
53 A
= FiniteDimensionalAlgebra(field
,Qs
,assume_associative
=True)
54 return JordanAlgebra(A
)
57 def eja_ln(dimension
, field
=QQ
):
59 Return the Jordan algebra corresponding to the Lorenzt "ice cream"
60 cone of the given ``dimension``.
64 This multiplication table can be verified by hand::
67 sage: e0,e1,e2,e3 = J.gens()
83 In one dimension, this is the reals under multiplication::
92 id_matrix
= identity_matrix(field
,dimension
)
93 for i
in xrange(dimension
):
94 ei
= id_matrix
.column(i
)
95 Qi
= zero_matrix(field
,dimension
)
98 Qi
+= diagonal_matrix(dimension
, [ei
[0]]*dimension
)
99 # The addition of the diagonal matrix adds an extra ei[0] in the
100 # upper-left corner of the matrix.
101 Qi
[0,0] = Qi
[0,0] * ~
field(2)
104 # Assuming associativity is wrong here, but it works to
105 # temporarily trick the Jordan algebra constructor into using the
106 # multiplication table.
107 A
= FiniteDimensionalAlgebra(field
,Qs
,assume_associative
=True)
108 return JordanAlgebra(A
)