Skip to main content

equation solving - Finding an Integer, Unimodular Matrix that connects two given matrices


I have two symmetric, integer matrices, $K$ and $K_2$ which have the same determinant and the same signature (number of positive - number of negative eigenvalues). I want to find an integer valued matrix, $X$, such that $$X^T K X= K_2$$ and determinant of $X = \pm 1$.


For example,


K = {{0, 2, 1, 1}, {2, 0, 0, 0}, {1, 0, 1, 0}, {1, 0, 0, -1}};
K2 = {{0, 2, 0, 0}, {2, 0, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, -1}};


Is there a way to approach this besides using FindInstance (which doesn't seem to work in finite time for even a $4\times4$ matrix)? The system is under constrained since the matrices are symmetric, but I'm just looking for a way to find even one such $X$ for a given pair, $K$ and $K_2$, which could be as large as $8\times8$.



Answer



Using Smith Normal Form you can get two integer matrices with determinant 1 that would satisfy the equation


$$X1.K.X2 = K_2$$


May be this is a good start you can use...


resK = SmithDecomposition[K];
MatrixForm /@ resK

resK2 = SmithDecomposition[K2];

MatrixForm /@ resK2

resK[[2]] == resK2[[2]]
(* True *)

K2 ==
Inverse[resK2[[1]]].resK[[1]].K.resK[[3]].Inverse[resK2[[3]]]
(* True *)

X1 = Inverse[resK2[[1]]].resK[[1]];


X2 = resK[[3]].Inverse[resK2[[3]]];

X1.K.X2 == K2
(* True *)

Det /@ {X1, X2}
(* {1, 1} *)

MatrixForm /@ {X1, X2}


enter image description here


Comments