Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions qiskit_experiments/framework/composite/composite_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
from typing import List, Dict
import numpy as np
from qiskit.result import marginal_counts
from qiskit_experiments.framework import BaseAnalysis, ExperimentData, AnalysisResultData
from qiskit_experiments.database_service.device_component import Qubit
from qiskit_experiments.framework import BaseAnalysis, ExperimentData


class CompositeAnalysis(BaseAnalysis):
Expand Down Expand Up @@ -69,7 +68,6 @@ def _run_analysis(self, experiment_data: ExperimentData):
# child data is handled by the `replace_results` kwarg of the
# parent container it is safe to always clear and replace the
# results of child containers in this step
analysis_results = []
for i, (sub_data, sub_exp) in enumerate(zip(marginalized_data, component_exps)):
sub_exp_data = experiment_data.child_data(component_ids[i])

Expand All @@ -85,23 +83,12 @@ def _run_analysis(self, experiment_data: ExperimentData):
# we always run with replace result on component analysis
sub_exp.analysis.run(sub_exp_data, replace_results=True)

# Record the component experiment id and type as an analysis result
# for evidence analysis has started and to display in the service DB
result = AnalysisResultData(
name=sub_exp_data.experiment_type,
value=sub_exp_data.experiment_id,
device_components=[
Qubit(qubit) for qubit in sub_exp_data.metadata.get("physical_qubits", [])
],
)
analysis_results.append(result)

# Wait for all component analysis to finish before returning
# the parent experiment analysis results
for comp_id in component_ids:
experiment_data.child_data(comp_id).block_for_results()

return analysis_results, []
return [], []

def _initialize_components(self, experiment, experiment_data):
"""Initialize child data components and return list of child experiment IDs"""
Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/kids-in-analysis-df7b4dcbeb5b3125.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
upgrade:
- |
The :class:`.ParallelExperiment` and :class:`.BatchExperiment` composite experiments
have been changed to no longer return analysis results containing information about
sub-experiments. Instead, use the :meth:`~.ParallelExperiment.child_data` method to
retrieve sub-experiments of a given composite experiment.
1 change: 0 additions & 1 deletion test/test_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ def test_composite_tags(self):

expdata.tags = ["a", "c", "a"]
data1.tags = ["b"]
print(expdata.tags)
self.assertEqual(sorted(expdata.tags), ["a", "c"])
self.assertEqual(sorted(data1.tags), ["b"])
self.assertEqual(sorted(data2.tags), [])
Expand Down