Reverse[type]
reverses the order of matrices of specified type
. Reverse[type1, type2, …]
reverses the order of matrices of types type1
, type2
, … in expressions.Reverse product of matrices:
defineMatrices 'A', 'B', 'C', Matrix1.matrix def t = 'A*B*C'.t println t
> A*B*C
println Reverse[Matrix1] >> t
> C*B*A
Reverse does not affect traces:
defineMatrices 'A', 'B', 'C', Matrix1.matrix println Reverse[Matrix1] >> 'Tr[A*B*C]'.t
> Tr[A*B*C]
Reverse with respect to several types of matrices:
defineMatrices 'G_a', Matrix1.matrix, 'U_a', Matrix2.matrix def t = 'G_a*G_b*U_m*U_n'.t println Reverse[Matrix1, Matrix2] >> t
> G_b*G_a*U_n*U_m