braket.simulator.braket_simulator module

class braket.simulator.braket_simulator.BraketSimulator[source]

Bases: ABC

An abstract simulator that locally runs a quantum task.

The task can be either a quantum circuit defined in an OpenQASM or JAQCD program, or an analog Hamiltonian simulation (AHS) program.

For users creating their own simulator: to register a simulator so the Braket SDK recognizes its name, the name and class must be added as an entry point for “braket.simulators”. This is done by adding an entry to entry_points in the simulator package’s setup.py:

>>> entry_points = {
>>>     "braket.simulators": [
>>>         "backend_name = <backend_class>"
>>>     ]
>>> }
DEVICE_ID = None
abstract run(ir: Program | Program | Program, *args, **kwargs) GateModelTaskResult | AnalogHamiltonianSimulationTaskResult[source]

Run the task specified by the given IR.

Extra arguments will contain any additional information necessary to run the task, such as number of qubits.

Parameters:

ir (Union[OQ3Program, AHSProgram, JaqcdProgram]) – The IR representation of the program

Returns:

Union[GateModelTaskResult, AnalogHamiltonianSimulationTaskResult] – An object representing the results of the simulation.

abstract property properties: DeviceCapabilities

Properties of the device.

Type:

DeviceCapabilities