- #1
Jusepè
- 2
- 0
Hello,
I have very complicated expressions containing scalar products like
a1*b1 + a2*b2 + a3*b3
In order to reduce the complexity, I would like to establish a set of rules like
rule={a1*b1 + a2*b2 + a3*b3 -> pAB, ...}
in order to replace each time the scalar product by an appropriate new symbol (pAB in the example).
The problem is that, apparently, Mathematica does not perform the substitution if in the expression the scalar products appear together with some multiplying factor; for example Mathematica fails to apply the previous rule if the expression is
-a1*b1 - a2*b2 - a3*b3
or
2a1*b1 + 2a2*b2 + 2a3*b3
How could solve this problem?
I have very complicated expressions containing scalar products like
a1*b1 + a2*b2 + a3*b3
In order to reduce the complexity, I would like to establish a set of rules like
rule={a1*b1 + a2*b2 + a3*b3 -> pAB, ...}
in order to replace each time the scalar product by an appropriate new symbol (pAB in the example).
The problem is that, apparently, Mathematica does not perform the substitution if in the expression the scalar products appear together with some multiplying factor; for example Mathematica fails to apply the previous rule if the expression is
-a1*b1 - a2*b2 - a3*b3
or
2a1*b1 + 2a2*b2 + 2a3*b3
How could solve this problem?