Psi4
sapt2.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2019 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef SAPT2_H
30 #define SAPT2_H
31 
32 #include "sapt.h"
33 
34 namespace psi {
35 namespace sapt {
36 
37 class SAPT2 : public SAPT {
38  private:
39  virtual void print_header();
40  virtual void print_results();
41 
42  protected:
43  size_t no_nvirA_;
44  size_t no_nvirB_;
45 
46  double *no_evalsA_;
47  double *no_evalsB_;
48 
49  double **no_CA_;
50  double **no_CB_;
51 
52  // These ints should not overflow below 46000 basis functions
53  // They contain indices up to nso_ * (nso_ + 1) / 2
54  int *ioff_;
55  int *index2i_;
56  int *index2j_;
57 
58  int maxiter_;
59  double e_conv_;
60  double d_conv_;
61 
65  double occ_cutoff_;
66 
67  double e_elst10_;
68  double e_elst12_;
69  double e_exch10_;
70  double e_exch10_s2_;
71  double e_exch11_;
72  double e_exch12_;
73  double e_ind20_;
74  double e_ind22_;
75  double e_exch_ind20_;
76  double e_exch_ind22_;
77  double e_disp20_;
78  double e_no_disp20_;
80  double e_sapt0_;
81  double e_sapt2_;
82 
83  double **wBAA_;
84  double **wBAR_;
85  double **wBRR_;
86 
87  double **wABB_;
88  double **wABS_;
89  double **wASS_;
90 
91  double **get_AA_ints(const int, int = 0, int = 0);
92  double **get_diag_AA_ints(const int);
93  double **get_AR_ints(const int, int = 0);
94  double **get_RR_ints(const int);
95  double **get_BB_ints(const int, int = 0, int = 0);
96  double **get_diag_BB_ints(const int);
97  double **get_BS_ints(const int, int = 0);
98  double **get_SS_ints(const int);
99  double **get_AB_ints(const int, int = 0, int = 0);
100  double **get_AS_ints(const int, int = 0);
101  double **get_RB_ints(const int, int = 0);
102 
103  void df_integrals();
104  void w_integrals();
105 
106  double **get_DF_ints(int, const char *, int, int, int, int);
107  double **get_DF_ints_nongimp(int, const char *, int, int, int, int);
108  void antisym(double *, size_t, size_t);
109  void antisym(double **, size_t, size_t);
110 
111  void cphf_solver(double **, double **, double *, int, const char *, const char *, const char *, size_t, size_t);
112 
113  void exch_ind20rA_B();
114  void exch_ind20rB_A();
115 
116  void tOVOV(int, const char *, size_t, size_t, size_t, double *, int, const char *, size_t, size_t, size_t, double *, size_t,
117  const char *);
118  void pOOpVV(int, const char *, const char *, size_t, size_t, size_t, const char *, const char *);
119  void theta(int, const char *, const char, bool, size_t, size_t, size_t, size_t, const char *, size_t, const char *);
120 
121  void Y2(int, const char *, const char *, const char *, int, const char *, const char *, const char *, size_t, size_t, size_t,
122  double *, size_t, const char *, const char *);
123  void Y2_1(double **, int, const char *, const char *, int, const char *, size_t, size_t, size_t);
124  void Y2_2(double **, int, const char *, const char *, int, const char *, size_t, size_t, size_t);
125  void Y2_3(double **, int, const char *, const char *, int, const char *, size_t, size_t, size_t);
126 
127  void t2OVOV(int, const char *, const char *, int, const char *, const char *, const char *, size_t, size_t, size_t, double *,
128  size_t, const char *);
129  void t2OVOV(int, const char *, const char *, const char *, int, const char *, const char *, const char *,
130  const char *, size_t, size_t, size_t, size_t, double *, double **, size_t, const char *);
131 
132  void OVOpVp_to_OVpOpV(double *, int, int);
133  void ijkl_to_ikjl(double *, size_t, size_t, size_t, size_t);
134  void symmetrize(double *, int, int);
135 
136  void natural_orbitalify(int, const char *, double *evals, int, int, size_t, const char);
138 
139  double elst120(double **, double **, double **, int, const char *, const char *, const char *, size_t, size_t, size_t);
140 
141  double exch110(int, const char *);
142  double exch101(int, const char *);
143  double exch111();
144  double exch120_k2f();
145  double exch102_k2f();
146  double exch120_k11u_1();
147  double exch102_k11u_1();
148  double exch120_k11u_2();
149  double exch102_k11u_2();
150  double exch120_k11u_3();
151  double exch102_k11u_3();
152  double exch120_k11u_4();
153  double exch102_k11u_4();
154  double exch120_k11u_5();
155  double exch102_k11u_5();
156  double exch120_k11u_6();
157  double exch102_k11u_6();
158 
159  double ind220();
160  double ind202();
161  double ind220_1(int, const char *, const char *, const char *, int, const char *, double **, double **, double **,
162  size_t, size_t, size_t, double *);
163  double ind220_2(int, const char *, double **, double **, double **, size_t, size_t, size_t);
164  double ind220_3(int, const char *, const char *, double **, double **, size_t, size_t, size_t);
165  double ind220_4(int, const char *, int, const char *, double **, size_t, size_t, size_t);
166  double ind220_5(int, const char *, double **, size_t, size_t, size_t, double *);
167  double ind220_6(int, const char *, const char *, const char *, int, const char *, double **, size_t, size_t, size_t);
168  double ind220_7(int, const char *, const char *, const char *, int, const char *, int, const char *, const char *,
169  const char *, double **, size_t, size_t, size_t, size_t, size_t, size_t);
170 
171  public:
173  std::shared_ptr<PSIO> psio);
174  ~SAPT2() override;
175 
176  double compute_energy() override;
177 
178  virtual void amplitudes();
179 
180  void elst10();
181  void exch10_s2();
182  void exch10();
183  void ind20r();
184  void exch_ind20r();
185  void disp20();
186  void exch_disp20();
187  void elst12();
188  void exch11();
189  void exch12();
190  void ind22();
191 };
192 } // namespace sapt
193 } // namespace psi
194 
195 #endif
Definition: sapt2.h:37
int * index2i_
Definition: sapt2.h:55
void exch_ind20rA_B()
Definition: exch-ind20.cc:681
double * no_evalsA_
Definition: sapt2.h:46
void elst10()
Definition: elst10.cc:45
void exch12()
Definition: exch12.cc:38
double e_exch12_
Definition: sapt2.h:72
double ind220_2(int, const char *, double **, double **, double **, size_t, size_t, size_t)
Definition: ind22.cc:216
double ** get_DF_ints(int, const char *, int, int, int, int)
Definition: utils.cc:1281
double ** get_AA_ints(const int, int=0, int=0)
Definition: utils.cc:1047
Options & options() const
Definition: wavefunction.cc:648
double ** get_BB_ints(const int, int=0, int=0)
Definition: utils.cc:1087
double exch120_k11u_1()
Definition: exch12.cc:379
void tOVOV(int, const char *, size_t, size_t, size_t, double *, int, const char *, size_t, size_t, size_t, double *, size_t, const char *)
Definition: amplitudes.cc:105
double ** get_diag_BB_ints(const int)
Definition: utils.cc:1107
double e_exch10_
Definition: sapt2.h:69
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:646
bool nat_orbs_t3_
Definition: sapt2.h:62
void Y2(int, const char *, const char *, const char *, int, const char *, const char *, const char *, size_t, size_t, size_t, double *, size_t, const char *, const char *)
Definition: amplitudes.cc:202
double exch102_k2f()
Definition: exch12.cc:264
double ** get_RB_ints(const int, int=0)
Definition: utils.cc:1255
double exch120_k11u_4()
Definition: exch12.cc:1315
size_t no_nvirB_
Definition: sapt2.h:44
double e_elst10_
Definition: sapt2.h:67
double e_exch_ind20_
Definition: sapt2.h:75
double ** wBAA_
Definition: sapt2.h:83
double exch120_k11u_5()
Definition: exch12.cc:1487
double ** get_diag_AA_ints(const int)
Definition: utils.cc:1067
double e_disp20_
Definition: sapt2.h:77
double ** no_CB_
Definition: sapt2.h:50
double exch120_k11u_3()
Definition: exch12.cc:1038
void t2OVOV(int, const char *, const char *, int, const char *, const char *, const char *, size_t, size_t, size_t, double *, size_t, const char *)
Definition: amplitudes.cc:319
void cphf_solver(double **, double **, double *, int, const char *, const char *, const char *, size_t, size_t)
Definition: ind20.cc:967
void disp20()
Definition: disp20.cc:120
double e_exch11_
Definition: sapt2.h:71
int maxiter_
Definition: sapt2.h:58
double ** get_AS_ints(const int, int=0)
Definition: utils.cc:1229
double ** get_BS_ints(const int, int=0)
Definition: utils.cc:1169
double ind220_4(int, const char *, int, const char *, double **, size_t, size_t, size_t)
Definition: ind22.cc:274
int * index2j_
Definition: sapt2.h:56
bool nat_orbs_v4_
Definition: sapt2.h:64
void Y2_2(double **, int, const char *, const char *, int, const char *, size_t, size_t, size_t)
Definition: amplitudes.cc:264
double ** wABS_
Definition: sapt2.h:88
int * ioff_
Definition: sapt2.h:54
double ** get_RR_ints(const int)
Definition: utils.cc:1185
double exch102_k11u_2()
Definition: exch12.cc:873
double e_elst12_
Definition: sapt2.h:68
double e_exch_disp20_
Definition: sapt2.h:79
void exch11()
Definition: exch11.cc:38
void ijkl_to_ikjl(double *, size_t, size_t, size_t, size_t)
Definition: amplitudes.cc:576
void natural_orbitalify_df_ints()
Definition: sapt2.cc:989
double ind220_1(int, const char *, const char *, const char *, int, const char *, double **, double **, double **, size_t, size_t, size_t, double *)
Definition: ind22.cc:147
double ind220_7(int, const char *, const char *, const char *, int, const char *, int, const char *, const char *, const char *, double **, size_t, size_t, size_t, size_t, size_t, size_t)
Definition: ind22.cc:399
double exch102_k11u_6()
Definition: exch12.cc:1785
double ind220_6(int, const char *, const char *, const char *, int, const char *, double **, size_t, size_t, size_t)
Definition: ind22.cc:347
void exch_ind20rB_A()
Definition: exch-ind20.cc:913
double ind220_5(int, const char *, double **, size_t, size_t, size_t, double *)
Definition: ind22.cc:314
void OVOpVp_to_OVpOpV(double *, int, int)
Definition: amplitudes.cc:556
double exch102_k11u_3()
Definition: exch12.cc:1170
double ** wBAR_
Definition: sapt2.h:84
double ** get_DF_ints_nongimp(int, const char *, int, int, int, int)
Definition: utils.cc:1305
double exch120_k11u_2()
Definition: exch12.cc:720
double ** get_SS_ints(const int)
Definition: utils.cc:1207
double d_conv_
Definition: sapt2.h:60
void theta(int, const char *, const char, bool, size_t, size_t, size_t, size_t, const char *, size_t, const char *)
Definition: amplitudes.cc:162
virtual void amplitudes()
Definition: amplitudes.cc:41
double ** get_AB_ints(const int, int=0, int=0)
Definition: utils.cc:1127
double exch102_k11u_1()
Definition: exch12.cc:552
void Y2_1(double **, int, const char *, const char *, int, const char *, size_t, size_t, size_t)
Definition: amplitudes.cc:232
void exch_ind20r()
Definition: exch-ind20.cc:656
double * no_evalsB_
Definition: sapt2.h:47
Definition: sapt.h:51
virtual void print_header()
Definition: sapt2.cc:184
double e_exch_ind22_
Definition: sapt2.h:76
double ** get_AR_ints(const int, int=0)
Definition: utils.cc:1153
double e_no_disp20_
Definition: sapt2.h:78
Definition: liboptions.h:353
size_t no_nvirA_
Definition: sapt2.h:43
double exch102_k11u_5()
Definition: exch12.cc:1572
void exch10_s2()
Definition: exch10.cc:443
double e_ind22_
Definition: sapt2.h:74
double ** wASS_
Definition: sapt2.h:89
void exch_disp20()
Definition: exch-disp20.cc:1607
SAPT2(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO > psio)
Definition: sapt2.cc:46
double exch110(int, const char *)
Definition: exch11.cc:58
double exch120_k11u_6()
Definition: exch12.cc:1657
double exch111()
Definition: exch12.cc:99
void df_integrals()
Definition: sapt2.cc:383
double ** no_CA_
Definition: sapt2.h:49
void ind22()
Definition: ind22.cc:38
bool nat_orbs_t2_
Definition: sapt2.h:63
void symmetrize(double *, int, int)
Definition: amplitudes.cc:598
double e_sapt2_
Definition: sapt2.h:81
double ind220()
Definition: ind22.cc:59
void ind20r()
Definition: ind20.cc:942
double compute_energy() override
Compute energy. Subclasses override this function to compute its energy.
Definition: sapt2.cc:133
double e_ind20_
Definition: sapt2.h:73
double exch101(int, const char *)
Definition: exch11.cc:127
double exch102_k11u_4()
Definition: exch12.cc:1402
void w_integrals()
Definition: sapt2.cc:818
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:50
void natural_orbitalify(int, const char *, double *evals, int, int, size_t, const char)
Definition: sapt2.cc:909
virtual void print_results()
Definition: sapt2.cc:233
double exch120_k2f()
Definition: exch12.cc:155
double e_conv_
Definition: sapt2.h:59
double ** wBRR_
Definition: sapt2.h:85
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
double occ_cutoff_
Definition: sapt2.h:65
~SAPT2() override
Definition: sapt2.cc:107
double ind220_3(int, const char *, const char *, double **, double **, size_t, size_t, size_t)
Definition: ind22.cc:241
double elst120(double **, double **, double **, int, const char *, const char *, const char *, size_t, size_t, size_t)
Definition: elst12.cc:60
double e_exch10_s2_
Definition: sapt2.h:70
void elst12()
Definition: elst12.cc:38
void Y2_3(double **, int, const char *, const char *, int, const char *, size_t, size_t, size_t)
Definition: amplitudes.cc:296
double ind202()
Definition: ind22.cc:103
void antisym(double *, size_t, size_t)
Definition: utils.cc:1326
void exch10()
Definition: exch10.cc:547
void pOOpVV(int, const char *, const char *, size_t, size_t, size_t, const char *, const char *)
Definition: amplitudes.cc:135
double ** wABB_
Definition: sapt2.h:87
double e_sapt0_
Definition: sapt2.h:80