25 #ifndef _chemistry_qc_lmp2_lmp2_h
26 #define _chemistry_qc_lmp2_lmp2_h
30 #include <math/optimize/diis.h>
31 #include <math/scmat/repl.h>
32 #include <math/scmat/matrix.h>
34 #include <chemistry/qc/basis/basis.h>
35 #include <chemistry/qc/basis/tbint.h>
36 #include <chemistry/qc/scf/scf.h>
38 #include <chemistry/qc/lmp2/sma.h>
39 #include <chemistry/qc/lmp2/domain.h>
40 #include <chemistry/qc/lmp2/util.h>
41 #include <chemistry/qc/lmp2/lcorr.h>
42 #include <chemistry/qc/lmp2/parallel.h>
46 typedef std::vector<std::pair<int,int> > my_occ_pairs_t;
48 typedef std::set<std::pair<int,int> > k_2occ_local_pairs_t;
50 typedef std::set<std::pair<int,int> > k_3_4_occ_local_pairs_t;
52 typedef std::map<sma2::triplet<int,int,int>, domainmapvirbs_t > domainmap_triple;
90 double integral_threshold_;
95 double threshold_factor_;
96 double distance_threshold_;
97 double completeness_threshold_;
100 std::string occ_orbitals_;
102 std::string vir_orbitals_;
104 int parallel_transform123a_;
105 int parallel_transform123b_;
106 int parallel_transform4a_;
107 int parallel_transform4b_;
108 int parallel_iterations_;
109 int completedomains_;
115 bool always_use_dist_t_;
135 domainmap_t domainmap_;
138 my_occ_pairs_t my_occ_pairs_;
141 std::vector<std::set<int> > paired_occ_;
169 std::vector<double> F_diag_;
175 bool analyze_occ_orbs_;
176 std::vector<SCVector3> r_i_;
177 std::vector<double> dist_ij_;
178 std::vector<double> emp2_ij_;
180 void analyze_occ_orbs(
const RefSCMatrix& scf_local);
182 double compute_lmp2_energy();
183 double compute_ecorr_lmp2();
192 std::vector<std::vector<double> > &Lmax,
194 std::vector<std::vector<double> > &PPmax,
195 const std::vector<std::vector<double> > &Dmax,
double &Dmax_maxval, std::vector<double> &Lmaxvec,
196 std::vector<std::multimap<
double,
int,std::greater<double> > > &L_map);
201 double &T_schwarz_maxval,
207 double &Pmax_maxval);
209 void compute_L_and_D_screening_quantities(std::vector<std::vector<double> > &Dmax,
211 std::vector<std::vector<double> > &Lmax,
212 std::vector<double> &Lmaxvec,
214 std::vector<std::vector<int> > &L_blocks,
215 std::vector<std::multimap<
double,
int,std::greater<double> > > &L_map,
217 double T_schwarz_maxval,
220 void compute_PPmax_screening_matrix(std::vector<std::vector<double > > &PPmax,
222 const std::vector<std::set<int> >
223 &virb_united_pair_domains,
224 double T_schwarz_maxval,
228 void compute_doubles_W();
236 double iterate_LMP2_equations(
double energy_tolerance,
double rms_tolerance);