In Mathematica there is a very convenient function called JordanDecomposition[]
. It takes a square matrix A
as an argument and either diagonalizes it, or puts it into a block diagonal form A'
and provides the transformation matrix s
(such that A
can be recovered by A=s.A'.Inverse[s]
).
I was looking for a similar function which would anti-diagonalize the matrix A
instead of diagonalizing it (see http://en.wikipedia.org/wiki/Anti-diagonal_matrix) and would also return a corresponding transformation matrix s
. Is there such a function in Mathematica? Or maybe one can implement it? Thanks for any suggestion!
EDIT:
Some comments below suggest for me to better specify what I want to achieve. Let us look at an example:
A = DiagonalMatrix[{1, 2, 3}];
B = Table[Subscript[b, i, j], {i, 1, 3}, {j, 1, 3}];
Bi = Inverse[B] // Simplify;
vars = Flatten[B];
sol = FindInstance[{(Bi.A.B)[[1, 1]]==0,(Bi.A.B)[[2, 1]]==0,(Bi.A.B)[[3, 2]]==0,(Bi.A.B)[[3, 3]]==0,Det[B]==1},vars][[1]];
Note how the condition Det[B]==1
enforces the sought after transformation to be determinant preserving. The result I get is:
Bi.A.B /. sol // MatrixForm
$$ \left( \begin{array}{ccc} 0 & -\frac{5}{2} & -11 \\ 0 & 6 & 24 \\ 1 & 0 & 0 \end{array} \right) $$
As you can see, the transformation by an explicitly found B
has put originally diagonal matrix A
into a block anti-diagonal form. By inspection you can convince yourself that trying to get Bi.A.B
to be even more anti-diagonal by introducing more constraints in FindInstance[...]
will not yield any solution any more. This suggests that a block anti-diagonal form of the type found above is the best we can do for the matrix A
. It is certainly true that if A
was the unit matrix, it would already automatically be in its best block anti-diagonal form. However, having one such special example does not render the question invalid for other more general classes of matrices. Basically, I am looking for a solution that robustly automates the above procedure done "by hand" for matrices of arbitrary dimension and returns the transformation matrix B
for a best-possible anti-diagonalisation of A
.
FindInstance[]
function above byReduce[]
we will see that there exists a whole class of matricesB
with adjustable elements. I do not think there is anything profound left to investigate mathematically, since I am looking for just a solution and not "the" special solution. What is left to be found is an implementation. That is why I ask the question here. $\endgroup$