Qiskit / qiskit-aer

Aer is a high performance simulator for quantum circuits that includes noise models
https://qiskit.github.io/qiskit-aer/
Apache License 2.0
497 stars 361 forks source link

concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending. #924

Closed amarjahin closed 4 years ago

amarjahin commented 4 years ago

Informations

What is the current behavior?

I'm trying to reproduce this tutorial. My problem happen when executing results = vqe.run(quantum_instance) in cell [9] in the tutorial. This line give the following error:

Traceback (most recent call last): File "/home/ammar/Documents/qcode/quantum_computing_course/li_h.py", line 97, in results = vqe.run(quantum_instance) File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/quantum_algorithm.py", line 70, in run return self._run() File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py", line 396, in _run vqresult = self.find_minimum(initial_point=self.initial_point, File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/vq_algorithm.py", line 202, in find_minimum opt_params, opt_val, num_optimizer_evals = optimizer.optimize(nparms, File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/aqua/components/optimizers/cobyla.py", line 73, in optimize res = minimize(objective_function, initial_point, tol=self._tol, File "/home/ammar/.local/lib/python3.8/site-packages/scipy/optimize/_minimize.py", line 615, in minimize return _minimize_cobyla(fun, x0, args, constraints, *options) File "/home/ammar/.local/lib/python3.8/site-packages/scipy/optimize/cobyla.py", line 250, in _minimize_cobyla xopt, info = _cobyla.minimize(calcfc, m=m, x=np.copy(x0), rhobeg=rhobeg, File "/home/ammar/.local/lib/python3.8/site-packages/scipy/optimize/cobyla.py", line 242, in calcfc f = fun(x, args) File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py", line 476, in _energy_evaluation self._expect_op = self.construct_expectation(self._var_form_params) File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py", line 333, in construct_expectation wave_function = self.var_form.construct_circuit(parameter) File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/chemistry/components/variational_forms/uccsd.py", line 417, in construct_circuit results = parallel_map(UCCSD._construct_circuit_for_one_excited_operator, File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/tools/parallel.py", line 137, in parallel_map raise error File "/home/ammar/.local/lib/python3.8/site-packages/qiskit/tools/parallel.py", line 127, in parallel_map results = list(future) File "/usr/lib/python3.8/concurrent/futures/process.py", line 484, in _chain_from_iterable_of_lists for element in iterable: File "/usr/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator yield fs.pop().result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 432, in result return self.get_result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in get_result raise self._exception concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

I saw another issue here with the same problem. However that case seemed to be RAM related. I don't think my issue is RAM related since I'm only dealing this 4 qubits.

Steps to reproduce the problem

Try reproducing the result of cell [9] in this tutorial.

What is the expected behavior?

The program should run without termination.

Suggested solutions

amarjahin commented 4 years ago

Somehow sage was causing problems. Disabling sage resolved the issue. If you ran into the same issue you can disable sage by adding import os os.environ['MPMATH_NOSAGE'] = 'true' in the beginning of your code.

sourav-mazumder commented 3 years ago

@amarjahin

I tried following at the begining of the notebook. But no luck.

import os os.environ['MPMATH_NOSAGE'] = 'true'

I am using Python 3.7. Qiskit Aer version: 0.7.6.

Regards, Sourav