quantum-transfer-learning icon indicating copy to clipboard operation
quantum-transfer-learning copied to clipboard

I got error when I execute "run_on_QPU.py"

Open masaya611 opened this issue 2 years ago • 4 comments

Hello.

I try to execute "run_on_QPU.py" I got the error messages below.

Traceback (most recent call last): File "/home/watabe/quantum-transfer-learning/quantum_processors/run_on_QPU.py", line 62, in dev = qml.device("qiskit.ibmq", wires=n_qubits, backend="ibmqx4", ibmqx_token=token) File "/home/watabe/.tql/lib/python3.10/site-packages/pennylane/init.py", line 330, in device raise DeviceError("Device does not exist. Make sure the required plugin is installed.") pennylane._device.DeviceError: Device does not exist. Make sure the required plugin is installed.

I only change the token in this code. Are there what I need to do?

masaya611 avatar Oct 04 '22 08:10 masaya611

Hi @masaya611!

You will need the pennylane-qiskit plugin. You can install it by using python -m pip install pennylane-qiskit . You can learn more about the plugin in its documentation.

Please let us know if this solves your problem!

CatalinaAlbornoz avatar Oct 05 '22 23:10 CatalinaAlbornoz

After installing pennylane-qiskit, there is no ibmqx4 device.

dev = qml.device("qiskit.ibmq", wires=n_qubits, backend="ibmq_qasm_simulator", ibmqx_token=token, shots=1024)
print("Device capabilities: ", dev.capabilities()["backend"])

Device capabilities: ['ibmq_qasm_simulator', 'ibmq_lima', 'ibmq_belem', 'ibmq_quito', 'simulator_statevector', 'simulator_mps', 'simulator_extended_stabilizer', 'simulator_stabilizer', 'ibmq_manila', 'ibm_nairobi', 'ibm_oslo']

OnePl3 avatar Nov 22 '22 11:11 OnePl3

Can you guys give me a new one, using the QPU example? This version is too old, and the IBM piece of equipment seems to be gone. Thank you very much!

OnePl3 avatar Nov 22 '22 12:11 OnePl3

Hi @OnePl3 , yes, as you noticed IBM no longer has the ibmqx4 device. However you can use ibmq_lima if you prefer. You just need to change the run_on_QPU.py file which is in folder quantum_processors. You can change the "ibmqx4" in line 62 to "ibmq_lima". It is possible that other parts of the code are still outdated but at least this is an updated device that you can use.

CatalinaAlbornoz avatar Nov 25 '22 00:11 CatalinaAlbornoz