cuquantum.custatevec.apply_matrix_batched

cuquantum.custatevec.apply_matrix_batched(intptr_t handle, intptr_t batched_sv, int sv_data_type, uint32_t n_index_bits, uint32_t n_svs, int64_t sv_stride, int map_type, matrix_indices, intptr_t matrices, int matrix_data_type, int layout, int32_t adjoint, uint32_t n_matrices, targets, uint32_t n_targets, controls, control_bit_values, uint32_t n_controls, int compute_type, intptr_t extra_workspace, size_t extra_workspace_size_in_bytes)[source]

This function applies one gate matrix to each one of a set of batched state vectors.

Parameters
  • handle (intptr_t) – the handle to the cuStateVec library.

  • batched_sv (intptr_t) – batched state vector allocated in one continuous memory chunk on device.

  • sv_data_type (int) – data type of the state vectors.

  • n_index_bits (uint32_t) – the number of index bits of the state vectors.

  • n_svs (uint32_t) – the number of state vectors.

  • sv_stride (int64_t) – distance of two consecutive state vectors.

  • map_type (MatrixMapType) – enumerator specifying the way to assign matrices.

  • matrix_indices (object) –

    pointer to a host or device array of matrix indices. It can be:

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

    • a Python sequence of int32_t.

  • matrices (intptr_t) – pointer to allocated matrices in one contiguous memory chunk on host or device.

  • matrix_data_type (int) – data type of matrices.

  • layout (MatrixLayout) – enumerator specifying the memory layout of matrix.

  • adjoint (int32_t) – apply adjoint of matrix.

  • n_matrices (uint32_t) – the number of matrices.

  • targets (object) –

    pointer to a host array of target bits. It can be:

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

    • a Python sequence of int32_t.

  • n_targets (uint32_t) – the number of target bits.

  • controls (object) –

    pointer to a host array of control bits. It can be:

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

    • a Python sequence of int32_t.

  • control_bit_values (object) –

    pointer to a host array of control bit values. It can be:

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

    • a Python sequence of int32_t.

  • n_controls (uint32_t) – the number of control bits.

  • compute_type (ComputeType) – compute_type of matrix multiplication.

  • extra_workspace (intptr_t) – extra workspace.

  • extra_workspace_size_in_bytes (size_t) – extra workspace size.