Skip to content

Commit

Permalink
Updated _add_data qiskit-community#1268
Browse files Browse the repository at this point in the history
  • Loading branch information
Musa-Sina-Ertugrul committed Apr 22, 2024
1 parent e0b1f93 commit df4eb66
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions qiskit_experiments/framework/experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,19 @@ def _add_data(
for sub_expdata, sub_data in zip(component_expdata, marginalized_data):
# Clear any previously stored data and add marginalized data
sub_expdata._result_data.clear()
for datum in sub_data:
self.__reacher_composite_metadata(datum)
sub_expdata.add_data(sub_data)

def __reacher_composite_metadata(self,data : Dict)->List:
if data.get("composite_metadata"):
for datum in data.get("composite_metadata"):
self.__reacher_composite_metadata(datum)
self._add_data(datum.child_data(),datum["composite_metadata"])
else:
data["composite_metadata"] = [ExperimentData()]
return

def _marginalized_component_data(self, composite_data: List[Dict]) -> List[List[Dict]]:
"""Return marginalized data for component experiments.
Expand Down

0 comments on commit df4eb66

Please sign in to comment.