diff --git a/qiskit_experiments/framework/experiment_data.py b/qiskit_experiments/framework/experiment_data.py index 808002fb87..ff0234cb79 100644 --- a/qiskit_experiments/framework/experiment_data.py +++ b/qiskit_experiments/framework/experiment_data.py @@ -750,12 +750,29 @@ def add_data( else: experiment_seperator[inner_datum[0]["metadata"]["experiment_type"]] = ExperimentData() experiment_seperator[inner_datum[0]["metadata"]["experiment_type"]].add_data(inner_datum[0]) +<<<<<<< HEAD <<<<<<< HEAD else: self._result_data.append(datum) ======= self._result_data.append(datum) +======= + + elif "composite_metadata" in datum: + composite_flag = True + marginalized_data = self._marginalized_component_data([datum]) + for inner_datum in marginalized_data: + #print(inner_datum) + if "experiment_type" in inner_datum[0]["metadata"]: + if inner_datum[0]["metadata"]["experiment_type"] in experiment_seperator: + experiment_seperator[inner_datum[0]["metadata"]["experiment_type"]].add_data(inner_datum[0]) + else: + experiment_seperator[inner_datum[0]["metadata"]["experiment_type"]] = ExperimentData() + experiment_seperator[inner_datum[0]["metadata"]["experiment_type"]].add_data(inner_datum[0]) + + self._result_data.append(datum) +>>>>>>> 9eb2dba0 (Updated add_data tests passed #1268) >>>>>>> e7f46c3a (Updated add_data tests passed #1268) elif isinstance(datum, Result): @@ -768,8 +785,6 @@ def add_data( if composite_flag: tmp_exp_data._set_child_data(list(experiment_seperator.values())) self._set_child_data([tmp_exp_data]) - - return tmp_exp_data def __add_data( self, @@ -834,6 +849,7 @@ def _add_data( # self._marginalized_component_data() # Directly add non-job data + marginalized_data = self._marginalized_component_data(data) with self._result_data.lock: