def remove_gate_from_kraus(
    kraus_ops: list[NDArray[np.complex128]], gate_matrix: NDArray[np.complex128]
):  # pragma: no cover
    """Recover the kraus operators from a kraus composed with a gate.
    This function is the reverse of append_kraus_to_gate.

    Args:
        kraus_ops: A list of Kraus Operators.
        gate_matrix: The gate unitary.

    Returns:
        The noise channel without the gate unitary.
    """
    return [kju @ gate_matrix.conj().T for kju in kraus_ops]
Recover the kraus operators from a kraus composed with a gate.
    This function is the reverse of append_kraus_to_gate.

    Args:
        kraus_ops: A list of Kraus Operators.
        gate_matrix: The gate unitary.

    Returns:
        The noise channel without the gate unitary.
    
cirq-rigetti/cirq_rigetti/quil_input.py