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

Document how to load an experiment without the cloud #919

Closed
wshanks opened this issue Sep 21, 2022 · 2 comments
Closed

Document how to load an experiment without the cloud #919

wshanks opened this issue Sep 21, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@wshanks
Copy link
Collaborator

wshanks commented Sep 21, 2022

It would be nice to document how users who don't have access to the cloud database can load old experiments.

I think this can be done roughly as:

from qiskit_experiments.framework import ExperimentData


# Somehow the user must retain and run the same code that created the experiment originally
experiment = Experiment(**opts)

# Somehow the user must retain and provide the list of job IDs
data = ExperimentData(job_ids=job_ids)
experiment.analysis.run(data)
data.block_for_results()

I think that should retrieve the raw data from the IBM Quantum service and run the same analysis on it again. I am not sure if there are some caveats that need to be added on cases where some information could be missing here.

Perhaps documentation for this could fill in the "somehow"s above -- maybe BaseExperiment.config() and BaseExperiment.from_config() could be used to save and restore the experiment from a file instead of re-running the original experiment code. Also, the qiskit-ibm-experiment package provides a local option for IBMExperimentService (see here). This local option is provided primarily for testing (it is not very scalable), but perhaps it would (or could) provide a better option for a user to save and reload a handful of experiments rather than storing job IDs by hand.

This topic came up in this Slack discussion.

@wshanks wshanks added the documentation Improvements or additions to documentation label Sep 21, 2022
@eliarbel
Copy link
Contributor

I think we should 'promote' the option to save experiments locally to be easy to use, and handle all the required nitty-gritty, such as job-ids handling as Will mentioned. Currently the option is hidden and requires code tweaking to use. Enabling some like this:

exp_date = some_exp.run(...)

... 

exp_data.save(local_file=<local db>) 

could be very convenient

@coruscating
Copy link
Collaborator

Guide added in #983. We should continue the save interface discussion in a new thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants