Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Add parameter sweep support for Pauli string measurements with readout mitigation

Open ddddddanni opened this issue 7 months ago • 4 comments

https://github.com/quantumlib/Cirq/pull/7236 and https://github.com/quantumlib/Cirq/pull/7067 builds a tool for measuring expectation values of Pauli strings with readout error mitigation. This pr enhances the tool by providing option for sweep-based execution. The new sweep mode could make it faster for external users since for them sweep operations can be more efficient than run_batch with large circuit lists. The changes include:

  1. Adding a new function run_sweep_with_readout_benchmarking which runs the sweep circuits with readout error benchmarking (without shuffling).
  2. Allow user to run measuring_pauli_strings in sweep mode. In this mode, the function uses parameterized circuits and sweeps parameters for both Pauli measurements and readout benchmarking

ddddddanni avatar May 20 '25 00:05 ddddddanni

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.68%. Comparing base (513f309) to head (1c46aae). Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #7358    +/-   ##
========================================
  Coverage   98.68%   98.68%            
========================================
  Files        1112     1112            
  Lines       97588    97776   +188     
========================================
+ Hits        96307    96495   +188     
  Misses       1281     1281            

: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 May 22 '25 21:05 codecov[bot]

Hey @eliottrosenberg and @NoureldinYosri, can you take a look when you have time? Thank you!

ddddddanni avatar May 23 '25 00:05 ddddddanni

Thanks, @ddddddanni! I tried testing this through Quantum Engine, and I got the error ValueError: Unsupported type for serializing const sweep: value=1 and type(value)=<class 'numpy.int64'>. See this colab for details.

this issue is not related to this PR .. https://github.com/quantumlib/Cirq/pull/7398/ will fix it

NoureldinYosri avatar May 30 '25 22:05 NoureldinYosri

@ddddddanni I reviewed a couple of files, but this a big PR .. can it be broken down into smaller PRs?

Sure! Just send https://github.com/quantumlib/Cirq/pull/7435 for review. https://github.com/quantumlib/Cirq/pull/7435 only touches the readout benchmarking thing and is a lot smaller than this PR.

ddddddanni avatar Jun 24 '25 23:06 ddddddanni

This pull request has been automatically labeled as stale because 90 days have passed without comments or other activity. If no further activity occurs and the status/stale label is not removed by a maintainer within 60 days, this pull request will be closed. If you would like to restore its active status, please leave a comment here; doing so will cause the staleness handler to remove the label.

If you have questions or feedback about this process, we welcome your input. You can open a new issue to let us know (please also reference this issue there, for continuity), or reach out to the project maintainers at [email protected].

github-actions[bot] avatar Sep 23 '25 00:09 github-actions[bot]

@ddddddanni Another gentle ping, this time about this other PR.

mhucka avatar Oct 13 '25 23:10 mhucka

@ddddddanni Another gentle ping, this time about this other PR.

This is actually done. I made two separate PRs and the sweep function is added. I will abort this one.

ddddddanni avatar Oct 14 '25 01:10 ddddddanni