Template Function Pennylane::Util::apply_Sparse_Matrix

Function Documentation

template<class fp_precision, class index_type>
std::vector<std::complex<fp_precision>> Pennylane::Util::apply_Sparse_Matrix(const std::complex<fp_precision> *vector_ptr, const index_type vector_size, const index_type *row_map_ptr, const index_type row_map_size, const index_type *entries_ptr, const std::complex<fp_precision> *values_ptr, const index_type numNNZ)

Apply a sparse matrix to a vector with Kokkos.

Template Parameters
  • fp_precision – data float point precision.

  • index_type – integer type used as indices of the sparse matrix.

Parameters
  • vector_ptr – pointer to the vector.

  • vector_size – size of the vector.

  • row_map_ptr – Pointer to the row_map array. Elements of this array return the number of non-zero terms in all rows before it.

  • row_map_size – number of elements in the row_map.

  • entries_ptr – pointer to the column indices of the non-zero elements.

  • values_ptr – non-zero elements.

  • numNNZ – number of non-zero elements.

Returns

std::vector<std::complex<fp_precision>> result of the matrix vector multiplication.