2

I'm new to quantum computing and am currently working on building a quantum multiplication calculator. I've installed all the necessary packages, but I'm still encountering an ImportError. Here are the details:

What I've Done So Far: Installed Qiskit: I installed Qiskit using pip: pip install qiskit The Problem: Despite these steps, when I try to import Qiskit in my script, I get an ImportError: import qiskit from qiskit import QuantumCircuit, Aer, execute The error message is: ImportError: No module named 'qiskit' (https://i.sstatic.net/53YyrakH.png)(https://i.sstatic.net/M645zL4p.png)

I have installed all the packages said in official site(https://docs.quantum.ibm.com/start/install)

1
  • 1
    The error message in your description is No module named 'qiskit'. The error message in your image is Cannot import name 'excute' from 'qiskit'. So which error do you need help with? Commented Jun 27, 2024 at 13:37

1 Answer 1

2

You are getting the error Cannot import name 'excute' from 'qiskit' because qiskit.execute function has been deprecated in qiskit>1.0.0. Instead of using execute you can now use transpile and run as explained in Qiskit 1.0's migration guide for execute:

Your current (deprecated) import

from qiskit import execute 

Should be replaced with

from qiskit import transpile 

And now instead of using execute like this:

job = execute(circuit, backend) 

You should use transpile and run as follows:

new_circuit = transpile(circuit, backend) job = backend.run(new_circuit) 

Assuming you have your backend initialized, e.g.,

backend = Aer.get_backend('qasm_simulator') 

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.