I am attempting to run the following on a remote backend through QISkit:
try: import math from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister from qiskit import execute, IBMQ, Aer from qiskit.backends.ibmq import least_busy q = QuantumRegister(1, 'q') c1 = ClassicalRegister(1, 'c1') c2 = ClassicalRegister(1, 'c2') qc1 = QuantumCircuit(q, c1) qc2 = QuantumCircuit(q, c2) qc1.ry(math.pi*0.25, q[0]) qc2.ry(math.pi*0.25, q[0]) qc1.measure(q, c1) qc2.measure(q, c2) backend_sim = Aer.get_backend('qasm_simulator') job_sim1 = execute(qc1, backend_sim) result_sim1 = job_sim1.result() job_sim2 = execute(qc2, backend_sim) result_sim2 = job_sim2.result() print("simulation one: ", result_sim1) print(result_sim1.get_counts(qc1)) print("simulation two: ", result_sim2) print(result_sim2.get_counts(qc2)) ibmq_backends = IBMQ.backends() print("Remote backends: ", ibmq_backends) try: least_busy_device = least_busy(IBMQ.backends(simulator=False)) print("Running on current least busy device: ", least_busy_device) job_exp = execute(qc, least_busy_device, shots=1024, max_credits=10) result_exp = job_exp.result() print("experiment: ", result_exp) print(result_exp.get_counts(qc)) except: print("all devices are unavailable.") except QiskitError as ex: print('an error occurred. Error = {}'.format(ex))
After the local qasm simulator runs, I receive:
Remote backends: [] All devices are currently unavailable
However, if I run the "hello_quantum.py" example given through IBMQ, I am able to access multiple backends and use the ibm_16_melbourne computer. Interestingly, there seems to be an error in this program specifically.
Any ideas on what could be going wrong here?