I am running a very simple script just to learn how to use IBMQ, but my job will hang indefinitely and I am forced to terminate it.
from qiskit import * from qiskit.compiler import transpile, assemble from qiskit import IBMQ from qiskit import QuantumCircuit, execute, BasicAer import logging logging.basicConfig(filename='log',level=logging.DEBUG) IBMQ.load_account() provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main') #SELECT A BACKEND backend = provider.get_backend('ibmq_qasm_simulator') #ALGO qr = QuantumRegister(3) cr = ClassicalRegister(3) circuit = QuantumCircuit(qr, cr) circuit.x(qr) circuit.x(qr) circuit.ccx(qr, qr, qr) circuit.cx(qr, qr) circuit.measure(qr, cr) print('About to run job') job = execute(circuit, backend) print('Job Finished') result = job.result() counts = result.get_counts(circuit) print(counts)
In an attempt to debug, I am using "logging.basicConfig" which stops at:
"websocket._connect:DEBUG:2020-09-16 11:26:57,813: Starting new websocket connection: wss://wss.quantum-computing.ibm.com/jobs/5f6258f09234fe0012dbd748/status/v/1"
When I go to my IBMQ home page it says that the job has run successfully. It is only at the line
result = job.result() that it fails.
So it seems that the websocket is hanging forever. I'd appreciate any help I can get to fix this issue.