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.
AnalysisResult¶
- class AnalysisResult(name=None, value=None, device_components=None, experiment_id=None, result_id=None, chisq=None, quality='unknown', extra=None, verified=False, tags=None, service=None, source=None)[source]¶
Class representing an analysis result for an experiment.
Analysis results can also be stored using the experiments service.
The field
db_data
is a dataclass (ExperimentDataclass) containing all the data that can be stored with the service 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.
Note that the
result_data
field of the dataclass is by itself a dictionary capable of holding arbitrary values (in a dictionary indexed by a string).The data fields in the
db_data
dataclass are:experiment_id
:str
result_id
:str
result_type
:str
device_components
:List[str]
quality
:str
verified
:bool
tags
:List[str]
backend_name
:str
chisq
:float
result_data
:Dict[str]
Analysis data that does not fit into the other fields should be added to the
result_data
dict, e.g. curve parameters in experiments doing a curve fit.AnalysisResult constructor.
- Parameters:
name (
Optional
[str
]) – analysis result name.value (
Optional
[Any
]) – main analysis result value.device_components (
Optional
[List
[Union
[DeviceComponent
,str
]]]) – Target device components this analysis is for.experiment_id (
Optional
[str
]) – ID of the experiment.result_id (
Optional
[str
]) – Result ID. IfNone
, one is generated.chisq (
Optional
[float
]) – Reduced chi squared of the fit.quality (
Optional
[str
]) – Quality of the analysis. Refer to the experiment service provider for valid values.extra (
Optional
[Dict
[str
,Any
]]) – Dictionary of extra analysis result dataverified (
bool
) – Whether the result quality has been verified.tags (
Optional
[List
[str
]]) – Tags for this analysis result.service (
Optional
[IBMExperimentService
]) – Experiment service to be used to store result in database.source (
Optional
[Dict
[str
,str
]]) – Class and Qiskit version information when loading from an experiment service.
- Returns:
The AnalysisResult object.
Attributes
Return current auto-save option.
Return the reduced χ² of this analysis.
Return target device components for this analysis result.
Return the ID of the experiment associated with this analysis result.
Return extra analysis result data.
Return analysis result name.
Return the quality of this analysis.
Return analysis result ID.
Return the database service.
Return the class name and version.
Return tags associated with this result.
Return analysis result value.
Return the verified flag.
Methods
Return a copy of the result with a new result ID
The default source dictionary to generate
AnalysisResult.format_result_data
(value, ...)Formats the result data from the given arguments
AnalysisResult.load
(result_id, service)Load a saved analysis result from a database service.
AnalysisResult.save
([suppress_errors])Save this analysis result in the database.
AnalysisResult.set_data
(data)Sets the analysis data stored in the class