pub fn gate_vec_to_array2(matrix: &[Complex64], dim: usize) -> Array2<Complex64>
Convert a matrix representation of a gate (row-major) to a 2D ndarray