3
$\begingroup$

My code below returns the list: {1, 3, 2, 4}. I want the disjoint cycle representation of this permutation. In other words, I want: Cycles[{{2, 3}}]. I tried PermutationCycles[list], but this does not work.

T = {{0, 1}, {1, 0}};
list = Map[MatrixForm, Map[Mod[T.#, 2] &, Tuples[{0, 1}, 2]] /. Table[Tuples[{0, 1}, 2][[i]] -> i, {i, 1, 4}]
$\endgroup$
3
  • 2
    $\begingroup$ remove the MatrixForm wrapper. (that is, use list2 = Map[Mod[T.#, 2] &, Tuples[{0, 1}, 2]] /. Table[Tuples[{0, 1}, 2][[i]] -> i, {i, 1, 4}]; PermutationCycles @ list2) $\endgroup$
    – kglr
    Commented Jul 3, 2021 at 12:26
  • 3
    $\begingroup$ or more directly, PermutationCycles@Ordering@Mod[Tuples[{0, 1}, 2].T, 2]? $\endgroup$
    – kglr
    Commented Jul 3, 2021 at 12:28
  • 3
    $\begingroup$ PermutationCycles[{1, 3, 2, 4}] will do the job. $\endgroup$ Commented Jul 3, 2021 at 18:42

0

Browse other questions tagged or ask your own question.