def test_circuit_superoperator_fixed_values(circuit, expected_superoperator):
    """Tests Circuit._superoperator_() on a few simple circuits."""
    assert circuit._has_superoperator_()
    assert np.allclose(circuit._superoperator_(), expected_superoperator)
Tests Circuit._superoperator_() on a few simple circuits.
cirq-core/cirq/circuits/circuit_test.py