quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.24k stars 1.01k forks source link

Create multiprocessing/multithreading helper functions #6604

Closed NoureldinYosri closed 4 months ago

NoureldinYosri commented 4 months ago

Some code in experiments uses multiprocessing.Pool or ThreadPoolExecutor + there are places that could benefit from using either to speed things up. The methods introduced in this PR standardize the way this is done and runs the batches with a progress bar which would improve UX since batching/threading/multiprocessing is used when running long running processes so getting a progress bar is a nice feature.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 98.63014% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 97.81%. Comparing base (cf86dda) to head (b82e95a). Report is 1 commits behind head on main.

Files Patch % Lines
cirq-core/cirq/work/multiprocessing.py 97.91% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6604 +/- ## ========================================== - Coverage 97.81% 97.81% -0.01% ========================================== Files 1061 1063 +2 Lines 91656 91732 +76 ========================================== + Hits 89657 89730 +73 - Misses 1999 2002 +3 ```

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

NoureldinYosri commented 4 months ago

closing in favor of using tqmd.contrib.concurrent