Template Function Pennylane::Util::write_CSR_vectors

Function Documentation

template<class ComplexT, class IndexT>
void Pennylane::Util::write_CSR_vectors(std::vector<IndexT> &row_map, std::vector<IndexT> &entries, std::vector<ComplexT> &values, IndexT numRows)

Fills the empty vectors with the CSR (Compressed Sparse Row) sparse matrix representation for a tri-diagonal + periodic boundary conditions Hamiltonian.

Template Parameters
  • PrecisionT – data float point precision.

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

Parameters
  • row_map – the j element encodes the total number of non-zeros above row j.

  • entries – column indices.

  • values – matrix non-zero elements.

  • numRows – matrix number of rows.