qbraid.devices.ibm package

Submodules

qbraid.devices.ibm.provider module

Module for top-level interfacing with the IBMQ API

ibm_to_qbraid_id(name)[source]

Converts IBM device name to qBraid device ID

Return type

str

ibm_provider(token=None)[source]

Get IBMQ AccountProvider

Return type

IBMProvider

ibm_least_busy_qpu()[source]

Return the qBraid ID of the least busy IBMQ QPU.

Return type

str

qbraid.devices.ibm.device module

Module defining IBMBackendWrapper Class

class IBMBackendWrapper(**kwargs)[source]

Bases: DeviceLikeWrapper

Wrapper class for IBM Qiskit Backend objects.

Create a DeviceLikeWrapper object.

Keyword Arguments
  • qbraid_id (str) – The internal device ID (see get_devices())

  • name (str) – The name of the device

  • provider (str) – The company to which the device belongs

  • vendor (str) – The company who’s software is used to access the device

  • runPackage (str) – The software package used to access the device

  • objArg (str) – The vendor device id/arn to supply as arg to vendor device-like object

  • type (str) – The type of the device, “QPU” or “Simulator”

  • numberQubits (int) – The number of qubits in the device (if applicable)

property status

Return the status of this Device.

Returns

The status of this Device

Return type

str

pending_jobs()[source]

Return the number of jobs in the queue for the ibm backend

execute(run_input, *args, **kwargs)[source]

Runs circuit(s) on qiskit backend via execute().

Creates a QuantumInstance, invokes its execute method, applies a IBMResultWrapper, and returns the result.

Parameters
  • run_input – An individual or a list of circuit objects to run on the wrapped device.

  • kwargs – Any kwarg options to pass to the device for the run.

Returns

The result like object for the run.

Return type

qbraid.devices.ibm.IBMResultWrapper

run(run_input, *args, **kwargs)[source]

Runs circuit(s) on qiskit backend via execute()

Uses the execute() method to create a Job object, applies a IBMJobWrapper, and return the result.

Parameters

run_input – A circuit object to run on the wrapped device.

Keyword Arguments

shots (int) – The number of times to run the task on the device. Default is 1024.

Returns

The job like object for the run.

Return type

qbraid.devices.ibm.IBMJobWrapper

run_batch(run_input, **kwargs)[source]

Runs circuit(s) on qiskit backend via execute()

Uses the execute() method to create a Job object, applies a IBMJobWrapper, and return the result.

Parameters

run_input – A circuit object list to run on the wrapped device.

Keyword Arguments

shots (int) – The number of times to run the task on the device. Default is 1024.

Returns

The job like object for the run.

Return type

qbraid.devices.ibm.IBMJobWrapper

qbraid.devices.ibm.job module

Module defining IBMJobWrapper Class

class IBMJobWrapper(job_id, **kwargs)[source]

Bases: JobLikeWrapper

Wrapper class for IBM Qiskit Job objects.

Create a IBMJobWrapper object.

result()[source]

Return the results of the job.

cancel()[source]

Attempt to cancel the job.

qbraid.devices.ibm.result module

Module defining IBMResultWrapper Class

class IBMResultWrapper(vendor_rlo)[source]

Bases: ResultWrapper

Qiskit Result wrapper class.

measurements()[source]

Return measurements as list

raw_counts()[source]

Returns the histogram data of the run