Template Function Pennylane::LightningQubit::Util::apply_Sparse_Matrix¶
Defined in File SparseLinAlg.hpp
Function Documentation¶
-
template<class fp_precision, class IndexT>
std::vector<std::complex<fp_precision>> Pennylane::LightningQubit::Util::apply_Sparse_Matrix(const std::complex<fp_precision> *vector_ptr, const IndexT vector_size, const IndexT *row_map_ptr, const IndexT row_map_size, const IndexT *column_idx_ptr, const std::complex<fp_precision> *values_ptr, const IndexT numNNZ)¶ Apply a sparse matrix to a vector.
- Template Parameters
fp_precision – data float point precision.
IndexT – 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.
column_idx_ptr – pointer to the column indices of the non-zero elements.
values_ptr – non-zero elements.
numNNZ – number of non-zero elements.
- Returns
result result of the matrix vector multiplication.
api/function_SparseLinAlg_8hpp_1af486247b0083ce438cf2a10b4910ff67
Download Python script
Download Notebook
View on GitHub