ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
lr_util.h File Reference
#include <cstddef>
#include <vector>
#include <utility>
#include "source_base/matrix.h"
#include "source_base/complexmatrix.h"
#include "source_base/parallel_2d.h"
#include "source_psi/psi.h"
#include <ATen/core/tensor.h>
#include "source_basis/module_pw/pw_basis.h"
#include "lr_util.hpp"
Include dependency graph for lr_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ToComplex< double >
 
struct  ToComplex< std::complex< double > >
 
struct  ToComplex< float >
 
struct  ToComplex< std::complex< float > >
 

Namespaces

namespace  LR_Util
 

Macros

#define TO_COMPLEX_H
 

Typedefs

using DAT = container::DataType
 
using DEV = container::DeviceType
 

Functions

template<typename TCell >
int LR_Util::cal_nelec (const TCell &ucell)
 =====================PHYSICS====================
 
int LR_Util::cal_nocc (int nelec)
 =================PHYSICS====================
 
std::pair< ModuleBase::matrix, std::vector< std::pair< int, int > > > LR_Util::set_ix_map_diagonal (bool mode, int nc, int nv)
 set the index map: ix to (ic, iv) and vice versa by diagonal traverse the c-v pairs leftdown -> rightup for mode 0, rightup -> leftdown for mode 1
 
template<typename T >
void LR_Util::_deallocate_2order_nested_ptr (T **p2, size_t size)
 =================ALGORITHM====================
 
template<typename T >
void LR_Util::_allocate_2order_nested_ptr (T **&p2, size_t size1, size_t size2)
 new 2d pointer

 
template<typename T >
ct::Tensor LR_Util::newTensor (const ct::TensorShape &shape)
 
template<typename T >
void LR_Util::matsym (const T *in, const int n, T *out)
 
template<typename T >
void LR_Util::matsym (T *inout, const int n)
 calculate (A+A^T)/2 (in-place version)
 
template<typename T >
void LR_Util::matsym (const T *in, const int n, const Parallel_2D &pmat, T *out)
 
template<typename T >
void LR_Util::matsym (T *inout, const int n, const Parallel_2D &pmat)
 
template<typename T , typename Device >
psi::Psi< T, Device > LR_Util::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
 
template<typename T , typename Device >
psi::Psi< T, Device > LR_Util::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
 
void LR_Util::setup_2d_division (Parallel_2D &pv, int nb, int gr, int gc)
 =================2D-block Parallel===============
 
void LR_Util::setup_2d_division (Parallel_2D &pv, int nb, int gr, int gc, const int &blacs_ctxt_in)
 
template<typename T >
void LR_Util::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
 
void LR_Util::diag_lapack (const int &n, double *mat, double *eig)
 diagonalize a hermitian matrix
 
void LR_Util::diag_lapack (const int &n, std::complex< double > *mat, double *eig)
 
void LR_Util::diag_lapack_nh (const int &n, double *mat, std::complex< double > *eig)
 diagonalize a general matrix
 
void LR_Util::diag_lapack_nh (const int &n, std::complex< double > *mat, std::complex< double > *eig)
 
std::string LR_Util::tolower (const std::string &str)
 =================string option====================
 
std::string LR_Util::toupper (const std::string &str)
 

Macro Definition Documentation

◆ TO_COMPLEX_H

#define TO_COMPLEX_H

Typedef Documentation

◆ DAT

◆ DEV