IBMQBackend¶
- class IBMQBackend(configuration, provider, credentials, api)[source]¶
Backend class interfacing with an IBM Quantum Experience device.
You can run experiments on a backend using the
run()
method after assembling them into theQobj
format. Therun()
method returns anIBMQJob
instance that represents the submitted job. Each job has a unique job ID, which can later be used to retrieve the job. An example of this flow:from qiskit import IBMQ, assemble, transpile from qiskit.circuit.random import random_circuit provider = IBMQ.load_account() backend = provider.backends.ibmq_vigo qx = random_circuit(n_qubits=5, depth=4) qobj = assemble(transpile(qx, backend=backend), backend=backend) job = backend.run(qobj) retrieved_job = backend.retrieve_job(job.job_id())
Note
You should not instantiate the
IBMQBackend
class directly. Instead, use the methods provided by anAccountProvider
instance to retrieve and handle backends.Other methods return information about the backend. For example, the
status()
method returns aBackendStatus
instance. The instance contains theoperational
andpending_jobs
attributes, which state whether the backend is operational and also the number of jobs in the server queue for the backend, respectively:status = backend.status() is_operational = status.operational jobs_in_queue = status.pending_jobs
It is also possible to see the number of remaining jobs you are able to submit to the backend with the
job_limit()
method, which returns aBackendJobLimit
instance:job_limit = backend.job_limit()
IBMQBackend constructor.
- Parameters
configuration (
Union
[QasmBackendConfiguration
,PulseBackendConfiguration
]) – Backend configuration.provider (
AccountProvider
) – IBM Quantum Experience account providercredentials (
Credentials
) – IBM Quantum Experience credentials.api (
AccountClient
) – IBM Quantum Experience client used to communicate with the server.
Methods
IBMQBackend.active_jobs
([limit])Return the unfinished jobs submitted to this backend.
Return the backend configuration.
IBMQBackend.defaults
([refresh])Return the pulse defaults for the backend.
Return the job limit for the backend.
IBMQBackend.jobs
([limit, skip, status, …])Return the jobs submitted to this backend, subject to optional filtering.
Return the backend name.
IBMQBackend.properties
([refresh, datetime])Return the backend properties, subject to optional filtering.
Return the backend Provider.
Return the number of remaining jobs that could be submitted to the backend.
IBMQBackend.retrieve_job
(job_id)Return a single job submitted to this backend.
IBMQBackend.run
(qobj[, job_name, …])Run a Qobj asynchronously.
Return the backend status.
Return the backend version.