braket.devices.device module

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

Bases: ABC

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

Initializes a Device.

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

  • status (str) – Status of quantum device

abstract run(task_specification: Circuit | Problem, shots: int | None, inputs: dict[str, float] | None, *args, **kwargs) QuantumTask[source]

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

Parameters:
  • task_specification (Union[Circuit, Problem]) – Specification of a quantum task to run on device.

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

  • inputs (Optional[dict[str, float]]) – 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.

Returns:

QuantumTask – The QuantumTask tracking task execution on this device

abstract run_batch(task_specifications: Circuit | Problem | list[Circuit | Problem], shots: int | None, max_parallel: int | None, inputs: dict[str, float] | list[dict[str, float]] | None, *args: Any, **kwargs: Any) QuantumTaskBatch[source]

Executes a batch of quantum tasks in parallel

Parameters:
  • task_specifications (Union[Union[Circuit, Problem], list[Union[Circuit, Problem]]]) – Single instance or list of circuits or problems to run on device.

  • shots (Optional[int]) – The number of times to run the circuit or annealing problem.

  • max_parallel (Optional[int]) – 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 (Optional[Union[dict[str, float], list[dict[str, float]]]]) – 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.

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