mptensor  v0.3.0
Parallel Library for Tensor Network Methods
mptensor::matrix_interface Namespace Reference

Nameclass for Matrix inteface. More...

Classes

class  Matrix
 Inteface of Matrix class. More...
 

Functions

template<typename C >
void replace_matrix_data (const Matrix< C > &M, const std::vector< int > &dest_rank, const std::vector< size_t > &local_position, Matrix< C > &M_new)
 
template<typename C >
void replace_matrix_data (const std::vector< C > &V, const std::vector< int > &dest_rank, const std::vector< size_t > &local_position, Matrix< C > &M_new)
 
template<typename C >
void sum_matrix_data (const Matrix< C > &M, const std::vector< int > &dest_rank, const std::vector< size_t > &local_position, Matrix< C > &M_new)
 
template<typename C >
matrix_trace (const Matrix< C > &a)
 
template<typename C >
void matrix_product (const Matrix< C > &a, const Matrix< C > &b, Matrix< C > &c)
 
template<typename C >
int matrix_svd (Matrix< C > &a, Matrix< C > &u, std::vector< double > &s, Matrix< C > &v)
 
template<typename C >
int matrix_svd (Matrix< C > &a, std::vector< double > &s)
 
template<typename C >
int matrix_qr (Matrix< C > &a, Matrix< C > &r)
 
template<typename C >
int matrix_eigh (Matrix< C > &a, std::vector< double > &s, Matrix< C > &u)
 
template<typename C >
int matrix_eigh (Matrix< C > &a, std::vector< double > &s)
 Eigenvalues of a hermite (symmetric) matrix. More...
 
template<typename C >
int matrix_eigh (Matrix< C > &a, Matrix< C > &b, std::vector< double > &s, Matrix< C > &u)
 
template<typename C >
int matrix_eig (Matrix< C > &a, std::vector< complex > &s, Matrix< complex > &u)
 
template<typename C >
int matrix_eig (Matrix< C > &a, std::vector< complex > &s)
 
template<typename C >
int matrix_solve (Matrix< C > &a, Matrix< C > &b)
 Solve linear equation \( AX=B\). More...
 
template<typename C >
double max (const Matrix< C > &a)
 Return the maximum element. More...
 
template<typename C >
double min (const Matrix< C > &a)
 Return the minimum element. More...
 
template<typename C >
double max_abs (const Matrix< C > &a)
 Return the maximum of the absolute value of elements. More...
 
template<typename C >
double min_abs (const Matrix< C > &a)
 Return the minimum of the absolute value of elements. More...
 

Detailed Description

Nameclass for Matrix inteface.

The list of member functions and non-member functions, which should be implemented in a Matrix class.

Function Documentation

◆ matrix_eig() [1/2]

template<typename C >
int mptensor::matrix_interface::matrix_eig ( Matrix< C > &  a,
std::vector< complex > &  s 
)

◆ matrix_eig() [2/2]

template<typename C >
int mptensor::matrix_interface::matrix_eig ( Matrix< C > &  a,
std::vector< complex > &  s,
Matrix< complex > &  u 
)

◆ matrix_eigh() [1/3]

template<typename C >
int mptensor::matrix_interface::matrix_eigh ( Matrix< C > &  a,
Matrix< C > &  b,
std::vector< double > &  s,
Matrix< C > &  u 
)

◆ matrix_eigh() [2/3]

template<typename C >
int matrix_eigh ( Matrix< C > &  a,
std::vector< double > &  s 
)

Eigenvalues of a hermite (symmetric) matrix.

Parameters
[in]aThe hermite or symmetric matrix. On exit, it may be destroyed.
[out]sThe eigenvalues in ascending order.
Returns
information from the library.

◆ matrix_eigh() [3/3]

template<typename C >
int mptensor::matrix_interface::matrix_eigh ( Matrix< C > &  a,
std::vector< double > &  s,
Matrix< C > &  u 
)

◆ matrix_product()

template<typename C >
void mptensor::matrix_interface::matrix_product ( const Matrix< C > &  a,
const Matrix< C > &  b,
Matrix< C > &  c 
)

◆ matrix_qr()

template<typename C >
int mptensor::matrix_interface::matrix_qr ( Matrix< C > &  a,
Matrix< C > &  r 
)

◆ matrix_solve()

template<typename C >
int mptensor::matrix_interface::matrix_solve ( Matrix< C > &  a,
Matrix< C > &  b 
)

Solve linear equation \( AX=B\).

Parameters
[in]aThe \( N\times N\) coefficient matrix A. On exit, it may be destroyed.
[in,out]bOn entry, the \( N\times K\) right-hand side matrix B. On exit, the \( N\times K\) solution matrix X.
Returns
information from the library.

◆ matrix_svd() [1/2]

template<typename C >
int mptensor::matrix_interface::matrix_svd ( Matrix< C > &  a,
Matrix< C > &  u,
std::vector< double > &  s,
Matrix< C > &  v 
)

◆ matrix_svd() [2/2]

template<typename C >
int mptensor::matrix_interface::matrix_svd ( Matrix< C > &  a,
std::vector< double > &  s 
)

◆ matrix_trace()

template<typename C >
C mptensor::matrix_interface::matrix_trace ( const Matrix< C > &  a)

◆ max()

template<typename C >
double mptensor::matrix_interface::max ( const Matrix< C > &  a)

Return the maximum element.

For complex-valued matrix, this function is the same as max_abs();

Parameters
[in]aA matrix
Returns
The maximum value in all elements. It's a global scalar.

◆ max_abs()

template<typename C >
double mptensor::matrix_interface::max_abs ( const Matrix< C > &  a)

Return the maximum of the absolute value of elements.

Parameters
[in]aA matrix
Returns
The maximum of the absolute value of elements. It's a global scalar.

◆ min()

template<typename C >
double mptensor::matrix_interface::min ( const Matrix< C > &  a)

Return the minimum element.

For complex-valued matrix, this function is the same as min_abs();

Parameters
[in]aA matrix
Returns
The minimum value in all elements. It's a global scalar.

◆ min_abs()

template<typename C >
double mptensor::matrix_interface::min_abs ( const Matrix< C > &  a)

Return the minimum of the absolute value of elements.

Parameters
[in]aA matrix
Returns
The minimum of the absolute value of elements. It's a global scalar.

◆ replace_matrix_data() [1/2]

template<typename C >
void mptensor::matrix_interface::replace_matrix_data ( const Matrix< C > &  M,
const std::vector< int > &  dest_rank,
const std::vector< size_t > &  local_position,
Matrix< C > &  M_new 
)

◆ replace_matrix_data() [2/2]

template<typename C >
void mptensor::matrix_interface::replace_matrix_data ( const std::vector< C > &  V,
const std::vector< int > &  dest_rank,
const std::vector< size_t > &  local_position,
Matrix< C > &  M_new 
)

◆ sum_matrix_data()

template<typename C >
void mptensor::matrix_interface::sum_matrix_data ( const Matrix< C > &  M,
const std::vector< int > &  dest_rank,
const std::vector< size_t > &  local_position,
Matrix< C > &  M_new 
)