create_matrix_product_operator#
-
cuquantum.
bindings. cudensitymat. create_matrix_product_operator( - intptr_t handle,
- int32_t num_space_modes,
- space_mode_extents,
- int boundary_condition,
- bond_extents,
- int data_type,
- tensor_data,
- tensor_callbacks,
- tensor_gradient_callbacks,
Creates a matrix product operator (MPO) acting on a subset of quantum state modes (aka space modes).
- Parameters:
handle (intptr_t) – Library handle.
num_space_modes (int32_t) – Number of the (state) space modes acted on.
space_mode_extents (object) –
Extents of the (state) space modes acted on. It can be:
an
intas the pointer address to the array, ora Python sequence of
int64_t.
boundary_condition (BoundaryCondition) – Boundary condition.
bond_extents (object) –
Extents of the bond modes. For open boundary condition, the length of the array must be equal to the number of space modes minus one, where
bond_extents[i]is the bond dimension between siteiand sitei+1. For periodic boundary condition, the length of the array must be equal to the number of space modes. It can be:an
intas the pointer address to the array, ora Python sequence of
int64_t.
data_type (int) – Matrix product operator data type.
tensor_data (object) –
GPU-accessible pointers to the elements of each site tensor constituting the matrix product operator (
tensor_data[i]points to sitei). It can be:tensor_callbacks (object) – Optional user-defined tensor callback functions (for each MPO tensor) which can be called later to fill in the matrix product operator elements in the provided storage, or NULL.
tensor_gradient_callbacks (object) – Optional user-defined tensor gradient callback functions (for each MPO tensor) which can be called later to compute the Vector-Jacobian Product (VJP) for the matrix product operator, to produce gradients with respect to the user-defined real parameters, or NULL.
- Returns:
Matrix product operator.
- Return type:
intptr_t