
List IBM Quantum backends available to the current account
Source:R/quantum_ibmq.R
quantum_ibmq_backends.RdRequires quantum_ibmq_available() to return TRUE. Pulls the
current list via qiskit_ibm_runtime.QiskitRuntimeService.
Examples
if (FALSE) { # \dontrun{
# Step 2 of the discovery path: preflight, list, then pick.
stopifnot(quantum_ibmq_available())
qpus <- quantum_ibmq_backends()
qpus
# TRAP: an unavailable service is reported as character(0), not
# as an error, so a length-0 result is indistinguishable from
# "this account has no operational processor". The preflight
# above is the only thing that tells the two apart -- without it
# a missing IBMQ_TOKEN looks exactly like an empty fleet.
length(quantum_ibmq_backends())
# The difference between the two calls is the calibration queue:
# `operational_only = FALSE` also lists processors paused for
# maintenance. Read it before blaming a stalled job on your
# circuit.
setdiff(quantum_ibmq_backends(operational_only = FALSE), qpus)
# `simulator = FALSE` is the default, i.e. real processors only.
# Flip it to see whatever simulated backends the account still
# exposes; IBM has been retiring them, so an empty answer here is
# a normal outcome rather than a misconfiguration.
quantum_ibmq_backends(simulator = TRUE)
# Feed a name straight into the dispatch layer. Pinning it is
# what makes two runs comparable -- see quantum_ibmq_least_busy()
# for why leaving `ibmq_backend = NULL` does not.
quantum_vqe_fit(quantum_hamiltonian_h2(), backend = "ibmq",
ibmq_backend = qpus[1L],
optimizer = "SPSA", max_iter = 50L)
} # }