I have a list of expressions like the following:
{{X00 ** X10 + X01 ** X10 - X10 ** X01 - X10 ** X00 },
{X01 ** X10 - X10 ** X01 - X02 ** X10},
{X00 ** X12 - X12 ** X00}, {X01 ** X12 - X12 ** X01}, {X02 ** X13}}
where all Xij
are just symbols. Now suppose we define an expression like
[X0j,X1k] := X0j ** X1k - X1k ** X0j.
Is it possible to let Mathematica substitute all terms in the list that look like the right side of the last expression by its left side?
If necessary I can change the Xij
's in the list to something else.
[X0j,X1k]
is not syntactically correct Mathematica. Could you clarify what you mean by it? Could you please give an exampe of a possible substitution (I'm a little confused about what you need exactly)? $\endgroup$ – Szabolcs May 10 '12 at 7:19