cuquantum.bindings.cudensitymat.create_matrix_operator_dense_local_batch¶
- cuquantum.bindings.cudensitymat.create_matrix_operator_dense_local_batch(intptr_t handle, int32_t num_space_modes, space_mode_extents, int64_t batch_size, int data_type, intptr_t matrix_data, matrix_callback, matrix_gradient_callback) intptr_t [source]¶
Creates a batch of full matrix operators acting on all quantum state modes (aka space modes) from an array of dense matrices stored (replicated) locally on each process. This is a batched version of the
cudensitymatCreateMatrixOperatorDenseLocal
API function.- Parameters
handle (intptr_t) – Library handle.
num_space_modes (int32_t) – Number of the (state) space modes acted on. It must coincide with the total number of space modes in the Hilbert space.
space_mode_extents (object) –
Extents of the (state) space modes acted on. It can be:
an
int
as the pointer address to the array, ora Python sequence of
int64_t
.
batch_size (int64_t) – Batch size (>= 1).
data_type (int) – Matrix operator data type.
matrix_data (intptr_t) – GPU-accessible pointer to the matrix operator elements storage where all matrix operator instances within the batch are stored contiguously in memory.
matrix_callback (object) – Optional user-defined batched tensor callback function which can be called later to fill in the matrix elements in the provided batched storage, or NULL. Note that the provided batched tensor callback function is expected to fill in all matrix instances within the batch in one call.
matrix_gradient_callback (object) – Optional user-defined batched tensor gradient callback function which can be called later to compute the Vector-Jacobian Product (VJP) for the batched matrix operator, to produce gradients with respect to the batched user-defined real parameters, or NULL.
- Returns
Batched full matrix operator (a batch of full matrix operators).
- Return type
intptr_t