Skip to content
This repository was archived by the owner on Aug 19, 2023. It is now read-only.
This repository was archived by the owner on Aug 19, 2023. It is now read-only.

classical_function decorator raises import error missing tweedledum #1253

@idnm

Description

@idnm

Informations

  • Qiskit version: 0.25.3
  • Python version: 3.8.8
  • Operating system: Linux

What is the current behavior?

@classical_function decorator raises error MissingOptionalLibraryError: "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

import numpy as np
# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, transpile, Aer, IBMQ
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *

# Loading your IBM Q account(s)
provider = IBMQ.load_account()

from qiskit.circuit import classical_function,  Int1

@classical_function
def grover_oracle(a: Int1, b: Int1, c: Int1, d: Int1) -> Int1:
    return (not a and b and not c and d)

quantum_circuit = grover_oracle.synth()
quantum_circuit.draw()

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions