Closed idnm closed 3 years ago
I think the problem lies in qiskit-terra/qiskit/circuit/classicalfunction/utils.py where we have this
try:
from tweedledum.ir import Qubit # pylint: disable=no-name-in-module
from tweedledum.passes import parity_decomp # pylint: disable=no-name-in-module
HAS_TWEEDLEDUM = True
except Exception: # pylint: disable=broad-except
HAS_TWEEDLEDUM = False
I'm guessing it's some other sort of error happening during the import so we should change the Exception
to ImportError
.
Haven't had a chance to test this yet though.
This solution only hides the issue not resolves it. I've reproduced the issue locally and it was solved by installing the missing library 'pip install tweedledum'. I think is better to add this library to dependencies.
Informations
What is the current behavior?
@classical_function
decorator raises errorMissingOptionalLibraryError: "The 'tweedledum' library is required to use 'classical function compiler'. You can install it with 'pip install tweedledum'."
Steps to reproduce the problem
In IBM quantum lab
The first block is the standard import, the second block is copied from docs
What is the expected behavior?
No import error and and output as in the docs.
Suggested solutions
Comments
I get the same error on my system where
tweedledum
is installed. I thought my installation might be messed up but the same problem shows up in the cloud.