Template Function Pennylane::Util::apply_Sparse_Matrix¶
Defined in File Kokkos_Sparse.hpp
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.
api/function_Kokkos__Sparse_8hpp_1acb57b6d52d80b8a25888ea393560b865
Download Python script
Download Notebook
View on GitHub