Adds BaseExperiment.load and BaseExperiment.save methods and a helper function load_all() that loads both experiment and experiment data, with the option to run analysis:
from qiskit_experiments.framework import load_all
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService(channel="ibm_quantum")
exp, exp_data = load_all("9e242995-d793-4940-920f-f3970d7f777b", provider=service, run_analysis=True)
This PR incorporates changes from @ItamarGoldman's in #1423. To enable saving and loading, this PR saves experiment and analysis config as experiment_config and analysis_config in experiment data artifacts. Because analysis_options shouldn't be added as a new artifact every time analysis is rerun, this also adds overwrite_name option to add_artifacts() and renames the current overwrite option to overwrite_id. have been incorporated.
To-do
[ ] add tests
[ ] add seeds used in final circuit generation
[ ] update rerun analysis and cloud database service documentation with usage examples
Notes
load_all() is inefficient because BaseExperiment.load() and ExperimentData.load() make separate and identical calls to the experiment service. Ideally this would be combined in a separate interface class in a future refactoring.
Summary
Adds
BaseExperiment.load
andBaseExperiment.save
methods and a helper functionload_all()
that loads both experiment and experiment data, with the option to run analysis:This PR incorporates changes from @ItamarGoldman's in #1423. To enable saving and loading, this PR saves experiment and analysis config as
experiment_config
andanalysis_config
in experiment data artifacts. Becauseanalysis_options
shouldn't be added as a new artifact every time analysis is rerun, this also addsoverwrite_name
option toadd_artifacts()
and renames the currentoverwrite
option tooverwrite_id
. have been incorporated.To-do
Notes
load_all()
is inefficient becauseBaseExperiment.load()
andExperimentData.load()
make separate and identical calls to the experiment service. Ideally this would be combined in a separate interface class in a future refactoring.