Investigate why the standard deviation of pauli_string_measurement_results is high
The property mitigated_stddev of PauliStringMeasurementResult seems higher than it should https://github.com/quantumlib/Cirq/pull/7571#discussion_r2283320273. The purpose of this issue is to invisitigate whether this is logical or if there is something missing or wrong.
cc: @ddddddanni
@ddddddanni - can you please put a short comment here so I can assign this to you?
Discussed in Cirq Cynq 2025-08-20: yes, this needs looking into.
@ddddddanni - can you please put a short comment here so I can assign this to you?
Sure! Please assign this to me.
I looked at my code and this is actually expected. The std is raw_d_m * abs(pauli_str.coefficient.real) where pauli_str.coefficient.real could be any number, this explains why the std could be 2. Similarly expectation is calculated by raw_mitigated_values * pauli_str.coefficient.real, so it could also be something beyond [-1, 1].
But with this, I need to rethink how to fix the flaky tests. It might not be that flaky since I increase the number of readout mitigations, but it's still likely to fall since the expectation could be a lot larger/smaller than 1/-1.