def test_superoperator_to_kraus_inverse_of_kraus_to_superoperator(superoperator) -> None:
    """Verifies that cirq.kraus_to_superoperator(cirq.superoperator_to_kraus(.)) is identity."""
    kraus = cirq.superoperator_to_kraus(superoperator)
    recovered_superoperator = cirq.kraus_to_superoperator(kraus)
    assert np.allclose(recovered_superoperator, superoperator)
Verifies that cirq.kraus_to_superoperator(cirq.superoperator_to_kraus(.)) is identity.
cirq-core/cirq/qis/channels_test.py