Psi4
sapt2p.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 SAPT2p_H
29 #define SAPT2p_H
30 
31 #include "sapt2.h"
32 
33 namespace psi { namespace sapt {
34 
35 class SAPT2p : public SAPT2 {
36 private:
37  virtual void print_header();
38  virtual void print_results();
39 
40 protected:
41  double e_disp21_;
42  double e_disp22sdq_;
43  double e_disp22t_;
45  double e_sapt2p_;
46 
47 
48  void gARARxtARBS(int, const char *, const char, int, const char *,
49  const char *, const char *, int, int, int, int, int, int, int,
50  const char *);
51 
52  double disp21_1(int, const char *, const char *, int, int, int, int);
53  double disp21_2(int, const char *, const char *, int, int);
54 
55  double disp211();
56  double disp220s(int, const char *, const char *, int, const char *,
57  const char *, int, int, int);
58  double disp220d_1(int, const char *, const char *, int, const char *,
59  int, int, int);
60  double disp220d_2(int, const char *, const char *, int, const char *,
61  int, int, int, int, int, int, double *, double *, const char);
62  double disp220q_1(int, const char *, const char *, const char *, int, int);
63  double disp220q_2(int, const char *, const char *, const char *, int,
64  const char *, int, int, int);
65  double disp220q_3(int, const char *, const char *, const char, int,
66  const char *, int, int, int, int, int, int);
67  double disp220q_4(int, const char *, const char *, const char, int,
68  const char *, int, int, int, int, int, int);
69 
70  double disp220t(int, const char *, const char *, const char *, int,
71  const char *, int, const char *, int, int, int, int, int, int, double *,
72  double *);
73 
74  // CCD Dispersion Values
75  double e_disp2d_ccd_;
79  double e_sapt2p_ccd_;
80 
81  // CCD Dispersion Parameters
82  bool ccd_disp_;
86  double ccd_e_conv_;
87  double ccd_t_conv_;
88 
89  // Do MBPT and CCD dispersion?
90  bool mbpt_disp_;
91 
92  // CCD Dispersion Methods
93  void r_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
94  const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *,
95  const char *, int, const char *, int, const char *, double *, double *, int, int, int,
96  int, int, int);
97  double r_ccd_energy(const char *, const char *, int, int, int, int);
98  double r_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *,
99  const char *, const char *, const char *, const char *, const char *, const char *, double *, double *,
100  int, int, int, int, int, int);
101  double r_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
102  const char *, const char *, const char *, const char *, const char *, double *, double *, int, int,
103  int, int, int, int);
104 
105  void s_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
106  double *, int, int, int, int, int, int);
107  double s_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *,
108  const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *,
109  double *, int, int, int, std::shared_ptr<Matrix>);
110  double s_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
111  const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *,
112  double *, int, int, int, std::shared_ptr<Matrix>);
113 
114  void ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
115  const char *, const char *, int, const char *, const char *, const char *, double *, int, int, int,
116  std::shared_ptr<Matrix>, const char *);
117  double ccd_energy(const char *, const char *, int, int);
118  void ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
119  const char *, const char *, const char *, double *, int, int, int, std::shared_ptr<Matrix>);
120  double ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
121  const char *, const char *, const char *, const char *, double *, int, int, int, std::shared_ptr<Matrix>);
122 
123  void vvvv_prep(const char*, const char*, double**, int, int, std::shared_ptr<Matrix>);
124  double **vvvv_ccd(const char *, const char *, const char *, int, int, std::shared_ptr<Matrix>);
125  std::shared_ptr<Matrix> mo2no(int ampfile, const char* VV_opdm, int nvir, double cutoff);
126 
127  double **read_IJKL(int, char *, int, int);
128  void write_IJKL(double **, int, const char *, int, int);
129 
130  // CCD (S)
131  void disp_s_prep(const char *, const char *, const char *, const char *, int, const char *, const char *,
132  const char *, int, const char *, double *, int, int, int, int, int, int);
133 
134  // CCD (T)
135  void natural_orbitalify_ccd();
136  double disp220tccd(int, const char *, int, const char *, const char *, int, const char *, int, const char *,
137  const char *, double *, double *, int, int, int, int, int, int);
138 
139 public:
142  std::shared_ptr<PSIO>psio);
143  virtual ~SAPT2p();
144 
145  virtual double compute_energy();
146 
147  virtual void amplitudes();
148 
149  // PT Dispersion
150 
151  void disp21();
152  void disp22sdq();
153  void disp22t();
154 
155  // CCD Dispersion
156 
157  void disp2ccd();
158  void disp22tccd();
159 
160 };
161 
165 class SAPTDIIS {
166 
167 private:
168  int filenum_;
169  const char *vec_label_;
170  const char *err_label_;
172 
174  size_t vec_length_;
175 
178 
179  char *get_err_label(int);
180  char *get_vec_label(int);
181 
182 protected:
183  std::shared_ptr<PSIO> psio_;
184 
185 public:
186  SAPTDIIS(int, const char *, const char *, size_t, int, std::shared_ptr<PSIO>);
187  ~SAPTDIIS();
188 
189  void store_vectors();
190  void get_new_vector();
191 };
192 
193 }}
194 
195 #endif
Definition: sapt2.h:35
double e_sapt2p_ccd_
Definition: sapt2p.h:79
double s_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, double *, int, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:756
double ** read_IJKL(int, char *, int, int)
Definition: disp2ccd.cc:2012
Options & options() const
Definition: wavefunction.cc:400
double disp220tccd(int, const char *, int, const char *, const char *, int, const char *, int, const char *, const char *, double *, double *, int, int, int, int, int, int)
Definition: disp22t.cc:378
bool mbpt_disp_
Definition: sapt2p.h:90
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:395
double e_est_disp22t_ccd_
Definition: sapt2p.h:78
size_t vec_length_
Definition: sapt2p.h:174
double disp220q_3(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int)
Definition: disp22sdq.cc:425
double ** vvvv_ccd(const char *, const char *, const char *, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1231
virtual ~SAPT2p()
Definition: sapt2p.cc:60
double disp220q_1(int, const char *, const char *, const char *, int, int)
Definition: disp22sdq.cc:337
int max_diis_vecs_
Definition: sapt2p.h:171
void vvvv_prep(const char *, const char *, double **, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1159
double r_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, double *, double *, int, int, int, int, int, int)
Definition: disp2ccd.cc:406
double disp220q_2(int, const char *, const char *, const char *, int, const char *, int, int, int)
Definition: disp22sdq.cc:376
void r_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, int, const char *, int, const char *, double *, double *, int, int, int, int, int, int)
Definition: disp2ccd.cc:217
virtual void amplitudes()
Definition: amplitudes.cc:648
int diis_file_
Definition: sapt2p.h:173
double disp211()
Definition: disp22sdq.cc:126
void write_IJKL(double **, int, const char *, int, int)
Definition: disp2ccd.cc:2023
void natural_orbitalify_ccd()
Definition: disp22t.cc:173
Definition: sapt2p.h:35
~SAPTDIIS()
Definition: disp2ccd.cc:2048
double disp21_2(int, const char *, const char *, int, int)
Definition: disp21.cc:87
double disp220t(int, const char *, const char *, const char *, int, const char *, int, const char *, int, int, int, int, int, int, double *, double *)
Definition: disp22t.cc:275
double e_disp22sdq_
Definition: sapt2p.h:42
double e_disp22t_ccd_
Definition: sapt2p.h:77
double s_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, double *, int, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:700
int filenum_
Definition: sapt2p.h:168
double ccd_t_conv_
Definition: sapt2p.h:87
double r_ccd_energy(const char *, const char *, int, int, int, int)
Definition: disp2ccd.cc:386
void store_vectors()
Definition: disp2ccd.cc:2053
double ccd_e_conv_
Definition: sapt2p.h:86
char * get_vec_label(int)
Definition: disp2ccd.cc:2145
int max_ccd_vecs_
Definition: sapt2p.h:85
double disp220d_1(int, const char *, const char *, int, const char *, int, int, int)
Definition: disp22sdq.cc:228
double disp220d_2(int, const char *, const char *, int, const char *, int, int, int, int, int, int, double *, double *, const char)
Definition: disp22sdq.cc:267
void ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, double *, int, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1650
SAPTDIIS(int, const char *, const char *, size_t, int, std::shared_ptr< PSIO >)
Definition: disp2ccd.cc:2032
const char * err_label_
Definition: sapt2p.h:170
void disp22t()
Definition: disp22t.cc:32
void s_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *, double *, int, int, int, int, int, int)
Definition: disp2ccd.cc:586
double e_sapt2p_
Definition: sapt2p.h:45
virtual void print_header()
Definition: sapt2p.cc:144
Definition: liboptions.h:359
SAPT2p(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO >psio)
Definition: sapt2p.cc:33
int num_vecs_
Definition: sapt2p.h:177
void get_new_vector()
Definition: disp2ccd.cc:2078
double ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, double *, int, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1722
const char * vec_label_
Definition: sapt2p.h:169
void ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, int, const char *, const char *, const char *, double *, int, int, int, std::shared_ptr< Matrix >, const char *)
Definition: disp2ccd.cc:1429
double e_disp22s_ccd_
Definition: sapt2p.h:76
std::shared_ptr< PSIO > psio_
Definition: sapt2p.h:183
virtual void print_results()
Definition: sapt2p.cc:207
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: sapt2p.cc:67
double disp21_1(int, const char *, const char *, int, int, int, int)
Definition: disp21.cc:62
Definition: sapt2p.h:165
std::shared_ptr< Matrix > mo2no(int ampfile, const char *VV_opdm, int nvir, double cutoff)
Definition: disp2ccd.cc:2152
int ccd_maxiter_
Definition: sapt2p.h:83
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:43
double r_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, double *, double *, int, int, int, int, int, int)
Definition: disp2ccd.cc:463
void gARARxtARBS(int, const char *, const char, int, const char *, const char *, const char *, int, int, int, int, int, int, int, const char *)
Definition: amplitudes.cc:736
double disp220s(int, const char *, const char *, int, const char *, const char *, int, int, int)
Definition: disp22sdq.cc:187
void disp21()
Definition: disp21.cc:32
double ccd_energy(const char *, const char *, int, int)
Definition: disp2ccd.cc:1703
void disp_s_prep(const char *, const char *, const char *, const char *, int, const char *, const char *, const char *, int, const char *, double *, int, int, int, int, int, int)
Definition: disp2ccd.cc:1093
int min_ccd_vecs_
Definition: sapt2p.h:84
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
void disp22tccd()
Definition: disp22t.cc:100
double e_est_disp22t_
Definition: sapt2p.h:44
char * get_err_label(int)
Definition: disp2ccd.cc:2138
double e_disp21_
Definition: sapt2p.h:41
void disp22sdq()
Definition: disp22sdq.cc:32
double e_disp22t_
Definition: sapt2p.h:43
bool ccd_disp_
Definition: sapt2p.h:82
double e_disp2d_ccd_
Definition: sapt2p.h:75
int curr_vec_
Definition: sapt2p.h:176
void disp2ccd()
Definition: disp2ccd.cc:35
double disp220q_4(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int)
Definition: disp22sdq.cc:490