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#pragma once
4#include "source_psi/psi.h"
5
6#include <RI/global/Tensor.h>
7namespace RI_Benchmark
8{
9 using TC = std::array<int, 3>;
10 using TAC = std::pair<int, TC>;
11
12 template <typename T>
13 using TLRI = std::map<int, std::map<TAC, RI::Tensor<T>>>;
14 template<typename T>
15 using TLRIX = std::map<int, std::map<TAC, std::vector<T>>>;
16
17 template <typename TK, typename TR>
18 void benchmark_driver_A(std::string& file_Cs, std::string& file_Vs, std::string& file_kswfc, const int nocc, const int nvirt);
19 template <typename TK, typename TR>
20 void benchmark_driver_AX(std::string& file_Cs, std::string& file_Vs, std::string& file_kswfc, const int nocc, const int nvirt);
21
22 // 1. full-matrix version
23
26 template <typename TK, typename TR>
27 TLRI<TK> cal_Cs_mo(const UnitCell& ucell,
28 const TLRI<TR>& Cs_ao,
29 const psi::Psi<TK>& wfc_ks,
30 const int& nocc,
31 const int& nvirt,
32 const int& occ_first=false,
33 const bool& read_from_aims=false,
34 const std::vector<int>& aims_nbasis={});
35
37 template <typename TK, typename TR>
38 std::vector<TK> cal_Amat_full(const TLRI<TK>& Cs_a,
39 const TLRI<TK>& Cs_b,
40 const TLRI<TR>& Vs);
41
42 // 2. AX version
43 template <typename TK>
44 TLRIX<TK> cal_CsX(const TLRI<TK>& Cs_mo, TK* X);
45
46 template <typename TK, typename TR>
47 TLRI<TK> cal_CV(const TLRI<TK>& Cs_a,
48 const TLRI<TR>& Vs);
49
51 template <typename TK, typename TR>
52 void cal_AX(const TLRI<TK>& Cs_a,
53 const TLRIX<TK>& Cs_bX,
54 const TLRI<TR>& Vs,
55 TK* AX,
56 const double& scale = 2.0);
58 template <typename TK>
59 void cal_AX(const TLRI<TK>& CV,
60 const TLRIX<TK>& Cs_bX,
61 TK* AX,
62 const double& scale = 2.0);
63
64 template<typename FPTYPE>
65 std::vector<FPTYPE> read_bands(const std::string& file, const int nocc, const int nvirt, int& ncore);
66 template <typename TK>
67 void read_aims_eigenvectors(psi::Psi<TK>& wfc_ks, const std::string& file, const int ncore, const int nbands, const int nbasis);
69 template <typename TR>
70 TLRI<TR> read_coulomb_mat(const std::string& file, const TLRI<TR>& Cs);
72 template <typename TR>
73 TLRI<TR> read_coulomb_mat_general(const std::string& file, const TLRI<TR>& Cs);
74 template <typename TR>
75 bool compare_Vs(const TLRI<TR>& Vs1, const TLRI<TR>& Vs2, const double thr = 1e-4);
76 template <typename TR>
77 std::vector<TLRI<TR>> split_Ds(const std::vector<std::vector<TR>>& Ds, const std::vector<int>& aims_nbasis, const UnitCell& ucell);
78}
79#include "ri_benchmark.hpp"
80#endif
Definition unitcell.h:16
Definition psi.h:37
std::map< int, std::map< TAC, std::vector< T > > > TLRIX
Definition lr_util_print.h:163
Definition operator_ri_hartree.h:6
TLRI< TR > read_coulomb_mat_general(const std::string &file, const TLRI< TR > &Cs)
Definition ri_benchmark.hpp:391
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:218
TLRIX< TK > cal_CsX(const TLRI< TK > &Cs_mo, const TK *X)
Definition ri_benchmark.hpp:156
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, const bool &read_from_aims, const std::vector< int > &aims_nbasis)
Definition ri_benchmark.hpp:49
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:473
std::vector< TK > cal_Amat_full(const TLRI< TK > &Cs_a, const TLRI< TK > &Cs_b, const TLRI< TR > &Vs)
Definition ri_benchmark.hpp:111
TLRI< TK > cal_CV(const TLRI< TK > &Cs_a_mo, const TLRI< TR > &Vs)
Definition ri_benchmark.hpp:178
TLRI< TR > read_coulomb_mat(const std::string &file, const TLRI< TR > &Cs)
Definition ri_benchmark.hpp:351
bool compare_Vs(const TLRI< TR > &Vs1, const TLRI< TR > &Vs2, const double thr)
Definition ri_benchmark.hpp:449
void read_aims_eigenvectors(psi::Psi< TK > &wfc_ks, const std::string &file, const int ncore, const int nbands, const int nbasis)
Definition ri_benchmark.hpp:308
std::array< int, 3 > TC
Definition ri_cv_io_test.cpp:9
std::pair< int, TC > TAC
Definition ri_cv_io_test.cpp:10
std::map< int, std::map< TAC, RI::Tensor< T > > > TLRI
Definition ri_cv_io_test.cpp:12
file(GLOB ATen_CORE_SRCS "*.cpp") set(ATen_CPU_SRCS $
Definition CMakeLists.txt:1