braket.simulator_v2.base_simulator_v2 module
- class braket.simulator_v2.base_simulator_v2.BaseLocalSimulatorV2(device: str)[source]
Bases:
BaseLocalSimulator- run_openqasm(openqasm_ir: OpenQASMProgram, shots: int = 0, batch_size: int = 1) GateModelTaskResult[source]
Executes the circuit specified by the supplied
openqasm_iron the simulator.- Parameters:
openqasm_ir (Program) – ir representation of a braket circuit specifying the instructions to execute.
shots (int) – The number of times to run the circuit.
- Returns:
GateModelTaskResult – object that represents the result
- Raises:
ValueError – If result types are not specified in the IR or sample is specified as a result type when shots=0. Or, if StateVector and Amplitude result types are requested when shots>0.
- run_multiple(programs: Sequence[OpenQASMProgram], max_parallel: int = -1, shots: int = 0, inputs: dict | Sequence[dict] | None = None) list[GateModelTaskResult][source]
Run the tasks specified by the given IR programs. Extra arguments will contain any additional information necessary to run the tasks, such as the extra parameters for AHS simulations. :param programs: The IR representations of the programs :type programs: Sequence[OQ3Program] :param max_parallel: The maximum number of programs to run in parallel.
Default is the number of logical CPUs.
- Returns:
list[GateModelTaskResult] – A list of result objects, with the ith object being the result of the ith program.