fn mix(state: &mut [FE<Self::F>]) {
        let mut new_state: Vec<FE<Self::F>> = Vec::with_capacity(Self::STATE_SIZE);
        for i in 0..Self::STATE_SIZE {
            let mut new_e = FE::zero();
            for (j, current_state) in state.iter().enumerate() {
                let mut mij = Self::MDS_MATRIX[i * Self::N_MDS_MATRIX_COLS + j].clone();
                mij *= current_state;
                new_e += mij;
            }
            new_state.push(new_e);
        }
        state.clone_from_slice(&new_state[0..Self::STATE_SIZE]);
    }
This is the mix function that operates with the MDS matrix
Round Constants are sometimes picked to simplify this function,
so it can be redefined by each set of permutation parameters if a simplification can be made to make it faster. Notice in that case, MDS constants may not be used.
crates/crypto/src/hash/poseidon/parameters.rs