Device

class braket.devices.device.Device(name, status)[source]

Bases: ABC

An abstraction over quantum devices that includes quantum computers and simulators.

Parameters:
  • name (str)

  • status (str)

Initializes a Device.

Parameters:
  • name (str) – Name of quantum device

  • status (str) – Status of quantum device

abstractmethod run(task_specification, shots, inputs, *args, **kwargs)[source]

Run a quantum task specification on this quantum device. A quantum task can be a circuit or an annealing problem.

Parameters:
  • task_specification (TaskSpecification) – Specification of a quantum task to run on device.

  • shots (int | None) – The number of times to run the quantum task on the device. Default is None.

  • inputs (dict[str, float] | None) – Inputs to be passed along with the IR. If IR is an OpenQASM Program, the inputs will be updated with this value. Not all devices and IR formats support inputs. Default: {}.

  • *args (Any) – Arbitrary arguments.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type:

QuantumTask

Returns:

QuantumTask – The QuantumTask tracking task execution on this device

abstractmethod run_batch(task_specifications, shots, max_parallel, inputs, *args, **kwargs)[source]

Executes a batch of quantum tasks in parallel

Parameters:
  • task_specifications (TaskSpecification | list[TaskSpecification]) – Single instance or list of circuits or problems to run on device.

  • shots (int | None) – The number of times to run the circuit or annealing problem.

  • max_parallel (int | None) – The maximum number of quantum tasks to run in parallel. Batch creation will fail if this value is greater than the maximum allowed concurrent quantum tasks on the device.

  • inputs (dict[str, float] | list[dict[str, float]] | None) – Inputs to be passed along with the IR. If the IR supports inputs, the inputs will be updated with this value.

  • *args (Any) – Arbitrary arguments.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type:

QuantumTaskBatch

Returns:

QuantumTaskBatch – A batch containing all of the qauntum tasks run

property name: str

Return the name of this Device.

Returns:

str – The name of this Device

property status: str

Return the status of this Device.

Returns:

str – The status of this Device