I have a function that outputs a large expression containing dot products of vectors. None of the vector components are known, so all dot products are symbolic. For instance, part of the output may look like2(p1.q1)(p3.p2) + (p1.p2)^2
.
I know what some of the dot products evaluate to. For example, I know things like:
p1.p1 = m
p1.p2 = 0
I want mathematica to simplify the expression as much as possible, making use of the known dot products and being sure to simplify all possible cancellation.
What is a good way to do this?
The way I am currently doing it is clunky and doesn't always work well. What I did was define a dot product function d[x,y]
and then explicitly specified some of the dot products like d[p1,p2] = m
and d[p1,p2] = 0
. This became cumbersome because I constantly had to explicitly input commutitivity for each dot product (i.e. d[p1,p2] = d[p2,p1] = 0
), and even when I did this, mathematica was not fully taking commutitivity into account when simplifying (via FullSimplify) my expression. Is there a better way?
d
function, you couldSetAttributes[d,Orderless]
. Then all you need to define isd[p1,p2]=m
(shouldn't the m be squared?). Thend[p1,p2]
andd[p2,p1]
will automatically be replaced withm
. $\endgroup$TransformationFuntions
that is given toSimplify
to teach it to handle expressions involving yourd
function. $\endgroup$