Skip to content

Group circuits and execute in a single job - #660

Open
felipelewyee wants to merge 3 commits into
PennyLaneAI:masterfrom
felipelewyee:group_circuits_and_execute_with_PUBS
Open

Group circuits and execute in a single job#660
felipelewyee wants to merge 3 commits into
PennyLaneAI:masterfrom
felipelewyee:group_circuits_and_execute_with_PUBS

Conversation

@felipelewyee

@felipelewyee felipelewyee commented Sep 14, 2025

Copy link
Copy Markdown
Contributor

This PR group circuits into a list of estimator_circuits and a list of sampler_circuits, and executes them in a single job for each primitive.

This avoids having to queue circuits individually between each execution.

What problem does this solve?
The current behavior is to sequentially execute each circuit as an individual job; hence, having to wait in the queue between each circuit execution. With this PR, all circuits are queued on the same job, avoiding the intermediate waiting.

Summary of changes
The code affected is in functions execute, _execute_sampler, and _execute_estimator in qiskit_device.py

Test functions test_execute_estimator_mocked and test_execute_pipeline_with_all_execute_types_mocked in tests/test_base_device.py have been changed to reflect that _execute_estimator and _execute_sampler now return a tuple with many results.

… of sampler_circuits, and execute them using a single PUB for each primitive.

This avoids having to queue again between each circuit execution.

The code affected is in functions *execute*, *_execute_sampler* and *_execute_estimator* in qiskit_device.py

Test functions *test_execute_estimator_mocked* and *test_execute_pipeline_with_all_execute_types_mocked* in tests/test_base_device.py have been changed to reflect that _execute_estimator and _execute_sampler now returns a tuple of tuples with results.
@codecov

codecov Bot commented Sep 14, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (12dacf9) to head (aed5556).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #660   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          863       893   +30     
=========================================
+ Hits           863       893   +30     

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

@felipelewyee felipelewyee changed the title Group circuits in a list and execute with a single PUB Group circuits in a list and execute with PUB in a single job Sep 14, 2025
@felipelewyee felipelewyee changed the title Group circuits in a list and execute with PUB in a single job Group circuits and execute in a single job Sep 14, 2025
@Alex-Preciado
Alex-Preciado requested a review from lillian542 April 7, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant