I am looking for a way to simplify dot products etc.
Here is a minimal example: Lets say I have two vectors a and b:
Array[a,2]
Array[b,2]
Now I evaluate their dot product:
c = a.b
which should give me something like this
a[1]b[1] + a[2]b[2]
What I need is a way to transform this expression back into a dot product. So I am looking for a function that realises that I can write this as a.b (similiar to "Factor" for polynomial expressions), e.g.
Function[c]
should give
a.b
In a more general context, I would like to display scalars as vector/matrix/tensor expressions, meaning mathematica should also realize that
m[1,1] + m[2,2]
is simply
Tr[m]
and display it as such.
Is that possible?
Thank you!
{a1, a2}.{b1 + c/a1, b2 - c/a2} // Simplify
. The second vector is a different one for every value of c. Yet the dot product is the same every time. $\endgroup$a[1]b[1] + a[2]b[2]
asa.b
ifa
andb
were already defined to bea={a[1],a[2]}, b={b[1],b[2]}
because in most cases, that is exactly the "inverse" I am looking for. It would remove a lot of clutter in my equations, since I have vectors with >100 entries... $\endgroup$