I want to work with linear expressions involving the formal symbol $w[a_1,...,a_n]$, and I would like Mathematica to know that expressions such as

w[a,b,d] + w[a,d,b] = 0

i.e. that the symbol w is antisymmetric with respect to the swap of any of its entries. What is the best way to implement this?


2 Answers 2


Here's a variation of Roman's answer that doesn't require the application of ReplaceAll to simplify things:

a_w /; !OrderedQ @ Unevaluated @ a := Signature[Unevaluated[a]]Sort[Unevaluated[a]]

Your example:

w[a, b, d] + w[a, d, b]


Another possibility is to use the symbolic tensor capabilities of Mathematica. For example:

    w + TensorTranspose[w, {1, 3, 2}],
    Assumptions -> w ∈ Arrays[{n, n, n}, Complexes, Antisymmetric[{1,2,3}]]


  • $\begingroup$ Carl, can you please add a little bit of explanation on your use of Unevaluated in your first solution? Thanks! $\endgroup$
    – Roman
    Mar 30, 2019 at 9:48

You can do it by simplifying every mention of w to its sorted form:

w[a, b, d] + w[a, d, b] /. W_w :> Signature[W]*Sort[W]


{w[a, b, d], w[a, d, b], w[b, a, d], w[b, d, a], w[d, a, b], w[d, b, a]} /.
  W_w :> Signature[W]*Sort[W]

{w[a, b, d], -w[a, b, d], -w[a, b, d], w[a, b, d], w[a, b, d], -w[a, b, d]}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.