Template Function Pennylane::LightningGPU::MPI::splitCSRMatrix

Function Documentation

template<class Precision, class index_type>
auto Pennylane::LightningGPU::MPI::splitCSRMatrix(MPIManager &mpi_manager, const std::size_t &num_rows, const index_type *csrOffsets_ptr, const index_type *columns_ptr, const std::complex<Precision> *values_ptr) -> std::vector<std::vector<CSRMatrix<Precision, index_type>>>

Convert a global CSR (Compressed Sparse Row) format matrix into local blocks. This operation should be conducted on the rank 0.

Template Parameters
  • Precision – Floating-point precision type.

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

Parameters
  • mpi_managerMPIManager object.

  • num_rows – Number of rows of the CSR matrix.

  • csrOffsets_ptr – Pointer to the array of row offsets of the sparse matrix. Array of size csrOffsets_size.

  • columns_ptr – Pointer to the array of column indices of the sparse matrix. Array of size numNNZ

  • values_ptr – Pointer to the array of the non-zero elements

Returns

auto A vector of vector of CSRMatrix.