IBMExperimentService¶
- class IBMExperimentService(token=None, url=None, name=None, hgp=None, proxies=None, verify=True, local=False, local_save=True, **kwargs)[source]¶
Provides experiment related services.
This class is the main interface to invoke IBM Quantum experiment service, which allows you to create, delete, update, query, and retrieve experiments, experiment figures, and analysis results.
# Retrieve all experiments. experiments = experiment_provider.experiments() # Retrieve experiments with filtering. experiment_filtered = experiment_provider.experiments(backend_name='ibmq_athens') # Retrieve a specific experiment using its ID. experiment = experiment_provider.experiment(EXPERIMENT_ID) # Upload a new experiment. new_experiment_id = .experiment_provider.create_experiment( experiment_type="T1", backend_name="ibmq_athens", metadata={"qubits": 5} ) # Update an experiment. experiment_provider.update_experiment( experiment_id=EXPERIMENT_ID, share_level="Group" ) # Delete an experiment. experiment_provider.delete_experiment(EXPERIMENT_ID)
Similar syntax applies to analysis results and experiment figures.
IBMExperimentService constructor.
- Parameters:
token (
Optional
[str
]) – the API token to use when establishing connection with the result DBurl (
Optional
[str
]) – the url for the result DB APIlocal (
Optional
[bool
]) – Whether to use a local DB client which does not connect to the result DBlocal_save (
Optional
[bool
]) – If using a local client, whether to enable save to disk or not.
Attributes
The local property determines whether data is stored locally and not on the remote server
Return saved experiment preferences.
Methods
IBMExperimentService.analysis_result
(result_id)Retrieve a previously stored analysis result.
Converts a list of analysis results to a pandas dataframe
Retrieve all analysis results, with optional filtering.
Return a list of backends that can be used for experiments.
Bulk updates existing analysis results.
Create a new analysis result in the database.
Create multiple analysis results in the database using asynchronous calls.
Create a new experiment in the database.
IBMExperimentService.create_figure
(...[, ...])Store a new figure in the database.
IBMExperimentService.create_figures
(...[, ...])Create multiple figures in the database using asynchronous calls.
IBMExperimentService.create_or_update
(...[, ...])Creates or updates a database entry using the given functions
Creates or updates an analysis result
Creates a new experiment, or updates an existing one
Creates a figure if it doesn't exists, otherwise updates it :type experiment_id:
str
:param experiment_id: Experiment ID.Converts an analysis result dataframe to a list
Delete a saved account from disk.
Delete an analysis result.
Delete an experiment.
Delete an experiment plot.
Return the device components.
IBMExperimentService.experiment
(experiment_id)Retrieve a previously stored experiment.
Checks whether a specific expriment has a specific file :type experiment_id:
str
:param experiment_id: The experiment the data file belongs to :type file_name:str
:param file_name: The filename of the data fileIBMExperimentService.experiments
([limit, ...])Retrieve all experiments, with optional filtering.
IBMExperimentService.figure
(experiment_id, ...)Retrieve an existing figure.
IBMExperimentService.file_download
(...[, ...])Downloads a data file from the DB and returns its deserialization :type experiment_id:
str
:param experiment_id: The experiment the data file belongs to :type file_name:str
:param file_name: The filename of the data file :type json_decoder:Type
[JSONDecoder
] :param json_decoder: Custom decoder to use to decode the retrieved experiment.IBMExperimentService.file_upload
(...[, ...])Uploads a data file to the DB
IBMExperimentService.files
(experiment_id)Retrieve the file list for an experiment
Authenticates to the server with the API token, receiving access token for the current session
Receive the url for the database API from the server
IBMExperimentService.save_account
([token, ...])Save the account to disk for future use.
IBMExperimentService.set_option
(**kwargs)Sets the options given as keywords
Update an existing analysis result.
Update an existing experiment.
Update an existing figure.