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-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef SAPT2_H
29 #define SAPT2_H
30 
31 #include "sapt.h"
32 
33 namespace psi { namespace sapt {
34 
35 class SAPT2 : public SAPT {
36 private:
37  virtual void print_header();
38  virtual void print_results();
39 
40 protected:
41  size_t no_nvirA_;
42  size_t no_nvirB_;
43 
44  double *no_evalsA_;
45  double *no_evalsB_;
46 
47  double **no_CA_;
48  double **no_CB_;
49 
50 // These ints should not overflow below 46000 basis functions
51 // They contain indices up to nso_ * (nso_ + 1) / 2
52  int *ioff_;
53  int *index2i_;
54  int *index2j_;
55 
56  int maxiter_;
57  double e_conv_;
58  double d_conv_;
59 
63  double occ_cutoff_;
64 
65  double e_elst10_;
66  double e_elst12_;
67  double e_exch10_;
68  double e_exch10_s2_;
69  double e_exch11_;
70  double e_exch12_;
71  double e_ind20_;
72  double e_ind22_;
73  double e_exch_ind20_;
74  double e_exch_ind22_;
75  double e_disp20_;
76  double e_no_disp20_;
78  double e_sapt0_;
79  double e_sapt2_;
80 
81  double **wBAA_;
82  double **wBAR_;
83  double **wBRR_;
84 
85  double **wABB_;
86  double **wABS_;
87  double **wASS_;
88 
89  double** get_AA_ints(const int, int=0, int=0);
90  double** get_diag_AA_ints(const int);
91  double** get_AR_ints(const int, int=0);
92  double** get_RR_ints(const int);
93  double** get_BB_ints(const int, int=0, int=0);
94  double** get_diag_BB_ints(const int);
95  double** get_BS_ints(const int, int=0);
96  double** get_SS_ints(const int);
97  double** get_AB_ints(const int, int=0, int=0);
98  double** get_AS_ints(const int, int=0);
99  double** get_RB_ints(const int, int=0);
100 
101  void df_integrals();
102  void w_integrals();
103 
104  double **get_DF_ints(int, const char *, int, int, int, int);
105  double **get_DF_ints_nongimp(int, const char *, int, int, int, int);
106  void antisym(double *, int, int);
107  void antisym(double **, int, int);
108 
109  void cphf_solver(double**, double **, double *, int, const char *,
110  const char *, const char *, int, int);
111 
112  void exch_ind20rA_B();
113  void exch_ind20rB_A();
114 
115  void tOVOV(int, const char *, int, int, int, double *, int, const char *,
116  int, int, int, double *, int, const char *);
117  void pOOpVV(int, const char *, const char *, int, int, int, const char *,
118  const char *);
119  void theta(int, const char *, const char, bool, int, int, int, int,
120  const char *, int, const char *);
121 
122  void Y2(int, const char *, const char *, const char *, int, const char *,
123  const char *, const char *, int, int, int, double *, int, const char *,
124  const char *);
125  void Y2_1(double **, int, const char *, const char *, int, const char *,
126  int, int, int);
127  void Y2_2(double **, int, const char *, const char *, int, const char *,
128  int, int, int);
129  void Y2_3(double **, int, const char *, const char *, int, const char *,
130  int, int, int);
131 
132  void t2OVOV(int, const char *, const char *, int, const char *,
133  const char *, const char *, int, int, int, double *, int, const char *);
134  void t2OVOV(int, const char *, const char *, const char *, int,
135  const char *, const char *, const char *, const char *, int, int, int,
136  int, double *, double **, int, const char *);
137 
138  void OVOpVp_to_OVpOpV(double *, int, int);
139  void ijkl_to_ikjl(double *, int, int, int, int);
140  void symmetrize(double *, int, int);
141 
142  void natural_orbitalify(int, const char *, double *evals, int, int, int,
143  const char);
145 
146  double elst120(double **, double **, double **, int, const char *,
147  const char *, const char *, int, int, int);
148 
149  double exch110(int, const char *);
150  double exch101(int, const char *);
151  double exch111();
152  double exch120_k2f();
153  double exch102_k2f();
154  double exch120_k11u_1();
155  double exch102_k11u_1();
156  double exch120_k11u_2();
157  double exch102_k11u_2();
158  double exch120_k11u_3();
159  double exch102_k11u_3();
160  double exch120_k11u_4();
161  double exch102_k11u_4();
162  double exch120_k11u_5();
163  double exch102_k11u_5();
164  double exch120_k11u_6();
165  double exch102_k11u_6();
166 
167  double ind220();
168  double ind202();
169  double ind220_1(int, const char *, const char *, const char *, int,
170  const char *, double **, double **, double **, int, int, int, double *);
171  double ind220_2(int, const char *, double **, double **, double **, int,
172  int, int);
173  double ind220_3(int, const char *, const char *, double **, double **,
174  int, int, int);
175  double ind220_4(int, const char *, int, const char *, double **, int,
176  int, int);
177  double ind220_5(int, const char *, double **, int, int, int, double *);
178  double ind220_6(int, const char *, const char *, const char *, int,
179  const char *, double **, int, int, int);
180  double ind220_7(int, const char *, const char *, const char *, int,
181  const char *, int, const char *, const char *, const char *, double **,
182  int, int, int, int, int, int);
183 
184 public:
187  std::shared_ptr<PSIO>psio);
188  virtual ~SAPT2();
189 
190  virtual double compute_energy();
191 
192  virtual void amplitudes();
193 
194  void elst10();
195  void exch10_s2();
196  void exch10();
197  void ind20r();
198  void exch_ind20r();
199  void disp20();
200  void exch_disp20();
201  void elst12();
202  void exch11();
203  void exch12();
204  void ind22();
205 
206 };
207 
208 }}
209 
210 #endif
Definition: sapt2.h:35
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: sapt2.cc:126
int * index2i_
Definition: sapt2.h:53
void exch_ind20rA_B()
Definition: exch-ind20.cc:713
double * no_evalsA_
Definition: sapt2.h:44
double ind220_1(int, const char *, const char *, const char *, int, const char *, double **, double **, double **, int, int, int, double *)
Definition: ind22.cc:157
void elst10()
Definition: elst10.cc:43
SAPT2(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO >psio)
Definition: sapt2.cc:37
void exch12()
Definition: exch12.cc:32
double e_exch12_
Definition: sapt2.h:70
double ** get_DF_ints(int, const char *, int, int, int, int)
Definition: utils.cc:1348
double ** get_AA_ints(const int, int=0, int=0)
Definition: utils.cc:1093
Options & options() const
Definition: wavefunction.cc:400
double ** get_BB_ints(const int, int=0, int=0)
Definition: utils.cc:1136
double exch120_k11u_1()
Definition: exch12.cc:400
double ** get_diag_BB_ints(const int)
Definition: utils.cc:1158
double e_exch10_
Definition: sapt2.h:67
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:395
void Y2_1(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:259
bool nat_orbs_t3_
Definition: sapt2.h:60
double exch102_k2f()
Definition: exch12.cc:277
double ** get_RB_ints(const int, int=0)
Definition: utils.cc:1319
double exch120_k11u_4()
Definition: exch12.cc:1393
double ind220_2(int, const char *, double **, double **, double **, int, int, int)
Definition: ind22.cc:230
size_t no_nvirB_
Definition: sapt2.h:42
void ijkl_to_ikjl(double *, int, int, int, int)
Definition: amplitudes.cc:616
double e_elst10_
Definition: sapt2.h:65
double e_exch_ind20_
Definition: sapt2.h:73
double ** wBAA_
Definition: sapt2.h:81
double exch120_k11u_5()
Definition: exch12.cc:1573
double ** get_diag_AA_ints(const int)
Definition: utils.cc:1115
double e_disp20_
Definition: sapt2.h:75
double ** no_CB_
Definition: sapt2.h:48
double exch120_k11u_3()
Definition: exch12.cc:1120
void disp20()
Definition: disp20.cc:124
double e_exch11_
Definition: sapt2.h:69
int maxiter_
Definition: sapt2.h:56
double ** get_AS_ints(const int, int=0)
Definition: utils.cc:1290
void natural_orbitalify(int, const char *, double *evals, int, int, int, const char)
Definition: sapt2.cc:997
double ** get_BS_ints(const int, int=0)
Definition: utils.cc:1226
int * index2j_
Definition: sapt2.h:54
double ind220_4(int, const char *, int, const char *, double **, int, int, int)
Definition: ind22.cc:298
double elst120(double **, double **, double **, int, const char *, const char *, const char *, int, int, int)
Definition: elst12.cc:58
bool nat_orbs_v4_
Definition: sapt2.h:62
double ** wABS_
Definition: sapt2.h:86
int * ioff_
Definition: sapt2.h:52
void theta(int, const char *, const char, bool, int, int, int, int, const char *, int, const char *)
Definition: amplitudes.cc:177
double ** get_RR_ints(const int)
Definition: utils.cc:1244
double exch102_k11u_2()
Definition: exch12.cc:939
double e_elst12_
Definition: sapt2.h:66
double e_exch_disp20_
Definition: sapt2.h:77
void pOOpVV(int, const char *, const char *, int, int, int, const char *, const char *)
Definition: amplitudes.cc:145
void exch11()
Definition: exch11.cc:32
void natural_orbitalify_df_ints()
Definition: sapt2.cc:1083
double exch102_k11u_6()
Definition: exch12.cc:1881
double ind220_5(int, const char *, double **, int, int, int, double *)
Definition: ind22.cc:343
void exch_ind20rB_A()
Definition: exch-ind20.cc:997
void OVOpVp_to_OVpOpV(double *, int, int)
Definition: amplitudes.cc:598
double exch102_k11u_3()
Definition: exch12.cc:1251
double ** wBAR_
Definition: sapt2.h:82
void antisym(double *, int, int)
Definition: utils.cc:1403
void Y2_2(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:294
double ** get_DF_ints_nongimp(int, const char *, int, int, int, int)
Definition: utils.cc:1380
double exch120_k11u_2()
Definition: exch12.cc:770
double ** get_SS_ints(const int)
Definition: utils.cc:1267
void Y2_3(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:329
double d_conv_
Definition: sapt2.h:58
virtual void amplitudes()
Definition: amplitudes.cc:34
void tOVOV(int, const char *, int, int, int, double *, int, const char *, int, int, int, double *, int, const char *)
Definition: amplitudes.cc:115
double ** get_AB_ints(const int, int=0, int=0)
Definition: utils.cc:1179
double exch102_k11u_1()
Definition: exch12.cc:587
void Y2(int, const char *, const char *, const char *, int, const char *, const char *, const char *, int, int, int, double *, int, const char *, const char *)
Definition: amplitudes.cc:226
void exch_ind20r()
Definition: exch-ind20.cc:684
double * no_evalsB_
Definition: sapt2.h:45
Definition: sapt.h:56
virtual void print_header()
Definition: sapt2.cc:178
double e_exch_ind22_
Definition: sapt2.h:74
double ** get_AR_ints(const int, int=0)
Definition: utils.cc:1208
double e_no_disp20_
Definition: sapt2.h:76
Definition: liboptions.h:359
size_t no_nvirA_
Definition: sapt2.h:41
double exch102_k11u_5()
Definition: exch12.cc:1661
void exch10_s2()
Definition: exch10.cc:441
virtual ~SAPT2()
Definition: sapt2.cc:99
double e_ind22_
Definition: sapt2.h:72
double ** wASS_
Definition: sapt2.h:87
void exch_disp20()
Definition: exch-disp20.cc:1739
double exch110(int, const char *)
Definition: exch11.cc:57
double exch120_k11u_6()
Definition: exch12.cc:1749
double exch111()
Definition: exch12.cc:102
void df_integrals()
Definition: sapt2.cc:443
void t2OVOV(int, const char *, const char *, int, const char *, const char *, const char *, int, int, int, double *, int, const char *)
Definition: amplitudes.cc:355
double ** no_CA_
Definition: sapt2.h:47
void ind22()
Definition: ind22.cc:34
bool nat_orbs_t2_
Definition: sapt2.h:61
void symmetrize(double *, int, int)
Definition: amplitudes.cc:638
double e_sapt2_
Definition: sapt2.h:79
double ind220()
Definition: ind22.cc:59
void ind20r()
Definition: ind20.cc:980
double e_ind20_
Definition: sapt2.h:71
double exch101(int, const char *)
Definition: exch11.cc:132
double exch102_k11u_4()
Definition: exch12.cc:1484
void w_integrals()
Definition: sapt2.cc:899
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:43
virtual void print_results()
Definition: sapt2.cc:234
double exch120_k2f()
Definition: exch12.cc:161
double e_conv_
Definition: sapt2.h:57
double ** wBRR_
Definition: sapt2.h:83
double ind220_3(int, const char *, const char *, double **, double **, int, int, int)
Definition: ind22.cc:259
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
double occ_cutoff_
Definition: sapt2.h:63
double ind220_7(int, const char *, const char *, const char *, int, const char *, int, const char *, const char *, const char *, double **, int, int, int, int, int, int)
Definition: ind22.cc:436
double ind220_6(int, const char *, const char *, const char *, int, const char *, double **, int, int, int)
Definition: ind22.cc:379
double e_exch10_s2_
Definition: sapt2.h:68
void cphf_solver(double **, double **, double *, int, const char *, const char *, const char *, int, int)
Definition: ind20.cc:1007
void elst12()
Definition: elst12.cc:32
double ind202()
Definition: ind22.cc:108
void exch10()
Definition: exch10.cc:554
double ** wABB_
Definition: sapt2.h:85
double e_sapt0_
Definition: sapt2.h:78