Miscellaneous

int32_t danceq::internal::SparseMatrix::info(const bool show_data = false) const

Prints info.

Prints data like memory usage.

Parameters:

show_data – Shows data if true

Returns:

error_code

int32_t danceq::internal::SparseMatrix::print(const bool print_endl = true, const bool print_info = true) const

Prints the dense matrix.

If print_endl is true it adds a line break after each row. If print_info is false it only prints the matrix without further text.

Parameters:
  • print_endl – Boolean to control output

  • print_info – Boolean to control output

Returns:

error_code

int32_t danceq::internal::SparseMatrix::set_to_identity(const uint64_t new_dim = static_cast<uint64_t>(-1))

Sets the matrix to the identity.

.. math::

M_{i,i} = 1 \, ,\,\forall i

M_{i,j} = 0 \, ,\,\text{ for } i \neq j
The default value of -1 corresponds to the current dimension.

Parameters:

new_dim – New dimension (Default: -1)

Returns:

error_code

int32_t danceq::internal::SparseMatrix::set_diag_to_zero(void)

Sets the diagonal to zero.

.. math::

M_{i,i} = 0 \, ,\,\forall i

Returns:

error_code