Add experiment_metadata to analysis#944
Add experiment_metadata to analysis#944nkanazawa1989 wants to merge 1 commit intoqiskit-community:mainfrom
Conversation
|
The T2Ramsey and CrossResonanceHamiltonian examples help explain the motivation for this PR. The goal is to communicate more information from the experiment run to the analysis class, in particular to CurveAnalysis subclasses. For a generic BaseAnalysis subclass, the ExperimentData metadata is already accessible in This PR captures the metadata from the ExperimentData into a property of the analysis class so all methods of the class can access it. The main concern that I want to flag for @chriseclectic is that I think there is a design goal for BaseAnalysis not to be stateful, so it can be created once and then run on ExperimentData instances without side effects. That is kind of still the case here since each Some alternatives to storing the metadata in BaseAnalysis would be to store it in |
Summary
Base experiment supports an overridable method to provide experiment metadata, which is often useful to communicate with analysis classes. This PR adds
experiment_datamethod toBaseAnalysisso that every subclass can easily access to this metadata.Details and comments
Follow up; In principle, analysis class doesn't need to take full
ExperimentDataobject because this object also has unnecessary mechanism for remote database access and job control. Thus, it's sufficient for analysis to takeExperimentData.data()andExperimentData.metadata. New mechanism allowsBaseAnalysis._run_analysisto run analysis with experiment metadata, without taking full experiment data object.Two experiments and analysis have been updated to showcase how new property can be used.