I have matrices with entries where the order of the entries is important. Unfortunately Mathematica resorts terms in products in a lexicographic order. For example,
A = {{a1, a2}, {a3, a4}};
B = {{b1, b2}, {b3, b4}};
Z = {{z1, z2}, {z3, z4}};
Z.B.A
(* {{a1 (b1 z1 + b3 z2) + a3 (b2 z1 + b4 z2),
a2 (b1 z1 + b3 z2) + a4 (b2 z1 + b4 z2)}, {a1 (b1 z3 + b3 z4) +
a3 (b2 z3 + b4 z4), a2 (b1 z3 + b3 z4) + a4 (b2 z3 + b4 z4)}} *)
I would like that Mathematica keeps the order of the terms as they appear in the product, i.e.
(* z1 b1 a1 + ... *)
How can the lexicographic ordering be disabled?
Dot
withInner
, where you can direct it to useNonCommutativeMultiply
in place ofTimes
. $\endgroup$ – Daniel Lichtblau Jan 30 '16 at 22:15