Inmathematics, ananti-diagonal matrix is asquare matrix where all the entries are zero except those on thediagonal going from the lower left corner to the upper right corner (↗), known as the anti-diagonal (sometimes Harrison diagonal, secondary diagonal, trailing diagonal, minor diagonal, off diagonal or bad diagonal).
Ann-by-n matrixA is an anti-diagonal matrix if the(i,j)th elementaij is zerofor all rowsi and columnsj whose indices do not sum ton + 1. Symbolically:
An example of an anti-diagonal matrix is
Another example would be...which can be used to reverse the elements of an array (as a column matrix) by multiplying on the left.
All anti-diagonal matrices are alsopersymmetric.
The product of two anti-diagonal matrices is adiagonal matrix. Furthermore, the product of an anti-diagonal matrix with a diagonal matrix is anti-diagonal, as is the product of a diagonal matrix with an anti-diagonal matrix.
An anti-diagonal matrix isinvertible if and only if the entries on the diagonal from the lower left corner to the upper right corner are nonzero. The inverse of any invertible anti-diagonal matrix is also anti-diagonal, as can be seen from the paragraph above. Thedeterminant of an anti-diagonal matrix hasabsolute value given by theproduct of the entries on the diagonal from the lower left corner to the upper right corner. However, the sign of this determinant will vary because the one nonzero signed elementary product from an anti-diagonal matrix will have a different sign depending on whether thepermutation related to it is odd or even:
| Matrix size | Permutation for nonzero elementary product of anti-diagonal matrix | Even or odd | Sign of elementary product |
|---|---|---|---|
| 2 × 2 | {2, 1} | Odd | − |
| 3 × 3 | {3, 2, 1} | Odd | − |
| 4 × 4 | {4, 3, 2, 1} | Even | + |
| 5 × 5 | {5, 4, 3, 2, 1} | Even | + |
| 6 × 6 | {6, 5, 4, 3, 2, 1} | Odd | − |
More precisely, the sign of the elementary product needed to calculate the determinant of an anti-diagonal matrix is related to whether the correspondingtriangular number is even or odd. This is because the number of inversions in the permutation for the only nonzero signed elementary product of anyn ×n anti-diagonal matrix is always equal to thenth such number.