pub fn get_permutation(lro: &[Variable]) -> Vec<usize> {
    // For each variable store the indexes where it appears.
    let mut last_usage: HashMap<Variable, usize> = HashMap::new();
    let mut permutation = vec![0_usize; lro.len()];

    for _ in 0..2 {
        for (index, variable) in lro.iter().enumerate() {
            if last_usage.contains_key(variable) {
                permutation[index] = last_usage[variable];
            }
            last_usage.insert(*variable, index);
        }
    }

    permutation
}
This method takes the `LRO` matrix and computes the permutation used in PLONK to
build the copy constraint polynomial.
crates/provers/plonk/src/constraint_system/mod.rs