operator_term_append_matrix_product#

cuquantum.bindings.cudensitymat.operator_term_append_matrix_product(
intptr_t handle,
intptr_t operator_term,
int32_t num_matrix_operators,
matrix_operators,
matrix_conjugation,
action_duality,
double complex coefficient,
coefficient_callback,
coefficient_gradient_callback,
)[source]#

Appends a product of full matrix operators, each acting on all quantum state modes, to the operator term.

Parameters:
  • handle (intptr_t) – Library handle.

  • operator_term (intptr_t) – Operator term.

  • num_matrix_operators (int32_t) – Number of full matrix operators in the matrix operator product.

  • matrix_operators (object) –

    Full matrix operators constituting the matrix operator product. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of ints (as pointer addresses).

  • matrix_conjugation (object) –

    Hermitean conjugation status of each matrix in the matrix operator product (zero means normal, positive integer means conjugate-transposed). For real matrices, hermitean conjugation reduces to a mere matrix transpose since there is no complex conjugation involved. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • action_duality (object) –

    Duality status of each matrix operator action, that is, whether it acts on all ket modes of the quantum state (value zero) or on all bra modes of the quantum state (positive integer value). It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • coefficient (complex) – Constant (static) complex scalar coefficient associated with the matrix operator product.

  • coefficient_callback (object) – Optional user-defined complex scalar callback function which can be called later to update the scalar coefficient associated with the matrix operator product, or NULL. The total coefficient associated with the matrix operator product is a product of the constant coefficient and the result of the scalar callback function, if defined.

  • coefficient_gradient_callback (object) – Optional user-defined scalar gradient callback function which can be called later to compute the gradients of the complex scalar coefficient with respect to the user-defined real parameters, or NULL.