1 Trace inner product tests:
5 The trace inner product is commutative::
7 sage: set_random_seed()
9 sage: x = J.random_element(); y = J.random_element()
10 sage: x.trace_inner_product(y) == y.trace_inner_product(x)
13 The trace inner product is bilinear::
15 sage: set_random_seed()
16 sage: J = random_eja()
17 sage: x = J.random_element()
18 sage: y = J.random_element()
19 sage: z = J.random_element()
20 sage: a = QQ.random_element();
21 sage: actual = (a*(x+z)).trace_inner_product(y)
22 sage: expected = a*x.trace_inner_product(y) + a*z.trace_inner_product(y)
23 sage: actual == expected
25 sage: actual = x.trace_inner_product(a*(y+z))
26 sage: expected = a*x.trace_inner_product(y) + a*x.trace_inner_product(z)
27 sage: actual == expected
30 The trace inner product is associative::
34 The trace inner product satisfies the compatibility
35 condition in the definition of a Euclidean Jordan algebra:
37 sage: set_random_seed()
38 sage: J = random_eja()
39 sage: x = J.random_element()
40 sage: y = J.random_element()
41 sage: z = J.random_element()
42 sage: (x*y).trace_inner_product(z) == y.trace_inner_product(x*z)