def _pad_tableau(
    clifford_tableau: qis.CliffordTableau, num_qubits_after_padding: int, axes: list[int]
) -> qis.CliffordTableau:
    """Roughly, this function copies self.tableau into the "identity" matrix."""
    # Sanity check
    if len(set(axes)) != clifford_tableau.n:
        raise ValueError(
            "Input axes of padding should match with the number of qubits in the input tableau."
        )
    if clifford_tableau.n > num_qubits_after_padding:
        raise ValueError(
            "The number of qubits in the input tableau should not be larger than "
            "num_qubits_after_padding."
        )
    padded_tableau = qis.CliffordTableau(num_qubits_after_padding)
    v_index = np.concatenate((np.asarray(axes), num_qubits_after_padding + np.asarray(axes)))

    padded_tableau.xs[np.ix_(v_index, axes)] = clifford_tableau.xs
    padded_tableau.zs[np.ix_(v_index, axes)] = clifford_tableau.zs
    padded_tableau.rs[v_index] = clifford_tableau.rs
    return padded_tableau
Roughly, this function copies self.tableau into the "identity" matrix.
cirq-core/cirq/ops/clifford_gate.py