1
$\begingroup$

The output of my current notebook contains expressions that look as follows

(V[{k,q},{s,t}] + V[{-k, -q}, {t,s}])

In my specific application these two functions are equal, so ideally I would want Mathematica to combine them when simplifying to give the output.

2 V[{k,q},{s,t}]

I assume I have to define some property of the V function, but I can't really figure out how to do this. More generally I want V to be invariant under the argument tranformation where the last two arguments are flipped, and the first two arguments have their sign flipped.

Thanks in advance!

$\endgroup$
  • $\begingroup$ V[{k, q}, {s, t}] + V[{-k, -q}, {t, s}] /. V[{-k_, -q_}, {t_, s_}] -> V[{k, q}, {s, t}]? $\endgroup$ – AccidentalFourierTransform May 9 at 12:48
  • 1
    $\begingroup$ You can define some sort of canonical form. For example, demand that the second list should always be sorted (ordered). Here is the rule which sorts second list and adjusts the signs of the first list accordingly. myexpression /. V[{a_, b_}, {c_, d_}] :> V[{-a, -b}, {d, c}] /; Not[OrderedQ[{c, d}]] $\endgroup$ – Shadowray May 9 at 13:27
  • $\begingroup$ Thanks a lot for the answers! Shadowrays solution works for me. $\endgroup$ – Jasper May 9 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.