1 
2 #ifndef QMCPLUSPLUS_AFQMC_KPTHCHAMILTONIAN_H
3 #define QMCPLUSPLUS_AFQMC_KPTHCHAMILTONIAN_H
4 
5 #include <iostream>
6 #include <vector>
7 #include <map>
8 #include <fstream>
9 
10 #include "hdf/hdf_archive.h"
11 
12 #include "AFQMC/config.h"
13 #include "AFQMC/Utilities/taskgroup.h"
14 #include "AFQMC/Numerics/ma_operations.hpp"
15 
16 #include "AFQMC/Hamiltonians/OneBodyHamiltonian.hpp"
17 
18 #include "AFQMC/HamiltonianOperations/HamiltonianOperations.hpp"
19 
20 namespace qmcplusplus
21 {
22 namespace afqmc
23 {
24 class KPTHCHamiltonian : public OneBodyHamiltonian
25 {
26 public:
27   using shmSpMatrix = boost::multi::array<SPComplexType, 2, shared_allocator<SPComplexType>>;
28   using CMatrix     = boost::multi::array<ComplexType, 2>;
29 
30   KPTHCHamiltonian(AFQMCInfo const& info,
31                    xmlNodePtr cur,
32                    boost::multi::array<ValueType, 2>&& h,
33                    TaskGroup_& tg_,
34                    ValueType nucE = 0,
35                    ValueType fzcE = 0)
OneBodyHamiltonian(info,std::move (h),nucE,fzcE)36       : OneBodyHamiltonian(info, std::move(h), nucE, fzcE), TG(tg_), fileName("")
37   {
38     if (TG.getNumberOfTGs() > 1)
39       APP_ABORT(" Error: Distributed KPTHCHamiltonian not yet implemented.\n");
40 
41     std::string str("yes");
42     ParameterSet m_param;
43     m_param.add(cutoff_cholesky, "cutoff_cholesky");
44     m_param.add(fileName, "filename");
45     m_param.put(cur);
46   }
47 
~KPTHCHamiltonian()48   ~KPTHCHamiltonian() {}
49 
50   KPTHCHamiltonian(KPTHCHamiltonian const& other) = delete;
51   KPTHCHamiltonian(KPTHCHamiltonian&& other)      = default;
52   KPTHCHamiltonian& operator=(KPTHCHamiltonian const& other) = delete;
53   KPTHCHamiltonian& operator=(KPTHCHamiltonian&& other) = delete;
54 
getNuclearCoulombEnergy()55   ValueType getNuclearCoulombEnergy() const { return OneBodyHamiltonian::NuclearCoulombEnergy; }
56 
getH1()57   boost::multi::array<ValueType, 2> getH1() const { return OneBodyHamiltonian::getH1(); }
58 
59   HamiltonianOperations getHamiltonianOperations(bool pureSD,
60                                                  bool addCoulomb,
61                                                  WALKER_TYPES type,
62                                                  std::vector<PsiT_Matrix>& PsiT,
63                                                  double cutvn,
64                                                  double cutv2,
65                                                  TaskGroup_& TGprop,
66                                                  TaskGroup_& TGwfn,
67                                                  hdf_archive& dump);
68 
H(IndexType I,IndexType J)69   ValueType H(IndexType I, IndexType J) const { return OneBodyHamiltonian::H(I, J); }
70 
71   // this should never be used outside initialization routines.
H(IndexType I,IndexType J,IndexType K,IndexType L)72   ValueType H(IndexType I, IndexType J, IndexType K, IndexType L) const
73   {
74     APP_ABORT("Error: Calling H(I,J,K,L) in THCHamiltonian. \n");
75     return ValueType(0.0);
76   }
77 
78 protected:
79   // for hamiltonian distribution
80   TaskGroup_& TG;
81 
82   std::string fileName;
83 
84   double cutoff_cholesky;
85 };
86 
87 } // namespace afqmc
88 } // namespace qmcplusplus
89 
90 #endif
91