Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Add measure_on_full_support to optimize Pauli string readout mitigation

Open ddddddanni opened this issue 1 month ago • 2 comments

This PR introduces a new argument, measure_on_full_support, to the measure_pauli_strings function. This feature significantly reduces the overhead of readout error calibration when measuring a large number of Pauli strings that act on different subsets of qubits.

ddddddanni avatar Nov 17 '25 20:11 ddddddanni

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 99.38%. Comparing base (ad37bb7) to head (339897d). :warning: Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7760   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files        1090     1090           
  Lines       98248    98260   +12     
=======================================
+ Hits        97643    97655   +12     
  Misses        605      605           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 17 '25 20:11 codecov[bot]

I tested it in this colab, and it seems that when adding the measure gates to the circuits to measure the specified Pauli operators, it is measuring all of the qubits even when measure_on_full_support=False.

Discussed offline, we should not measure all qubits in https://github.com/quantumlib/Cirq/blob/843f216ce5dddba4ad247667cc75537c96218a55/cirq-core/cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation.py#L289, only qubits in the pauli_str needs to be measured. This is bug in the code before this change, and I will send out a PR to fix this tmr.

ddddddanni avatar Dec 10 '25 06:12 ddddddanni