Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Investigate why the standard deviation of pauli_string_measurement_results is high

Open NoureldinYosri opened this issue 4 months ago • 6 comments

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.

NoureldinYosri avatar Aug 19 '25 17:08 NoureldinYosri

cc: @ddddddanni

pavoljuhas avatar Aug 19 '25 18:08 pavoljuhas

@ddddddanni - can you please put a short comment here so I can assign this to you?

pavoljuhas avatar Aug 20 '25 17:08 pavoljuhas

Discussed in Cirq Cynq 2025-08-20: yes, this needs looking into.

mhucka avatar Aug 20 '25 19:08 mhucka

@ddddddanni - can you please put a short comment here so I can assign this to you?

Sure! Please assign this to me.

ddddddanni avatar Aug 20 '25 20:08 ddddddanni

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].

ddddddanni avatar Aug 21 '25 03:08 ddddddanni

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.

ddddddanni avatar Aug 21 '25 03:08 ddddddanni