-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Job Splitting Information Methods for Better User Experience (#1281)
This PR aims to solve issue #1247 als the changes are similar to PR #1248 ### Summary: This pull request aims to enhance the user experience by providing clearer insights into the structure of experiments and their distribution across backends. It introduces two new public methods, `_max_circuits()` and `job_info(backend)`, while also refactoring the existing `_run_jobs()` method for better code organization and reuse of logic. ### Proposed Changes: Add` _max_circuits()` Method: This method will calculate the maximum number of circuits that can be included in a single job. This method will encapsulate the logic previously present in the ` _run_jobs()` method to determine the maximum circuits per job. Add `job_info(backend)` Method: This method will utilize the `_max_circuits()` method to provide users with information about the experiment's configuration for a specific backend. If the backend argument is provided, the method will return the number of circuits and the number of jobs the experiment will be split into on that backend. If the backend argument is not provided, the method will rely on the backend already specified in the experiment. Refactor `_run_jobs()` Method: The existing `_run_jobs()` method will be refactored to make use of the `_max_circuits()` method. This change will enhance code readability and maintainability by segregating the logic related to job distribution from the actual job execution logic. ### Testing Added `test_max_circuits` for testing of `_max_circuits()` and `test_job_info` for testing of `job_info(backend)` these tests ensure that methods functioning correctly --------- Co-authored-by: Helena Zhang <[email protected]>
- Loading branch information
1 parent
7e920d3
commit bb2b5e1
Showing
3 changed files
with
143 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
releasenotes/notes/circuit-count-method-a095bd74aaa1d2fb.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
features: | ||
- | | ||
A new method :meth:`BaseExperiment.job_info` has been added that will | ||
output the number of jobs the experiment is expected to be split into | ||
based on the provided backend. | ||
- | | ||
Refer to issue | ||
`#1247 https://github.com/Qiskit-Extensions/qiskit-experiments/issues/1247` | ||
for more details. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters