ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ri_benchmark.h
Go to the documentation of this file.
1#ifdef __EXX
2#ifndef ABACUS_SOURCE_LCAO_MODULE_LR_RI_BENCHMARK_RI_BENCHMARK_H
3#define ABACUS_SOURCE_LCAO_MODULE_LR_RI_BENCHMARK_RI_BENCHMARK_H
4
6#include "source_psi/psi.h"
9#include <RI/global/Tensor.h>
10namespace RI_Benchmark
11{
12 using TA = int;
13 using TC = std::array<int, 3>;
14 using TAC = std::pair<int, TC>;
15
16 template <typename T>
17 using TLRI = std::map<int, std::map<TAC, RI::Tensor<T>>>;
18 template<typename T>
19 using TLRIX = std::map<int, std::map<TAC, std::vector<T>>>;
20
21 template <typename TK, typename TR>
22 void benchmark_driver_A(std::string& file_Cs, std::string& file_Vs, std::string& file_kswfc, const int nocc, const int nvirt);
23 template <typename TK, typename TR>
24 void benchmark_driver_AX(std::string& file_Cs, std::string& file_Vs, std::string& file_kswfc, const int nocc, const int nvirt);
25
26 // 1. full-matrix version
27
30 template <typename TK, typename TR>
31 TLRI<TK> cal_Cs_mo(const UnitCell& ucell,
32 const TLRI<TR>& Cs_ao,
33 const psi::Psi<TK>& wfc_ks,
34 const int& nocc,
35 const int& nvirt,
36 const int& occ_first=false);
37
39 template <typename TK, typename TR>
40 std::vector<TK> cal_Amat_full(const TLRI<TK>& Cs_a,
41 const TLRI<TK>& Cs_b,
42 const TLRI<TR>& Vs);
43
44 // 2. AX version
45 template <typename TK>
46 TLRIX<TK> cal_CsX(const TLRI<TK>& Cs_mo, TK* X);
47
48 template <typename TK, typename TR>
49 TLRI<TK> cal_CV(const TLRI<TK>& Cs_a,
50 const TLRI<TR>& Vs);
51
53 template <typename TK, typename TR>
54 void cal_AX(const TLRI<TK>& Cs_a,
55 const TLRIX<TK>& Cs_bX,
56 const TLRI<TR>& Vs,
57 TK* AX,
58 const double& scale = 2.0);
60 template <typename TK>
61 void cal_AX(const TLRI<TK>& CV,
62 const TLRIX<TK>& Cs_bX,
63 TK* AX,
64 const double& scale = 2.0);
65
66 // 3. read/write tools
67 template<typename FPTYPE>
68 std::vector<FPTYPE> read_aims_ebands(const std::string& file, const int nocc, const int nvirt, int& ncore);
69
70 template <typename TK>
71 void read_aims_eigenvectors(psi::Psi<TK>& wfc_ks, const std::string& file, const int ncore, const int nbands, const int nbasis);
72
73 template <typename TR>
74 bool compare_Vs(const TLRI<TR>& Vs1, const TLRI<TR>& Vs2, const double thr = 1e-4);
75 template <typename TR>
76 std::vector<TLRI<TR>> split_Ds(const std::vector<std::vector<TR>>& Ds, const std::vector<int>& aims_nbasis, const UnitCell& ucell);
77}
78#include "ri_benchmark.hpp"
79#endif
80
81#endif // ABACUS_SOURCE_LCAO_MODULE_LR_RI_BENCHMARK_RI_BENCHMARK_H
int TA
================ RI ==================
Definition bse_util.h:36
std::map< int, std::map< TAC, std::vector< T > > > TLRIX
Definition lr_util_print.h:196
Definition operator_ri_hartree.h:8
void cal_AX(const TLRI< TK > &Cs_a, const TLRIX< TK > &Cs_bX, const TLRI< TR > &Vs, TK *AX, const double &scale)
Definition ri_benchmark.hpp:220
TLRI< TK > cal_Cs_mo(const UnitCell &ucell, const TLRI< TR > &Cs_ao, const psi::Psi< TK > &wfc_ks, const int &nocc, const int &nvirt, const int &occ_first)
Definition ri_benchmark.hpp:55
TLRIX< TK > cal_CsX(const TLRI< TK > &Cs_mo, const TK *X)
Definition ri_benchmark.hpp:158
std::vector< TLRI< TR > > split_Ds(const std::vector< std::vector< TR > > &Ds, const std::vector< int > &aims_nbasis, const UnitCell &ucell)
Definition ri_benchmark.hpp:381
std::vector< TK > cal_Amat_full(const TLRI< TK > &Cs_a, const TLRI< TK > &Cs_b, const TLRI< TR > &Vs)
Definition ri_benchmark.hpp:114
TLRI< TK > cal_CV(const TLRI< TK > &Cs_a_mo, const TLRI< TR > &Vs)
Definition ri_benchmark.hpp:180
std::vector< FPTYPE > read_aims_ebands(const std::string &file, const int nocc, const int nvirt, int &ncore)
Definition ri_benchmark.hpp:282
bool compare_Vs(const TLRI< TR > &Vs1, const TLRI< TR > &Vs2, const double thr)
Definition ri_benchmark.hpp:356
void read_aims_eigenvectors(psi::Psi< TK > &wfc_ks, const std::string &file, const int ncore, const int nbands, const int nbasis)
read the eigenvectors from FHI-aims, only for gamma_only and spin degenerate
Definition ri_benchmark.hpp:312
file(GLOB ATen_CORE_SRCS "*.cpp") set(ATen_CPU_SRCS $
Definition CMakeLists.txt:1
std::array< int, 3 > TC
Definition test_write_ri_cv.cpp:9
std::pair< int, TC > TAC
Definition test_write_ri_cv.cpp:10
std::map< int, std::map< TAC, RI::Tensor< T > > > TLRI
Definition test_write_ri_cv.cpp:12