From 707e6a5af4c946d805d180f0870761f0587fc44c Mon Sep 17 00:00:00 2001 From: knzwnao Date: Thu, 9 Dec 2021 15:15:54 +0900 Subject: [PATCH] add sleep --- .../framework/composite/composite_analysis.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qiskit_experiments/framework/composite/composite_analysis.py b/qiskit_experiments/framework/composite/composite_analysis.py index ddf6671cb8..45ac83a3ad 100644 --- a/qiskit_experiments/framework/composite/composite_analysis.py +++ b/qiskit_experiments/framework/composite/composite_analysis.py @@ -14,6 +14,7 @@ """ from typing import List, Dict +from time import sleep import numpy as np from qiskit.result import marginal_counts from qiskit_experiments.framework import BaseAnalysis, ExperimentData, AnalysisResultData @@ -104,6 +105,12 @@ def _wait_for_components(experiment_data, component_ids): experiment_data.add_analysis_callback(_wait_for_components, component_ids=component_ids) + # TODO implement proper locking mechanism. + # Because blocking mechanism is sometime terminated before above callback is added to + # the experiment_data callback queue list, we need to extend execution time of this routine + # to ensure this will complete after the callback is actually queued. + sleep(1) + return analysis_results, [] def _initialize_components(self, experiment, experiment_data):