IBMQBackend¶
-
class
IBMQBackend
(configuration, provider, credentials, api_client)[source]¶ Bases:
qiskit.providers.backend.BackendV1
Backend class interfacing with an IBM Quantum Experience device.
You can run experiments on a backend using the
run()
method. Therun()
method takes one or moreQuantumCircuit
orSchedule
and 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.backend.ibmq_vigo qx = random_circuit(n_qubits=5, depth=4) transpiled = transpile(qx, backend=backend) job = backend.run(transpiled) retrieved_job = backend.retrieve_job(job.job_id())
Note
Unlike
qiskit.execute()
, therun()
method does not transpile the circuits/schedules for you, so be sure to do so before submitting them.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_client (
AccountClient
) – IBM Quantum Experience client used to communicate with the server.
Methods
Return the unfinished jobs submitted to this backend.
Return the backend configuration.
Return the pulse defaults for the backend.
Return the job limit for the backend.
Return the jobs submitted to this backend, subject to optional filtering.
Return the backend name.
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.
Return backend reservations.
Return a single job submitted to this backend.
Run on the backend.
Set the options fields for the backend
Return the backend status.
Attributes
-
id_warning_issued
= False¶
-
options
¶ Return the options for the backend
The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the
run()
method.
-
qobj_warning_issued
= False¶
-
version
= 1¶