def test_all_pauli_strings_are_pauli_i() -> None:
    """Test that all input pauli are pauli I"""
    qubits_1 = cirq.LineQubit.range(5)
    qubits_2 = [
        cirq.GridQubit(0, 1),
        cirq.GridQubit(1, 1),
        cirq.GridQubit(1, 0),
        cirq.GridQubit(1, 2),
        cirq.GridQubit(2, 1),
    ]

    circuit_1 = cirq.FrozenCircuit(_create_ghz(5, qubits_1))
    circuit_2 = cirq.FrozenCircuit(_create_ghz(5, qubits_2))

    circuits_to_pauli: dict[cirq.FrozenCircuit, list[cirq.PauliString]] = {}
    circuits_to_pauli[circuit_1] = [
        cirq.PauliString({q: cirq.I for q in qubits_1}),
        cirq.PauliString({q: cirq.X for q in qubits_1}),
    ]
    circuits_to_pauli[circuit_2] = [cirq.PauliString({q: cirq.X for q in qubits_2})]

    with pytest.raises(
        ValueError,
        match="Empty Pauli strings or Pauli strings consisting "
        "only of Pauli I are not allowed. Please provide "
        "valid input Pauli strings.",
    ):
        measure_pauli_strings(
            circuits_to_pauli, cirq.Simulator(), 1000, 1000, 1000, np.random.default_rng()
        )
Test that all input pauli are pauli I
cirq-core/cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation_test.py