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 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 { namespace sapt {
35 
36 class SAPT2 : public SAPT {
37 private:
38  virtual void print_header();
39  virtual void print_results();
40 
41 protected:
42  size_t no_nvirA_;
43  size_t no_nvirB_;
44 
45  double *no_evalsA_;
46  double *no_evalsB_;
47 
48  double **no_CA_;
49  double **no_CB_;
50 
51 // These ints should not overflow below 46000 basis functions
52 // They contain indices up to nso_ * (nso_ + 1) / 2
53  int *ioff_;
54  int *index2i_;
55  int *index2j_;
56 
57  int maxiter_;
58  double e_conv_;
59  double d_conv_;
60 
64  double occ_cutoff_;
65 
66  double e_elst10_;
67  double e_elst12_;
68  double e_exch10_;
69  double e_exch10_s2_;
70  double e_exch11_;
71  double e_exch12_;
72  double e_ind20_;
73  double e_ind22_;
74  double e_exch_ind20_;
75  double e_exch_ind22_;
76  double e_disp20_;
77  double e_no_disp20_;
79  double e_sapt0_;
80  double e_sapt2_;
81 
82  double **wBAA_;
83  double **wBAR_;
84  double **wBRR_;
85 
86  double **wABB_;
87  double **wABS_;
88  double **wASS_;
89 
90  double** get_AA_ints(const int, int=0, int=0);
91  double** get_diag_AA_ints(const int);
92  double** get_AR_ints(const int, int=0);
93  double** get_RR_ints(const int);
94  double** get_BB_ints(const int, int=0, int=0);
95  double** get_diag_BB_ints(const int);
96  double** get_BS_ints(const int, int=0);
97  double** get_SS_ints(const int);
98  double** get_AB_ints(const int, int=0, int=0);
99  double** get_AS_ints(const int, int=0);
100  double** get_RB_ints(const int, int=0);
101 
102  void df_integrals();
103  void w_integrals();
104 
105  double **get_DF_ints(int, const char *, int, int, int, int);
106  double **get_DF_ints_nongimp(int, const char *, int, int, int, int);
107  void antisym(double *, int, int);
108  void antisym(double **, int, int);
109 
110  void cphf_solver(double**, double **, double *, int, const char *,
111  const char *, const char *, int, int);
112 
113  void exch_ind20rA_B();
114  void exch_ind20rB_A();
115 
116  void tOVOV(int, const char *, int, int, int, double *, int, const char *,
117  int, int, int, double *, int, const char *);
118  void pOOpVV(int, const char *, const char *, int, int, int, const char *,
119  const char *);
120  void theta(int, const char *, const char, bool, int, int, int, int,
121  const char *, int, const char *);
122 
123  void Y2(int, const char *, const char *, const char *, int, const char *,
124  const char *, const char *, int, int, int, double *, int, const char *,
125  const char *);
126  void Y2_1(double **, int, const char *, const char *, int, const char *,
127  int, int, int);
128  void Y2_2(double **, int, const char *, const char *, int, const char *,
129  int, int, int);
130  void Y2_3(double **, int, const char *, const char *, int, const char *,
131  int, int, int);
132 
133  void t2OVOV(int, const char *, const char *, int, const char *,
134  const char *, const char *, int, int, int, double *, int, const char *);
135  void t2OVOV(int, const char *, const char *, const char *, int,
136  const char *, const char *, const char *, const char *, int, int, int,
137  int, double *, double **, int, const char *);
138 
139  void OVOpVp_to_OVpOpV(double *, int, int);
140  void ijkl_to_ikjl(double *, int, int, int, int);
141  void symmetrize(double *, int, int);
142 
143  void natural_orbitalify(int, const char *, double *evals, int, int, int,
144  const char);
146 
147  double elst120(double **, double **, double **, int, const char *,
148  const char *, const char *, int, int, int);
149 
150  double exch110(int, const char *);
151  double exch101(int, const char *);
152  double exch111();
153  double exch120_k2f();
154  double exch102_k2f();
155  double exch120_k11u_1();
156  double exch102_k11u_1();
157  double exch120_k11u_2();
158  double exch102_k11u_2();
159  double exch120_k11u_3();
160  double exch102_k11u_3();
161  double exch120_k11u_4();
162  double exch102_k11u_4();
163  double exch120_k11u_5();
164  double exch102_k11u_5();
165  double exch120_k11u_6();
166  double exch102_k11u_6();
167 
168  double ind220();
169  double ind202();
170  double ind220_1(int, const char *, const char *, const char *, int,
171  const char *, double **, double **, double **, int, int, int, double *);
172  double ind220_2(int, const char *, double **, double **, double **, int,
173  int, int);
174  double ind220_3(int, const char *, const char *, double **, double **,
175  int, int, int);
176  double ind220_4(int, const char *, int, const char *, double **, int,
177  int, int);
178  double ind220_5(int, const char *, double **, int, int, int, double *);
179  double ind220_6(int, const char *, const char *, const char *, int,
180  const char *, double **, int, int, int);
181  double ind220_7(int, const char *, const char *, const char *, int,
182  const char *, int, const char *, const char *, const char *, double **,
183  int, int, int, int, int, int);
184 
185 public:
188  std::shared_ptr<PSIO>psio);
189  virtual ~SAPT2();
190 
191  virtual double compute_energy();
192 
193  virtual void amplitudes();
194 
195  void elst10();
196  void exch10_s2();
197  void exch10();
198  void ind20r();
199  void exch_ind20r();
200  void disp20();
201  void exch_disp20();
202  void elst12();
203  void exch11();
204  void exch12();
205  void ind22();
206 
207 };
208 
209 }}
210 
211 #endif
Definition: sapt2.h:36
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: sapt2.cc:127
int * index2i_
Definition: sapt2.h:54
void exch_ind20rA_B()
Definition: exch-ind20.cc:714
double * no_evalsA_
Definition: sapt2.h:45
double ind220_1(int, const char *, const char *, const char *, int, const char *, double **, double **, double **, int, int, int, double *)
Definition: ind22.cc:158
void elst10()
Definition: elst10.cc:44
SAPT2(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO >psio)
Definition: sapt2.cc:38
void exch12()
Definition: exch12.cc:33
double e_exch12_
Definition: sapt2.h:71
double ** get_DF_ints(int, const char *, int, int, int, int)
Definition: utils.cc:1351
double ** get_AA_ints(const int, int=0, int=0)
Definition: utils.cc:1096
Options & options() const
Definition: wavefunction.cc:412
double ** get_BB_ints(const int, int=0, int=0)
Definition: utils.cc:1139
double exch120_k11u_1()
Definition: exch12.cc:401
double ** get_diag_BB_ints(const int)
Definition: utils.cc:1161
double e_exch10_
Definition: sapt2.h:68
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:407
void Y2_1(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:260
bool nat_orbs_t3_
Definition: sapt2.h:61
double exch102_k2f()
Definition: exch12.cc:278
double ** get_RB_ints(const int, int=0)
Definition: utils.cc:1322
double exch120_k11u_4()
Definition: exch12.cc:1394
double ind220_2(int, const char *, double **, double **, double **, int, int, int)
Definition: ind22.cc:231
size_t no_nvirB_
Definition: sapt2.h:43
void ijkl_to_ikjl(double *, int, int, int, int)
Definition: amplitudes.cc:617
double e_elst10_
Definition: sapt2.h:66
double e_exch_ind20_
Definition: sapt2.h:74
double ** wBAA_
Definition: sapt2.h:82
double exch120_k11u_5()
Definition: exch12.cc:1574
double ** get_diag_AA_ints(const int)
Definition: utils.cc:1118
double e_disp20_
Definition: sapt2.h:76
double ** no_CB_
Definition: sapt2.h:49
double exch120_k11u_3()
Definition: exch12.cc:1121
void disp20()
Definition: disp20.cc:125
double e_exch11_
Definition: sapt2.h:70
int maxiter_
Definition: sapt2.h:57
double ** get_AS_ints(const int, int=0)
Definition: utils.cc:1293
void natural_orbitalify(int, const char *, double *evals, int, int, int, const char)
Definition: sapt2.cc:998
double ** get_BS_ints(const int, int=0)
Definition: utils.cc:1229
int * index2j_
Definition: sapt2.h:55
double ind220_4(int, const char *, int, const char *, double **, int, int, int)
Definition: ind22.cc:299
double elst120(double **, double **, double **, int, const char *, const char *, const char *, int, int, int)
Definition: elst12.cc:59
bool nat_orbs_v4_
Definition: sapt2.h:63
double ** wABS_
Definition: sapt2.h:87
int * ioff_
Definition: sapt2.h:53
void theta(int, const char *, const char, bool, int, int, int, int, const char *, int, const char *)
Definition: amplitudes.cc:178
double ** get_RR_ints(const int)
Definition: utils.cc:1247
double exch102_k11u_2()
Definition: exch12.cc:940
double e_elst12_
Definition: sapt2.h:67
double e_exch_disp20_
Definition: sapt2.h:78
void pOOpVV(int, const char *, const char *, int, int, int, const char *, const char *)
Definition: amplitudes.cc:146
void exch11()
Definition: exch11.cc:33
void natural_orbitalify_df_ints()
Definition: sapt2.cc:1084
double exch102_k11u_6()
Definition: exch12.cc:1882
double ind220_5(int, const char *, double **, int, int, int, double *)
Definition: ind22.cc:344
void exch_ind20rB_A()
Definition: exch-ind20.cc:998
void OVOpVp_to_OVpOpV(double *, int, int)
Definition: amplitudes.cc:599
double exch102_k11u_3()
Definition: exch12.cc:1252
double ** wBAR_
Definition: sapt2.h:83
void antisym(double *, int, int)
Definition: utils.cc:1406
void Y2_2(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:295
double ** get_DF_ints_nongimp(int, const char *, int, int, int, int)
Definition: utils.cc:1383
double exch120_k11u_2()
Definition: exch12.cc:771
double ** get_SS_ints(const int)
Definition: utils.cc:1270
void Y2_3(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:330
double d_conv_
Definition: sapt2.h:59
virtual void amplitudes()
Definition: amplitudes.cc:35
void tOVOV(int, const char *, int, int, int, double *, int, const char *, int, int, int, double *, int, const char *)
Definition: amplitudes.cc:116
double ** get_AB_ints(const int, int=0, int=0)
Definition: utils.cc:1182
double exch102_k11u_1()
Definition: exch12.cc:588
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:227
void exch_ind20r()
Definition: exch-ind20.cc:685
double * no_evalsB_
Definition: sapt2.h:46
Definition: sapt.h:60
virtual void print_header()
Definition: sapt2.cc:179
double e_exch_ind22_
Definition: sapt2.h:75
double ** get_AR_ints(const int, int=0)
Definition: utils.cc:1211
double e_no_disp20_
Definition: sapt2.h:77
Definition: liboptions.h:355
size_t no_nvirA_
Definition: sapt2.h:42
double exch102_k11u_5()
Definition: exch12.cc:1662
void exch10_s2()
Definition: exch10.cc:442
virtual ~SAPT2()
Definition: sapt2.cc:100
double e_ind22_
Definition: sapt2.h:73
double ** wASS_
Definition: sapt2.h:88
void exch_disp20()
Definition: exch-disp20.cc:1740
double exch110(int, const char *)
Definition: exch11.cc:58
double exch120_k11u_6()
Definition: exch12.cc:1750
double exch111()
Definition: exch12.cc:103
void df_integrals()
Definition: sapt2.cc:444
void t2OVOV(int, const char *, const char *, int, const char *, const char *, const char *, int, int, int, double *, int, const char *)
Definition: amplitudes.cc:356
double ** no_CA_
Definition: sapt2.h:48
void ind22()
Definition: ind22.cc:35
bool nat_orbs_t2_
Definition: sapt2.h:62
void symmetrize(double *, int, int)
Definition: amplitudes.cc:639
double e_sapt2_
Definition: sapt2.h:80
double ind220()
Definition: ind22.cc:60
void ind20r()
Definition: ind20.cc:982
double e_ind20_
Definition: sapt2.h:72
double exch101(int, const char *)
Definition: exch11.cc:133
double exch102_k11u_4()
Definition: exch12.cc:1485
void w_integrals()
Definition: sapt2.cc:900
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:48
virtual void print_results()
Definition: sapt2.cc:235
double exch120_k2f()
Definition: exch12.cc:162
double e_conv_
Definition: sapt2.h:58
double ** wBRR_
Definition: sapt2.h:84
double ind220_3(int, const char *, const char *, double **, double **, int, int, int)
Definition: ind22.cc:260
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
double occ_cutoff_
Definition: sapt2.h:64
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:437
double ind220_6(int, const char *, const char *, const char *, int, const char *, double **, int, int, int)
Definition: ind22.cc:380
double e_exch10_s2_
Definition: sapt2.h:69
void cphf_solver(double **, double **, double *, int, const char *, const char *, const char *, int, int)
Definition: ind20.cc:1009
void elst12()
Definition: elst12.cc:33
double ind202()
Definition: ind22.cc:109
void exch10()
Definition: exch10.cc:555
double ** wABB_
Definition: sapt2.h:86
double e_sapt0_
Definition: sapt2.h:79