QXel.simulation.density_matrix_simulation module

class QXel.simulation.density_matrix_simulation.DensityMatrixSimulation(plan)

Bases: BaseSimulation

Execute density-matrix circuits from a SimulationPlan.

__init__(plan)

Allocate the matrix buffers required by a density execution plan.

Parameters:

plan (SimulationPlan) – Execution plan describing qubit layout, compute backend, and MPI topology.

static convert_result_type(result, qubit_count)

Convert a backend density result into the public return shape.

Parameters:
  • result (Result) – Result buffer that already contains either the full density matrix or a reduced density matrix.

  • qubit_count (int) – Total logical qubit count of the simulation.

Returns:

Full density matrix or reduced density matrix in canonical Braket qubit order.

Return type:

np.ndarray

run(circuits, results, shots)

Execute transpiled circuits and return materialized results.

run_impl(circuits, results)

Run the density-matrix kernel loop.

Parameters:
  • circuits (list[QuantumCircuit]) – Transpiled circuits or subcircuits ready for execution.

  • results (list[Result]) – Result buffers allocated by the caller.

Returns:

Materialized result payloads.

Return type:

list