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 DB

  • url (Optional[str]) – the url for the result DB API

  • local (Optional[bool]) – Whether to use a local DB client which does not connect to the result DB

  • local_save (Optional[bool]) – If using a local client, whether to enable save to disk or not.

Attributes

IBMExperimentService.local

The local property determines whether data is stored locally and not on the remote server

IBMExperimentService.preferences

Return saved experiment preferences.

Methods

IBMExperimentService.analysis_result(result_id)

Retrieve a previously stored analysis result.

IBMExperimentService.analysis_result_list_to_dataframe(...)

Converts a list of analysis results to a pandas dataframe

IBMExperimentService.analysis_results([...])

Retrieve all analysis results, with optional filtering.

IBMExperimentService.backends()

Return a list of backends that can be used for experiments.

IBMExperimentService.bulk_update_analysis_result(data)

Bulk updates existing analysis results.

IBMExperimentService.create_analysis_result(data)

Create a new analysis result in the database.

IBMExperimentService.create_analysis_results(data)

Create multiple analysis results in the database using asynchronous calls.

IBMExperimentService.create_experiment(data)

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

IBMExperimentService.create_or_update_analysis_result(data)

Creates or updates an analysis result

IBMExperimentService.create_or_update_experiment(data)

Creates a new experiment, or updates an existing one

IBMExperimentService.create_or_update_figure(...)

Creates a figure if it doesn't exists, otherwise updates it :type experiment_id: str :param experiment_id: Experiment ID.

IBMExperimentService.dataframe_to_analysis_result_list(df)

Converts an analysis result dataframe to a list

IBMExperimentService.delete_account([name])

Delete a saved account from disk.

IBMExperimentService.delete_analysis_result(...)

Delete an analysis result.

IBMExperimentService.delete_experiment(...)

Delete an experiment.

IBMExperimentService.delete_figure(...)

Delete an experiment plot.

IBMExperimentService.device_components([...])

Return the device components.

IBMExperimentService.experiment(experiment_id)

Retrieve a previously stored experiment.

IBMExperimentService.experiment_has_file(...)

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 file

IBMExperimentService.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

IBMExperimentService.get_access_token([...])

Authenticates to the server with the API token, receiving access token for the current session

IBMExperimentService.get_db_url()

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

IBMExperimentService.update_analysis_result(data)

Update an existing analysis result.

IBMExperimentService.update_experiment(data)

Update an existing experiment.

IBMExperimentService.update_figure(...)

Update an existing figure.