Skip to content

Conversation

ddddddanni
Copy link
Collaborator

#7236 and #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

@github-actions github-actions bot added size: L 250< lines changed <1000 size: XL lines changed >1000 and removed size: L 250< lines changed <1000 labels May 20, 2025
Copy link

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@ddddddanni ddddddanni marked this pull request as ready for review May 23, 2025 00:28
@ddddddanni ddddddanni requested review from a team and vtomole as code owners May 23, 2025 00:28
@ddddddanni
Copy link
Collaborator Author

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

Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@NoureldinYosri
Copy link
Collaborator

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 .. #7398 will fix it

Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @ddddddanni! Thank you!!

Tested in this colab.

@NoureldinYosri NoureldinYosri self-requested a review June 4, 2025 23:15
@NoureldinYosri NoureldinYosri self-assigned this Jun 4, 2025
Copy link
Collaborator

@NoureldinYosri NoureldinYosri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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



def _pauli_strings_to_basis_change_with_sweep(
pauli_strings: list[ops.PauliString], qid_list: list[ops.Qid]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when these pauli strings share qubits?

if pauli_op == ops.X:
params_dict[f"phi{qid}"] = 0.0
params_dict[f"theta{qid}"] = 1 / 2
break
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the assumption is that each qubit belongs to at most one paulistring?

pauli_measurement_circuits.extend(basis_change_circuits)
sweep_params = list[study.Sweepable]()
circuits_results: Union[Sequence[ResultDict], Sequence[Sequence[study.Result]]] = []
# calibration_results = list[Dict[Tuple[ops.Qid, ...], SingleQubitReadoutCalibrationResult]]()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@ddddddanni
Copy link
Collaborator Author

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

Sure! Just send #7435 for review. #7435 only touches the readout benchmarking thing and is a lot smaller than this PR.

github-merge-queue bot pushed a commit that referenced this pull request Aug 2, 2025
Requested by @NoureldinYosri, this pr is splited from
#7358.

The pr adds a new function run_sweep_with_readout_benchmarking which
runs the sweep circuits with readout error benchmarking (without
shuffling).
Copy link

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 github-actions bot added the status/stale This has been closed due to inactivity for an extended period of time. label Sep 23, 2025
@github-actions github-actions bot removed the status/stale This has been closed due to inactivity for an extended period of time. label Sep 24, 2025
@mhucka
Copy link
Contributor

mhucka commented Oct 13, 2025

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

@ddddddanni
Copy link
Collaborator Author

@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 ddddddanni closed this Oct 14, 2025
@github-project-automation github-project-automation bot moved this from Waiting to Resolved in Follow-up tracker Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XL lines changed >1000

Projects

Status: Resolved

Development

Successfully merging this pull request may close these issues.

4 participants