Note
This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.
ExperimentData¶
- class ExperimentData(experiment=None, backend=None, service=None, parent_id=None, job_ids=None, child_data=None, verbose=True, db_data=None, **kwargs)[source]¶
Experiment data container class.
This class handles the following:
Storing the data related to an experiment: raw data, metadata, analysis results, and figures
Managing jobs and adding data from jobs automatically
Saving and loading data from the database service
The field
db_data
is a dataclass (ExperimentDataclass
) containing all the data that can be stored in the database and loaded from it, and as such is subject to strict conventions.Other data fields can be added and used freely, but they won’t be saved to the database.
Initialize experiment data.
- Parameters:
experiment (
Optional
[BaseExperiment]) – Experiment object that generated the data.backend (
Optional
[Backend
]) – Backend the experiment runs on. This overrides the backend in the experiment object.service (
Optional
[IBMExperimentService
]) – The service that stores the experiment results to the databaseparent_id (
Optional
[str
]) – ID of the parent experiment data in the setting of a composite experimentjob_ids (
Optional
[List
[str
]]) – IDs of jobs submitted for the experiment.child_data (
Optional
[List
[ExperimentData
]]) – List of child experiment data.verbose (
Optional
[bool
]) – Whether to print messages.db_data (
Optional
[ExperimentData
]) – A prepared ExperimentDataclass of the experiment info. This overrides other db parameters.
Attributes
Return current auto-save option.
Return backend.
Return the backend's name
Returns the completion times of the jobs.
Return the creation datetime of this experiment data.
Return the end datetime of this experiment data.
Return the experiment for this data.
Return experiment ID
Return experiment type
Return names of the figures associated with this experiment.
Return the group of this experiment data.
Return the hub of this experiment data.
Return experiment job IDs.
Return experiment metadata.
Return experiment notes.
Return parent experiment ID
Return the project of this experiment data.
Return the database service.
Return the share level for this experiment
Return the class name and version.
Return the start datetime of this experiment data.
Return tags assigned to this experiment data.
Return the update datetime of this experiment data.
Methods
Add analysis callback for running after experiment data jobs are finished.
ExperimentData.add_analysis_results
(results)Save the analysis result.
ExperimentData.add_child_data
(experiment_data)Add child experiment data to the current experiment data
ExperimentData.add_data
(data)Add experiment data.
ExperimentData.add_figures
(figures[, ...])Add the experiment figure.
ExperimentData.add_jobs
(jobs[, timeout])Add experiment data.
ExperimentData.add_tags_recursive
(tags2add)Add tags to this experiment itself and its descendants
Return any errors encountered during analysis callbacks.
ExperimentData.analysis_results
([index, ...])Return analysis results associated with this experiment.
Return the data analysis post-processing status.
ExperimentData.block_for_results
([timeout])Block until all pending jobs and analysis callbacks finish.
Attempt to cancel any running jobs and queued analysis callbacks.
Cancel any queued analysis callbacks.
ExperimentData.cancel_jobs
([ids])Cancel any running jobs.
ExperimentData.child_data
([index])Return child experiment data.
ExperimentData.copy
([copy_results])Make a copy of the experiment data with a new experiment ID.
ExperimentData.data
([index])Return the experiment data at the specified index.
ExperimentData.delete_analysis_result
(result_key)Delete the analysis result.
ExperimentData.delete_figure
(figure_key)Add the experiment figure.
Return errors encountered during job and analysis execution.
ExperimentData.figure
(figure_key[, file_name])Retrieve the specified experiment figure.
Initializes the server from the backend data
Return any errors encountered in job execution.
Return the experiment job execution status.
Return a list of jobs for the experiment
ExperimentData.load
(experiment_id, service)Load a saved experiment data from a database service.
ExperimentData.remove_tags_recursive
(tags2remove)Remove tags from this experiment itself and its descendants
ExperimentData.save
([suppress_errors])Save the experiment data to a database service.
Save this experiments metadata to a database service.
Return the experiment status.