Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

iam facing a repeated question , "index error in replacement rule", i want to know the reasons for this error?

in General questions by (130 points)

1 Answer

+1 vote

This means that the indices on the left-hand side and the right-hand side of a replacement rule do not match. For instance,

ex:=A_{m n};
substitute(ex, $A_{m n} = B_{m}$);

You would mess up your equations if it would allow such substitutions.

You can do this if you really want to, by using the -> notation,

substitute(ex, $A_{m n} -> B_{m}$);

This will work (but may of course still be wrong).

If you don't get the error from something like this, please post a minimal example.

by (83.1k points)

Thanks a lot, it works for me

...