# How to find the permutation matrix associated with the similarity transformation in the following code

m = matrix(QQbar,6,[2,-1,-I,0,0,0, -1,2,-1,0,0,0,i,-1,3,-1,0,0, 0,0,-1,2,-1,0, 0,0,0,-1,2,-1, 0,0,0,0,-1,1])

j=matrix(QQbar,6,[2,-1,0,-I,0,0, -1,2,-1,0,0,0,0,-1,2,-1,0,0, I,0,-1,3,0,-1, 0,0,0,0,1,-1, 0,0,0,-1,-1,2])

the matrices m,j are similar via a permutation matrix. How I can find that matrix.

Have you read the answers to this question, in particular Dan's?

The following code searches for permutation matrices $S$ that satisfy $MS=SJ$.

Nothing found.

Which is the source of the problem?m = matrix(QQbar,6,[2,-1,-I,0,0,0, -1,2,-1,0,0,0,i,-1,3,-1,0,0, 0,0,-1,2,-1,0, 0,0,0,-1,2,-1, 0,0,0,0,-1,1]) n = matrix(QQbar,6,[2,-1,0,-I,0,0,-1,2,-1,0,0,0,0,-1,2,-1,0,0,i,0,-1,3,-1,0,0,0,0,-1,2,-1, 0,0,0,0,-1,1]) Actually the problem was as follows: Suppose we find out the all possible permutation similar matrices for both the matrices m,n. Now I want to take the intersection of these two set of collections