Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParallelExperiment gives ExperimentEntryNotFound and RuntimeError #1347

Open
kevinsung opened this issue Dec 18, 2023 · 0 comments
Open

ParallelExperiment gives ExperimentEntryNotFound and RuntimeError #1347

kevinsung opened this issue Dec 18, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@kevinsung
Copy link
Contributor

kevinsung commented Dec 18, 2023

Informations

  • Qiskit Experiments version: 0.5.4
  • Python version: 3.10.12
  • Operating system: Arch Linux

What is the current behavior?

Steps to reproduce the problem

from qiskit import QuantumCircuit, QuantumRegister
from qiskit.circuit.library import CXGate
from qiskit_aer import AerSimulator
from qiskit_experiments.framework import ParallelExperiment
from qiskit_experiments.library import MitigatedProcessTomography

register = QuantumRegister(2, name="q")
target_circuit = QuantumCircuit(register)
a, b = register
target_circuit.append(CXGate(), [a, b])

backend = AerSimulator()
physical_qubits = list(range(4))

experiments = [
    MitigatedProcessTomography(target_circuit, backend=backend, physical_qubits=(0, 1)),
    MitigatedProcessTomography(target_circuit, backend=backend, physical_qubits=(2, 3)),
]

parallel_experiment = ParallelExperiment(experiments, backend=backend)
parallel_data = parallel_experiment.run(backend)
data = parallel_data.child_data()[0]
data.block_for_results()
val = data.analysis_results("state").value
Traceback (most recent call last):
  File "/home/kjs/projects/scratch/repro.py", line 24, in <module>
    val = data.analysis_results("state").value
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/experiment_data.py", line 1303, in analysis_results
    raise ExperimentEntryNotFound(_make_not_found_message(index))
qiskit_experiments.database_service.exceptions.ExperimentEntryNotFound: 'Analysis result state not found.'
Analysis callback failed [Experiment ID: bbcdc800-ce44-4c05-949f-785b2225707d][Analysis Callback ID: af181d1b23094000a8ea265ef32bde87]:
Traceback (most recent call last):
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/experiment_data.py", line 897, in _run_analysis_callback
    callback(self, **kwargs)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/base_analysis.py", line 169, in run_analysis
    results, figures = analysis._run_analysis(expdata)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/composite/composite_analysis.py", line 122, in _run_analysis
    self._analyses[i].run(sub_expdata, replace_results=True)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/composite/composite_analysis.py", line 111, in run
    return super().run(experiment_data, replace_results=True, **options)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/base_analysis.py", line 183, in run
    experiment_data.add_analysis_callback(run_analysis)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/experiment_data.py", line 841, in add_analysis_callback
    wait_future = self._monitor_executor.submit(
  File "/home/kjs/.pyenv/versions/3.10.12/lib/python3.10/concurrent/futures/thread.py", line 169, in submit
    raise RuntimeError('cannot schedule new futures after '
RuntimeError: cannot schedule new futures after interpreter shutdown

Analysis callback failed [Experiment ID: a9fb7576-708a-4a0c-9019-009eada453f6][Analysis Callback ID: a7f64b6bfb474ece9963042cf90fb1e6]:
Traceback (most recent call last):
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/experiment_data.py", line 897, in _run_analysis_callback
    callback(self, **kwargs)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/base_analysis.py", line 169, in run_analysis
    results, figures = analysis._run_analysis(expdata)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/library/tomography/mit_tomography_analysis.py", line 99, in _run_analysis
    roerror_analysis.run(roerror_data, replace_results=True).block_for_results()
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/base_analysis.py", line 183, in run
    experiment_data.add_analysis_callback(run_analysis)
  File "/home/kjs/.local/share/virtualenvs/scratch-h4kO_6N_/lib/python3.10/site-packages/qiskit_experiments/framework/experiment_data.py", line 853, in add_analysis_callback
    self._analysis_futures[cid] = self._analysis_executor.submit(
  File "/home/kjs/.pyenv/versions/3.10.12/lib/python3.10/concurrent/futures/thread.py", line 169, in submit
    raise RuntimeError('cannot schedule new futures after '
RuntimeError: cannot schedule new futures after interpreter shutdown

What is the expected behavior?

Should work.

Suggested solutions

@kevinsung kevinsung added the bug Something isn't working label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant