Cannot Connect to IBMQ systems

Hello,

I can’t access IBMQ systems using Pennylane. I get a 403 error with an additional code “2409 Forbidden” when I look at the administrative panel in the IBMQ network, with no log that it attempted access. I can run a job on the IBMQ network with a simple circuit, like this:

import pennylane as qml
from qiskit import IBMQ

provider = IBMQ.load_account()
IBMQ.get_provider(hub='myhub', group='mygroup', project='my_proj')
dev = qml.device('qiskit.ibmq', wires=2, backend='ibmq_santiago', provider=provider)
dev.capabilities()['backend']

@qml.qnode(dev)
def circuit(x, y, z):
    qml.RZ(z, wires=[0])
    qml.RY(y, wires=[0])
    qml.RX(x, wires=[0])
    qml.CNOT(wires=[0, 1])
    return qml.expval(qml.PauliZ(wires=1))

circuit(0.2, 0.1, 0.3)

However, when I try to run the Quantum Transfer Learning notebook, it never runs.
Quantum transfer learning — PennyLane

I saw the other post about not being able to run quantum circuits on IBMQ with this notebook, and tried implementing some of the code from: quantum-transfer-learning/quantum_processors at master · XanaduAI/quantum-transfer-learning (github.com)

However, I still can’t get it to run on quantum hardware when just running the “run_on_QPU.py” script. I can run it without using a IBMQ quantum backend fine, but why won’t it run on a an IBM Q system with the following device parameters?

provider = IBMQ.load_account()
IBMQ.get_provider(hub='myhub', group='mygroup', project='my_proj')
dev = qml.device('qiskit.ibmq', wires=4, backend='ibmq_santiago', provider=provider)

Error message I get on the IBMQ network:

Request failed with status code 403
2409 - Forbidden.

Hi @dancbeaulieu, welcome!

The error message that you are getting, Request failed with status code 403, 2409 - Forbidden generally indicates an issue on the IBM side, meaning that your job has properties that forbid it from running on the device. It may be good to check with them as well.

Since you have a simple example that can run correctly, it seems that the issue may be related to a component in the more complicated pipeline constituting the the transfer learning demo. My advice after consulting with experts in the team that have experience with IBMQ is to try the following:

  • It may be good to remove the “dummy” arguments myhub, etc and use your won
  • If possible, try to start from simple components of the transfer learning model and test if they work. For example, you could try to run the H_layer, RY_layer, and entangling_layer.
  • Keep adding complexity to the model until you can identify where the error happens

Let me know if that works!

Juan Miguel

Thank you Juan, I will try running a more simple circuit and see what happens.

1 Like

Great! Let us know if you still experience any issues

I submitted a ticket to IBMQ support. Even with a more simple circuit its not actually running on quantum hardware, even though I am obtaining results. Will see what they say.

Thanks @dancbeaulieu, let us know how it goes :slight_smile:

I was able to use the following code to get my code running on IBM Quantum hardware.

IBMQ.load_account()

provider = IBMQ.get_provider(hub=‘HUBNAME’, group=‘GROUPNAME’, project=‘PROJECTNAME’)

dev = qml.device(“qiskit.ibmq”, wires=n_qubits, backend=“ibmq_athens”, provider=provider)

An important point to note is that the code was running before I made the code change above, but it wasn’t actually running on quantum hardware. It was not connecting, then running on a simulator apparently without me knowing it! Couldn’t tell until I checked the IBM backend. Confirmed with IBM Administrative Backend that I was able to run the job on quantum hardware.

Hi @dancbeaulieu,

Great to hear! Thank you for sharing and let us know if new questions should arise. :slightly_smiling_face: