Permutation similar matrices
How to generate the class of all permutation similar matrices of a given square matrix?
How to generate the class of all permutation similar matrices of a given square matrix?
sage: M = random_matrix(ZZ,3,3)
sage: M
[-2 0 -6]
[ 0 1 3]
[ 0 3 1]
sage: P = [matrix(p) for p in Permutations(3)]
sage: similar = [p*M*~p for p in P]
sage: similar
[
[-2 0 -6] [-2 -6 0] [ 1 0 3] [ 1 0 3] [ 1 3 0] [ 1 3 0]
[ 0 1 3] [ 0 1 3] [ 0 -2 -6] [-6 -2 0] [ 3 1 0] [ 3 1 0]
[ 0 3 1], [ 0 3 1], [ 3 0 1], [ 3 0 1], [ 0 -6 -2], [-6 0 -2]
]
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2017-02-15 19:18:48 +0100
Seen: 1,203 times
Last updated: Feb 16 '17
If the answer below worked for you, you can click the checkmark to its left to accept the answer.