braket.simulator.braket_simulator module

class braket.simulator.braket_simulator.BraketSimulator[source]

Bases: abc.ABC

An abstract simulator that locally runs a quantum task.

The task can be either a circuit-based program or an annealing problem, specified by the given IR.

For users creating their own simulator: to register a simulator so the Braket SDK recognizes its name, the name and class must 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>"
>>>     ]
>>> }
run(ir: Union[braket.ir.jaqcd.program_v1.Program, braket.ir.annealing.problem_v1.Problem], *args, **kwargs) → Union[braket.task_result.gate_model_task_result_v1.GateModelTaskResult, braket.task_result.annealing_task_result_v1.AnnealingTaskResult][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[Program, Problem]) – The IR representation of the program
Returns:Union[GateModelTaskResult, AnnealingTaskResult] – An object representing the results of the simulation.
properties

Properties of the device.

Type:DeviceCapabilities