From 6beb5d9be0574fd57b355125d4629b20adef7149 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 4 Aug 2019 21:06:13 -0400 Subject: [PATCH] eja: switch some index orderings to agree with row-then-column semantics. This doesn't actually affect anything in these cases, but the row "i" indices should be on the outside whenever we loop through a two-dimensional array that corresponds to a matrix. --- mjo/eja/eja_algebra.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 70f04ef..8fe3a3c 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -638,8 +638,8 @@ class RealCartesianProductEJA(FiniteDimensionalEuclideanJordanAlgebra): """ def __init__(self, n, field=QQ): V = VectorSpace(field, n) - mult_table = [ [ V.basis()[i]*(i == j) for i in range(n) ] - for j in range(n) ] + mult_table = [ [ V.basis()[i]*(i == j) for j in range(n) ] + for i in range(n) ] fdeja = super(RealCartesianProductEJA, self) return fdeja.__init__(field, mult_table, rank=n) @@ -826,7 +826,7 @@ def _multiplication_table_from_matrix_basis(basis): V = VectorSpace(field, dimension**2) W = V.span_of_basis( _mat2vec(s) for s in basis ) n = len(basis) - mult_table = [[W.zero() for i in range(n)] for j in range(n)] + mult_table = [[W.zero() for j in range(n)] for i in range(n)] for i in range(n): for j in range(n): mat_entry = (basis[i]*basis[j] + basis[j]*basis[i])/2 @@ -1292,7 +1292,7 @@ class JordanSpinEJA(FiniteDimensionalEuclideanJordanAlgebra): """ def __init__(self, n, field=QQ): V = VectorSpace(field, n) - mult_table = [[V.zero() for i in range(n)] for j in range(n)] + mult_table = [[V.zero() for j in range(n)] for i in range(n)] for i in range(n): for j in range(n): x = V.basis()[i] -- 2.44.2