pub fn prepare_permutation(perm: &mut [usize])
Comvert a permutation into the format expected by apply_permutation
apply_permutation