ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 20 Feb 2017 20:38:38 +0100Permutation similar matriceshttps://ask.sagemath.org/question/36631/permutation-similar-matrices/ How to generate the class of all permutation similar matrices of a given square matrix? Wed, 15 Feb 2017 19:18:48 +0100https://ask.sagemath.org/question/36631/permutation-similar-matrices/Comment by fidbc for <p>How to generate the class of all permutation similar matrices of a given square matrix? </p>
https://ask.sagemath.org/question/36631/permutation-similar-matrices/?comment=36678#post-id-36678If the answer below worked for you, you can click the checkmark to its left to accept the answer.Mon, 20 Feb 2017 20:38:38 +0100https://ask.sagemath.org/question/36631/permutation-similar-matrices/?comment=36678#post-id-36678Answer by Sébastien for <p>How to generate the class of all permutation similar matrices of a given square matrix? </p>
https://ask.sagemath.org/question/36631/permutation-similar-matrices/?answer=36639#post-id-36639 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]
]
Thu, 16 Feb 2017 09:37:43 +0100https://ask.sagemath.org/question/36631/permutation-similar-matrices/?answer=36639#post-id-36639