18template <>
struct ToComplex<double> {
using type = std::complex<double>; };
20template <>
struct ToComplex<float> {
using type = std::complex<float>; };
31 template <
typename TCell>
45 std::pair<ModuleBase::matrix, std::vector<std::pair<int, int>>>
67 void matsym(
const T* in,
const int n,
T* out);
70 void matsym(
T* inout,
const int n);
80 template<
typename T,
typename Device>
83 template<
typename T,
typename Device>
101 void diag_lapack(
const int& n,
double* mat,
double* eig);
102 void diag_lapack(
const int& n, std::complex<double>* mat,
double* eig);
104 void diag_lapack_nh(
const int& n,
double* mat, std::complex<double>* eig);
105 void diag_lapack_nh(
const int& n, std::complex<double>* mat, std::complex<double>* eig);
108 std::string
tolower(
const std::string& str);
109 std::string
toupper(
const std::string& str);
This class packs the basic information of 2D-block-cyclic parallel distribution of an arbitrary matri...
Definition parallel_2d.h:12
A class for representing the shape of a tensor.
Definition tensor_shape.h:13
A multi-dimensional array of elements of a single data type.
Definition tensor.h:32
std::complex< double > complex
Definition diago_cusolver.cpp:13
#define T
Definition exp.cpp:237
int cal_nelec(const TCell &ucell)
=====================PHYSICS====================
Definition lr_util.hpp:13
ct::Tensor newTensor(const ct::TensorShape &shape)
Definition lr_util.h:59
void matsym(const T *in, const int n, T *out)
Definition lr_util.hpp:70
void gather_2d_to_full(const Parallel_2D &pv, const T *submat, T *fullmat, bool col_first, int global_nrow, int global_ncol)
gather 2d matrix to full matrix the defination of row and col is consistent with setup_2d_division
Definition lr_util.hpp:148
int cal_nocc(int nelec)
=================PHYSICS====================
Definition lr_util.cpp:8
std::string toupper(const std::string &str)
Definition lr_util.cpp:189
std::string tolower(const std::string &str)
=================string option====================
Definition lr_util.cpp:183
void diag_lapack(const int &n, double *mat, double *eig)
diagonalize a hermitian matrix
Definition lr_util.cpp:118
void diag_lapack_nh(const int &n, double *mat, std::complex< double > *eig)
diagonalize a general matrix
Definition lr_util.cpp:147
psi::Psi< T, Device > bfirst_to_k1_wrapper(const psi::Psi< T, Device > &psi_bfirst)
psi(nb, nk, nbasis) -> psi(nk=1, nbands=nb, nk * nbasis) without memory copy
Definition lr_util.hpp:130
psi::Psi< T, Device > k1_to_bfirst_wrapper(const psi::Psi< T, Device > &psi_kfirst, int nk_in, int nbasis_in)
psi(nk=1, nbands=nb, nk * nbasis) -> psi(nb, nk, nbasis) without memory copy
Definition lr_util.hpp:111
void _allocate_2order_nested_ptr(T **&p2, size_t size1, size_t size2)
new 2d pointer
Definition lr_util.hpp:35
void _deallocate_2order_nested_ptr(T **p2, size_t size)
=================ALGORITHM====================
Definition lr_util.hpp:49
std::pair< ModuleBase::matrix, std::vector< std::pair< int, int > > > set_ix_map_diagonal(bool mode, int nocc, int nvirt)
set the index map: ix to (ic, iv) and vice versa by diagonal traverse the c-v pairs leftdown -> right...
Definition lr_util.cpp:11
void setup_2d_division(Parallel_2D &pv, int nb, int gr, int gc)
=================2D-block Parallel===============
Definition lr_util.cpp:99
DataType
Enumeration of data types for tensors. The DataType enum lists the supported data types for tensors....
Definition tensor_types.h:50
DeviceType
The type of memory used by an allocator.
Definition tensor_types.h:73
std::complex< double > type
Definition lr_util.h:18
std::complex< float > type
Definition lr_util.h:20
std::complex< double > type
Definition lr_util.h:19
std::complex< float > type
Definition lr_util.h:21
Template struct for mapping a DataType to its corresponding enum value.
Definition tensor_types.h:194
Template struct for mapping a Device Type to its corresponding enum value.
Definition tensor_types.h:158