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-2018 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 *, int, int);
109  void antisym(double **, int, int);
110 
111  void cphf_solver(double **, double **, double *, int, const char *, 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 *, int, int, int, double *, int,
117  const char *);
118  void pOOpVV(int, const char *, const char *, int, int, int, const char *, const char *);
119  void theta(int, const char *, const char, bool, int, int, int, int, const char *, int, const char *);
120 
121  void Y2(int, const char *, const char *, const char *, int, const char *, const char *, const char *, int, int, int,
122  double *, int, const char *, const char *);
123  void Y2_1(double **, int, const char *, const char *, int, const char *, int, int, int);
124  void Y2_2(double **, int, const char *, const char *, int, const char *, int, int, int);
125  void Y2_3(double **, int, const char *, const char *, int, const char *, int, int, int);
126 
127  void t2OVOV(int, const char *, const char *, int, const char *, const char *, const char *, int, int, int, double *,
128  int, const char *);
129  void t2OVOV(int, const char *, const char *, const char *, int, const char *, const char *, const char *,
130  const char *, int, int, int, int, double *, double **, int, const char *);
131 
132  void OVOpVp_to_OVpOpV(double *, int, int);
133  void ijkl_to_ikjl(double *, int, int, int, int);
134  void symmetrize(double *, int, int);
135 
136  void natural_orbitalify(int, const char *, double *evals, int, int, int, const char);
138 
139  double elst120(double **, double **, double **, int, const char *, const char *, const char *, int, int, int);
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  int, int, int, double *);
163  double ind220_2(int, const char *, double **, double **, double **, int, int, int);
164  double ind220_3(int, const char *, const char *, double **, double **, int, int, int);
165  double ind220_4(int, const char *, int, const char *, double **, int, int, int);
166  double ind220_5(int, const char *, double **, int, int, int, double *);
167  double ind220_6(int, const char *, const char *, const char *, int, const char *, double **, int, int, int);
168  double ind220_7(int, const char *, const char *, const char *, int, const char *, int, const char *, const char *,
169  const char *, double **, int, int, int, int, int, int);
170 
171  public:
173  std::shared_ptr<PSIO> psio);
174  virtual ~SAPT2();
175 
176  virtual double compute_energy();
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 }
193 }
194 
195 #endif
Definition: sapt2.h:37
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: sapt2.cc:126
int * index2i_
Definition: sapt2.h:55
void exch_ind20rA_B()
Definition: exch-ind20.cc:677
double * no_evalsA_
Definition: sapt2.h:46
double ind220_1(int, const char *, const char *, const char *, int, const char *, double **, double **, double **, int, int, int, double *)
Definition: ind22.cc:143
void elst10()
Definition: elst10.cc:43
void exch12()
Definition: exch12.cc:34
double e_exch12_
Definition: sapt2.h:72
double ** get_DF_ints(int, const char *, int, int, int, int)
Definition: utils.cc:1259
double ** get_AA_ints(const int, int=0, int=0)
Definition: utils.cc:1025
Options & options() const
Definition: wavefunction.cc:572
double ** get_BB_ints(const int, int=0, int=0)
Definition: utils.cc:1065
double exch120_k11u_1()
Definition: exch12.cc:375
double ** get_diag_BB_ints(const int)
Definition: utils.cc:1085
double e_exch10_
Definition: sapt2.h:69
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:570
void Y2_1(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:227
bool nat_orbs_t3_
Definition: sapt2.h:62
double exch102_k2f()
Definition: exch12.cc:260
double ** get_RB_ints(const int, int=0)
Definition: utils.cc:1233
double exch120_k11u_4()
Definition: exch12.cc:1311
double ind220_2(int, const char *, double **, double **, double **, int, int, int)
Definition: ind22.cc:212
size_t no_nvirB_
Definition: sapt2.h:44
void ijkl_to_ikjl(double *, int, int, int, int)
Definition: amplitudes.cc:571
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:1483
double ** get_diag_AA_ints(const int)
Definition: utils.cc:1045
double e_disp20_
Definition: sapt2.h:77
double ** no_CB_
Definition: sapt2.h:50
double exch120_k11u_3()
Definition: exch12.cc:1034
void disp20()
Definition: disp20.cc:116
double e_exch11_
Definition: sapt2.h:71
int maxiter_
Definition: sapt2.h:58
double ** get_AS_ints(const int, int=0)
Definition: utils.cc:1207
void natural_orbitalify(int, const char *, double *evals, int, int, int, const char)
Definition: sapt2.cc:902
double ** get_BS_ints(const int, int=0)
Definition: utils.cc:1147
int * index2j_
Definition: sapt2.h:56
double ind220_4(int, const char *, int, const char *, double **, int, int, int)
Definition: ind22.cc:270
double elst120(double **, double **, double **, int, const char *, const char *, const char *, int, int, int)
Definition: elst12.cc:56
bool nat_orbs_v4_
Definition: sapt2.h:64
double ** wABS_
Definition: sapt2.h:88
int * ioff_
Definition: sapt2.h:54
void theta(int, const char *, const char, bool, int, int, int, int, const char *, int, const char *)
Definition: amplitudes.cc:157
double ** get_RR_ints(const int)
Definition: utils.cc:1163
double exch102_k11u_2()
Definition: exch12.cc:869
double e_elst12_
Definition: sapt2.h:68
double e_exch_disp20_
Definition: sapt2.h:79
void pOOpVV(int, const char *, const char *, int, int, int, const char *, const char *)
Definition: amplitudes.cc:130
void exch11()
Definition: exch11.cc:34
void natural_orbitalify_df_ints()
Definition: sapt2.cc:982
double exch102_k11u_6()
Definition: exch12.cc:1781
double ind220_5(int, const char *, double **, int, int, int, double *)
Definition: ind22.cc:310
void exch_ind20rB_A()
Definition: exch-ind20.cc:909
void OVOpVp_to_OVpOpV(double *, int, int)
Definition: amplitudes.cc:551
double exch102_k11u_3()
Definition: exch12.cc:1166
double ** wBAR_
Definition: sapt2.h:84
void antisym(double *, int, int)
Definition: utils.cc:1304
void Y2_2(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:259
double ** get_DF_ints_nongimp(int, const char *, int, int, int, int)
Definition: utils.cc:1283
double exch120_k11u_2()
Definition: exch12.cc:716
double ** get_SS_ints(const int)
Definition: utils.cc:1185
void Y2_3(double **, int, const char *, const char *, int, const char *, int, int, int)
Definition: amplitudes.cc:291
double d_conv_
Definition: sapt2.h:60
virtual void amplitudes()
Definition: amplitudes.cc:36
void tOVOV(int, const char *, int, int, int, double *, int, const char *, int, int, int, double *, int, const char *)
Definition: amplitudes.cc:100
double ** get_AB_ints(const int, int=0, int=0)
Definition: utils.cc:1105
double exch102_k11u_1()
Definition: exch12.cc:548
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:197
void exch_ind20r()
Definition: exch-ind20.cc:652
double * no_evalsB_
Definition: sapt2.h:47
Definition: sapt.h:58
virtual void print_header()
Definition: sapt2.cc:177
double e_exch_ind22_
Definition: sapt2.h:76
double ** get_AR_ints(const int, int=0)
Definition: utils.cc:1131
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:1568
void exch10_s2()
Definition: exch10.cc:440
virtual ~SAPT2()
Definition: sapt2.cc:100
double e_ind22_
Definition: sapt2.h:74
double ** wASS_
Definition: sapt2.h:89
void exch_disp20()
Definition: exch-disp20.cc:1602
SAPT2(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO > psio)
Definition: sapt2.cc:39
double exch110(int, const char *)
Definition: exch11.cc:54
double exch120_k11u_6()
Definition: exch12.cc:1653
double exch111()
Definition: exch12.cc:95
void df_integrals()
Definition: sapt2.cc:376
void t2OVOV(int, const char *, const char *, int, const char *, const char *, const char *, int, int, int, double *, int, const char *)
Definition: amplitudes.cc:314
double ** no_CA_
Definition: sapt2.h:49
void ind22()
Definition: ind22.cc:34
bool nat_orbs_t2_
Definition: sapt2.h:63
void symmetrize(double *, int, int)
Definition: amplitudes.cc:593
double e_sapt2_
Definition: sapt2.h:81
double ind220()
Definition: ind22.cc:55
void ind20r()
Definition: ind20.cc:939
double e_ind20_
Definition: sapt2.h:73
double exch101(int, const char *)
Definition: exch11.cc:123
double exch102_k11u_4()
Definition: exch12.cc:1398
void w_integrals()
Definition: sapt2.cc:811
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:48
virtual void print_results()
Definition: sapt2.cc:226
double exch120_k2f()
Definition: exch12.cc:151
double e_conv_
Definition: sapt2.h:59
double ** wBRR_
Definition: sapt2.h:85
double ind220_3(int, const char *, const char *, double **, double **, int, int, int)
Definition: ind22.cc:237
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
double occ_cutoff_
Definition: sapt2.h:65
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:395
double ind220_6(int, const char *, const char *, const char *, int, const char *, double **, int, int, int)
Definition: ind22.cc:343
double e_exch10_s2_
Definition: sapt2.h:70
void cphf_solver(double **, double **, double *, int, const char *, const char *, const char *, int, int)
Definition: ind20.cc:964
void elst12()
Definition: elst12.cc:34
double ind202()
Definition: ind22.cc:99
void exch10()
Definition: exch10.cc:544
double ** wABB_
Definition: sapt2.h:87
double e_sapt0_
Definition: sapt2.h:80