# Qiskit HHL algorithm BrokenProcessPool error

I try to run HHL algorithm on qasm_simulator. I took the example from here. I try to solve 8x8 random matrix and adjust some parameters in create_eigs.

aqua_globals.random_seed = 0
matrix = random_hermitian(8)
vector = matrix.dot(np.array([1, 2, 3, 4, 5, 6,7,8]))

orig_size = len(vector)
matrix, vector, truncate_powerdim, truncate_hermitian = HHL.matrix_resize(matrix, vector)

# Initialize eigenvalue finding module
eigs = create_eigs(matrix, 3, 10, False)
num_q, num_a = eigs.get_register_sizes()

# Initialize initial state module
init_state = Custom(num_q, state_vector=vector)

# Initialize reciprocal rotation module
reci = LookupRotation(negative_evals=eigs._negative_evals, evo_time=eigs._evo_time)

algo = HHL(matrix, vector, truncate_powerdim, truncate_hermitian, eigs,
init_state, reci, num_q, num_a, orig_size)
result = algo.run(QuantumInstance(Aer.get_backend('qasm_simulator')))


Then, this error occur.

---------------------------------------------------------------------------
BrokenProcessPool                         Traceback (most recent call last)
<ipython-input-8-105a0b6b991d> in <module>
18 algo = HHL(matrix, vector, truncate_powerdim, truncate_hermitian, eigs,
19            init_state, reci, num_q, num_a, orig_size)
---> 20 result = algo.run(QuantumInstance(Aer.get_backend('qasm_simulator')))

~/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/quantum_algorithm.py in run(self, quantum_instance, **kwargs)
69                 self.quantum_instance = quantum_instance
70
---> 71         return self._run()
72
73     @abstractmethod

~/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in _run(self)
407         else:
408             self.construct_circuit(measurement=False)
--> 409             self._state_tomography()
410         # Adding a bit of general result information
411         self._ret["matrix"] = self._resize_matrix(self._matrix)

~/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in _state_tomography(self)
341
342         # Extracting the probability of successful run
--> 343         results = self._quantum_instance.execute(tomo_circuits)
344         probs = []
345         for circ in tomo_circuits:

268         # maybe compile
--> 270             circuits = self.transpile(circuits)
271
272         # assemble

~/.local/lib/python3.8/site-packages/qiskit/aqua/quantum_instance.py in transpile(self, circuits)
229                                   the length is one.
230         """
--> 231         transpiled_circuits = compiler.transpile(circuits, self._backend, **self._backend_config,
232                                                  **self._compile_config)
233         if not isinstance(transpiled_circuits, list):

~/.local/lib/python3.8/site-packages/qiskit/compiler/transpile.py in transpile(circuits, backend, basis_gates, coupling_map, backend_properties, initial_layout, layout_method, routing_method, translation_method, scheduling_method, instruction_durations, dt, seed_transpiler, optimization_level, pass_manager, callback, output_name)
241
242     # Transpile circuits in parallel
--> 243     circuits = parallel_map(_transpile_circuit, list(zip(circuits, transpile_args)))
244
245     if len(circuits) == 1:

133             # Otherwise just reset parallel flag and error
134             os.environ['QISKIT_IN_PARALLEL'] = 'FALSE'
--> 135             raise error
136
137         Publisher().publish("terra.parallel.finish")

124
--> 125             results = list(future)
126             Publisher().publish("terra.parallel.done", len(results))
127

/usr/lib/python3.8/concurrent/futures/process.py in _chain_from_iterable_of_lists(iterable)
482     careful not to keep references to yielded objects.
483     """
--> 484     for element in iterable:
485         element.reverse()
486         while element:

/usr/lib/python3.8/concurrent/futures/_base.py in result_iterator()
609                     # Careful not to keep a reference to the popped future
610                     if timeout is None:
--> 611                         yield fs.pop().result()
612                     else:
613                         yield fs.pop().result(end_time - time.monotonic())

/usr/lib/python3.8/concurrent/futures/_base.py in result(self, timeout)
430                 raise CancelledError()
431             elif self._state == FINISHED:
--> 432                 return self.__get_result()
433
434             self._condition.wait(timeout)

/usr/lib/python3.8/concurrent/futures/_base.py in __get_result(self)
386     def __get_result(self):
387         if self._exception:
--> 388             raise self._exception
389         else:
390             return self._result

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


Please tell me how to fix this error.

import os