braket.default_simulator.density_matrix_simulator module
- class braket.default_simulator.density_matrix_simulator.DensityMatrixSimulator[source]
Bases:
BaseLocalSimulator- DEVICE_ID = 'braket_dm'
- run_openqasm(openqasm_ir, shots=0, *, batch_size=1)[source]
Executes the circuit specified by the supplied
circuit_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.
batch_size (int) – The size of the circuit partitions to contract, if applying multiple gates at a time is desired; see
StateVectorSimulation. Must be a positive integer. Defaults to 1, which means gates are applied one at a time without any optimized contraction.
- 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.
- initialize_simulation(**kwargs) DensityMatrixSimulation[source]
Initialize density matrix simulation.
- Parameters:
**kwargs – qubit_count, shots, batch_size
- Returns:
DensityMatrixSimulation – Initialized simulation.
- property properties: GateModelSimulatorDeviceCapabilities
Properties of the device.
- Type:
DeviceCapabilities