1
$\begingroup$

$x$ is a real antisymmetric matrix and is defined as:

Format[x[a_, b_]] := Subscript[x, a, b]
    $Assumptions = 
      x \[Element] Matrices[{4, 4}, Reals, Antisymmetric[{1, 2}]];
    x[arg__] /; ! OrderedQ@{arg} := Signature@{arg} x @@ Sort@{arg} 
    Format[x[arg__]] := Subscript[x, arg]

x[2,2] is expected to get zero. That is any repeated indices is zero. How to implement it in the above code?

$\endgroup$
1
  • $\begingroup$ x[a_, b_] := 1/2 (Array[A, {5, 5}] - Transpose@Array[A, {5, 5}])[[a, b]]; x[2,2] ? $\endgroup$
    – cvgmt
    Commented Jul 17, 2021 at 12:14

1 Answer 1

0
$\begingroup$

I think the following works

Format[x[a_, b_]] := Subscript[x, a, b]
$Assumptions = 
  x ∈ Matrices[{4, 4}, Reals, Antisymmetric[{1, 2}]];
x[arg__] /; SameQ[arg] := 0
x[arg__] /; ! OrderedQ@{arg} := Signature@{arg} x @@ Sort@{arg}

Your !OrderedQ test is not triggered for the diagonal elements.

$\endgroup$

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.