# Partial differentiation second order

I have some rules for differentiation:

myD[-a_, o_] := -myD[a, o];
myD[a_, -o_] := -myD[a, o];
myD[a_ + n_, o_] := myD[a, o] + myD[n, o];
myD[a_ b_, o_] := b myD[a, o] + a myD[b, o];
myD[myD[a_, b__], c__] := myD[a, b, c]
\$Assumptions =
x \[Element] Matrices[{2*M, 2*M}, Reals, Antisymmetric[{1, 2}]]
x[arg__] /; ! OrderedQ@{arg} := Signature@{arg} x @@ Sort@{arg}
Format[x[arg__]] := Subscript[x, arg]


What to do to create a new rule that defines, $$\frac{\partial ^2Q}{\partial x_{1,2}\, \partial x_{3,4}}=\frac{\partial ^2Q}{\partial x_{3,4}\, \partial x_{1,2}}$$

myD[myD[Q, x[1, 2]], x[3, 4]]


is how to write code to get $$\frac{\partial ^2Q}{\partial x_{1,2}\, \partial x_{3,4}}$$

myD[a_, o__] /; ! OrderedQ@{o} := myD[a, Sequence @@ Sort@{o}]

This will ensure that the coordinates after which the expression is differentiated are always sorted. You can define another order instead of Sort{o}, but the key is that all equivalent forms are converted into a single canonical version:
myD[myD[Q, x[1, 2]], x[3, 4]] == myD[myD[Q, x[3, 4]], x[1, 2]]