Hi!
I am experiencing problems running VQE programs from PennyLane on actual quantum computers.
I am using the code from PennyLane’s tutorial:
from pennylane_qiskit import upload_vqe_runner, vqe_runner
IBMQ.enable_account(token)
program_id = upload_vqe_runner(hub="ibm-q", group="open", project="main")
def vqe_circuit(params):
qml.RX(params[0], wires=0)
qml.RY(params[1], wires=0)
coeffs = [1, 1]
obs = [qml.PauliX(0), qml.PauliZ(0)]
hamiltonian = qml.Hamiltonian(coeffs, obs)
job = vqe_runner(
program_id=program_id,
backend="ibmq_qasm_simulator",
hamiltonian=hamiltonian,
ansatz=vqe_circuit,
x0=[3.97507603, 3.00854038],
shots=shots,
optimizer="SPSA",
optimizer_config={"maxiter": 40},
kwargs={"hub": "ibm-q", "group": "open", "project": "main"},
)
This works perfectly. However, when I substitute “ibmq_qasm_simulator” with, for instance, “ibm_oslo”, I obtain the following error:
HTTPError: 403 Client Error: Forbidden for url: https://runtime-us-east.quantum-computing.ibm.com/jobs
The above exception was the direct cause of the following exception:
RequestsApiError Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/qiskit/providers/ibmq/api/session.py in request(self, method, url, bare, **kwargs)
298 self._modify_chained_exception_messages(ex)
299
--> 300 raise RequestsApiError(message, status_code) from ex
301
302 return response
RequestsApiError: '403 Client Error: Forbidden for url: https://runtime-us-east.quantum-computing.ibm.com/jobs. {"errors":[{"code":"forbidden","message":"user not authorized to run program vqe-runtime-M6ZRlLEo86","more_info":"https://cloud.ibm.com/apidocs/quantum-computing#error-handling"}],"trace":"cfa0d7qb2ktmne14rdq0"}'
Any help with this would be greatly appreciated!
Thanks!