qiskit-community / qiskit-nature

Qiskit Nature is an open-source, quantum computing, framework for solving quantum mechanical natural science problems.
https://qiskit-community.github.io/qiskit-nature/
Apache License 2.0
291 stars 197 forks source link

parallel_map import from qiskit needs amending #1314

Closed woodsp-ibm closed 5 months ago

woodsp-ibm commented 5 months ago

Qiskit has removed the tools folder and parallel_map was moved to utils

From qiskit release notes

The ``qiskit.tools`` module has been removed. This module was deprecated in Qiskit 0.46.0.
All the contents from this module have been removed except for the ``qiskit.tools.parallel_map``
function which now can be used from :func:`qiskit.utils.parallel_map` instead.

Perhaps what to do is to try the import from qiskit.tools, while suppressing any warning that would result if 0.46 is used, and in a catch import from utils. This will maintain compatibility and also work with 1.0, for which the present code that uses that will fail. Maybe put the try catch in some common place and import parallel map from there to save replicating it around - from what I can see parallel map is used in qeom and 2 ops builders (with just comments in other places to use it)