Skip to content

Conversation

@pavoljuhas
Copy link
Collaborator

Decrease count-like arguments of measure_pauli_strings from 1000 to 300
and increase the simulated readout errors so they can be estimated with
fewer repetitions.

Related to b/454743228

Decrease count-like arguments of `measure_pauli_strings` from 1000 to 300
and increase the simulated readout errors so they can be estimated with
fewer repetitions.

Related to b/454743228
@github-actions github-actions bot added the size: M 50< lines changed <250 label Nov 6, 2025
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.38%. Comparing base (21ee064) to head (e6e3736).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7740   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files        1091     1091           
  Lines       97912    97912           
=======================================
  Hits        97306    97306           
  Misses        606      606           

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

@pavoljuhas
Copy link
Collaborator Author

Here is a representative change of affected tests duration from

check/pytest --numprocesses=0 --durations=0 \
  cirq-core/cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation_test.py

BEFORE (21ee064)

============================== slowest durations ===============================
28.45s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy0-True]
27.82s call     ...mitigation_test.py::test_many_circuits_input_measurement_with_noise[True]
27.66s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy1-True]
26.21s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy0-False]
23.27s call     ...mitigation_test.py::test_many_circuits_input_measurement_with_noise[False]
23.16s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy1-False]
16.13s call     ...mitigation_test.py::test_pauli_string_measurement_errors_no_noise[True]
13.18s call     ...mitigation_test.py::test_pauli_string_measurement_errors_no_noise[False]
12.15s call     ...mitigation_test.py::test_many_group_pauli_in_circuits_with_coefficient[True]
11.95s call     ...mitigation_test.py::test_pauli_string_measurement_errors_with_noise[True]
11.53s call     ...mitigation_test.py::test_pauli_string_measurement_errors_with_noise[False]
11.01s call     ...mitigation_test.py::test_many_group_pauli_in_circuits_with_coefficient[False]
7.62s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_no_noise_with_coefficient[False]
7.52s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_no_noise_with_coefficient[True]
4.77s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_with_noise[True]
4.38s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_with_noise[False]

(75 durations < 0.005s hidden.  Use -vv to show these durations.)
======================== 31 passed in 257.08s (0:04:17) ========================

AFTER (e6e3736)

============================== slowest durations ===============================
4.09s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy0-False]
3.85s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy0-True]
3.75s call     ...mitigation_test.py::test_many_circuits_input_measurement_with_noise[True]
3.71s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy1-False]
3.67s call     ...mitigation_test.py::test_many_circuits_input_measurement_with_noise[False]
3.20s call     ...mitigation_test.py::test_many_circuits_with_coefficient[insert_strategy1-True]
1.67s call     ...mitigation_test.py::test_many_group_pauli_in_circuits_with_coefficient[True]
1.65s call     ...mitigation_test.py::test_pauli_string_measurement_errors_no_noise[False]
1.62s call     ...mitigation_test.py::test_pauli_string_measurement_errors_with_noise[True]
1.51s call     ...mitigation_test.py::test_many_group_pauli_in_circuits_with_coefficient[False]
1.45s call     ...mitigation_test.py::test_pauli_string_measurement_errors_no_noise[True]
1.45s call     ...mitigation_test.py::test_pauli_string_measurement_errors_with_noise[False]
1.02s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_no_noise_with_coefficient[False]
0.99s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_no_noise_with_coefficient[True]
0.79s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_with_noise[True]
0.51s call     ...mitigation_test.py::test_group_pauli_string_measurement_errors_with_noise[False]

(75 durations < 0.005s hidden.  Use -vv to show these durations.)
============================= 31 passed in 35.16s ==============================

@pavoljuhas pavoljuhas marked this pull request as ready for review November 6, 2025 22:39
@pavoljuhas pavoljuhas requested review from a team and vtomole as code owners November 6, 2025 22:39
Copy link
Collaborator

@ddddddanni ddddddanni left a comment

Choose a reason for hiding this comment

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

I'm a little worried this would lead to more test failures, since we reduce the counts for pauli_repetitions and readout_repetitions. Otherwise looks good to me!

@pavoljuhas
Copy link
Collaborator Author

I'm a little worried this would lead to more test failures, since we reduce the counts for pauli_repetitions and readout_repetitions. Otherwise looks good to me!

Ack. I ran a batch of 100 repeats of these tests with different pytest-randomly seeds which all passed fine. We can increase the counts or error tolerances if errors starts showing up on the CI.

@pavoljuhas
Copy link
Collaborator Author

BTW, this noticeably shortens the CI execution time:

image

@pavoljuhas pavoljuhas added this pull request to the merge queue Nov 7, 2025
Merged via the queue into quantumlib:main with commit 08a15c8 Nov 7, 2025
35 checks passed
@pavoljuhas pavoljuhas deleted the optimize-psmwrm-test branch November 7, 2025 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants