Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rerun analysis how-to #1339

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/howtos/rerun_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ job IDs:

expdata = ExperimentData(experiment = experiment)
expdata.add_jobs([provider.retrieve_job(job_id) for job_id in job_ids])
experiment.analysis.run(expdata)
experiment.analysis.run(expdata, replace_results=True)

# Block execution of subsequent code until analysis is complete
expdata.block_for_results()

``expdata`` will be the new experiment data object containing results of the rerun analysis.
``expdata`` will be the new experiment data object containing results of the rerun analysis. Note that if
``replace_results`` isn't set, running the analysis will return a new :class:`.ExperimentData` object
instead of overwriting the existing one.

If you have the job data in the form of a :class:`~qiskit.result.Result` object, you can
invoke the :meth:`.add_data` method instead of :meth:`.add_jobs`:
Expand Down Expand Up @@ -115,7 +117,7 @@ first component experiment.

data = ExperimentData(experiment=pexp)
data.add_jobs([provider.retrieve_job(job_id) for job_id in job_ids])
pexp.analysis.run(data)
pexp.analysis.run(data, replace_results=True)

See Also
--------
Expand Down