A theorem in this paper1 states that every integral n-by-n matrix M over the integers with trace M = 0 is a commutator, that means there are two integral matrices A,B of the same size as M such that M = AB - BA.
Challenge
Given an integral matrix M with trace M = 0 find some integral matrices A,B such that M = AB - BA.
Details
- Let A,B be two matrices of compatible size, then AB denotes the matrix product of A and B which in general does not commute, so in general AB = BA does not hold. We can "measure" how close two matrices are to commuting with eachother by measuring how close the commutator - which is defined as AB - BA - is to being zero. (The commutator is sometimes also written as [A, B].)
- The trace of a matrix is the sum of the diagonal entries.
- The decomposition is not necessarily unique. You have to provide one decomposition.
Examples
Since the decomposition is not unique, you might get different results that are still valid. In the following we just consider some possible example.
M: A: B:
[ 1 0] [1 1] [1 0]
[-2 -1] [1 -1] [1 1]
In the trivial case of 1 x 1 matrices only M = 0 is possible, and any two integers A,B will solve the problem
M: A: B:
[0] [x] [y] for any integers x,y
Note that for M = 0 (a zero matrix of arbitrary size) implies AB = BA, so in this case any two matrices (A, B) that commute (for example if they are inverse to each other) solve the problem.
M: A: B:
[0 0] [2 3] [3 12]
[0 0] [1 4] [4 11]
M: A: B:
[11 12 12] [1 1 1] [1 2 3]
[ 7 4 0] [0 1 1] [4 5 6]
[ 0 -7 -15] [0 0 1] [7 8 9]
M: A: B:
[-11811 -9700 -2937] [ 3 14 15] [ 2 71 82]
[ -7749 -1098 8051] [92 65 35] [81 82 84]
[ 3292 7731 12909] [89 79 32] [59 4 52]
1: "Integral similarity and commutators of integral matrices" by Thomas J.Laffey, Robert Reams, 1994
[[1,1,1],[0,1,1],[0,0,1]]
and \$B\$[[1,2,3],[4,5,6],[7,8,9]]
would becomes the matrix \$M\$[[11,12,12],[7,4,0],[0,-7,-15]]
with \$M=AB-BA\$? EDIT: Actually, only for \$M=0\$ the \$AB=BA\$ applies I now re-read. So for a matrix containing only 0s, any \$A\$ and \$B\$ would be a correct result. I still don't really understand the challenge for non-\$M=0\$ cases though. (Probably my bad Math and matrices knowledge in general. ;p) \$\endgroup\$