| 1 | initial version |
For each nonnegative integer $k$, you could find the possible tuples of matrices $(A_1, ..., A_k)$ as follows:
for each of -1, 0, 1, find the ways to write it
as a sum of $k$ summands each in {-1, 0, 1}.
the target matrix $M$ has $n^2$ entries $m_{i, j}$; so the $(A_1, ..., A_k)$ are obtained by combining all the possible ways to get each entry.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.