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 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 SAPT2p_H
30 #define SAPT2p_H
31 
32 #include "sapt2.h"
33 
34 namespace psi { namespace sapt {
35 
36 class SAPT2p : public SAPT2 {
37 private:
38  virtual void print_header();
39  virtual void print_results();
40 
41 protected:
42  double e_disp21_;
43  double e_disp22sdq_;
44  double e_disp22t_;
46  double e_sapt2p_;
47 
48 
49  void gARARxtARBS(int, const char *, const char, int, const char *,
50  const char *, const char *, int, int, int, int, int, int, int,
51  const char *);
52 
53  double disp21_1(int, const char *, const char *, int, int, int, int);
54  double disp21_2(int, const char *, const char *, int, int);
55 
56  double disp211();
57  double disp220s(int, const char *, const char *, int, const char *,
58  const char *, int, int, int);
59  double disp220d_1(int, const char *, const char *, int, const char *,
60  int, int, int);
61  double disp220d_2(int, const char *, const char *, int, const char *,
62  int, int, int, int, int, int, double *, double *, const char);
63  double disp220q_1(int, const char *, const char *, const char *, int, int);
64  double disp220q_2(int, const char *, const char *, const char *, int,
65  const char *, int, int, int);
66  double disp220q_3(int, const char *, const char *, const char, int,
67  const char *, int, int, int, int, int, int);
68  double disp220q_4(int, const char *, const char *, const char, int,
69  const char *, int, int, int, int, int, int);
70 
71  double disp220t(int, const char *, const char *, const char *, int,
72  const char *, int, const char *, int, int, int, int, int, int, double *,
73  double *);
74 
75  // CCD Dispersion Values
76  double e_disp2d_ccd_;
80  double e_sapt2p_ccd_;
81 
82  // CCD Dispersion Parameters
83  bool ccd_disp_;
87  double ccd_e_conv_;
88  double ccd_t_conv_;
89 
90  // Do MBPT and CCD dispersion?
91  bool mbpt_disp_;
92 
93  // CCD Dispersion Methods
94  void r_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
95  const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *,
96  const char *, int, const char *, int, const char *, double *, double *, int, int, int,
97  int, int, int);
98  double r_ccd_energy(const char *, const char *, int, int, int, int);
99  double r_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *,
100  const char *, const char *, const char *, const char *, const char *, const char *, double *, double *,
101  int, int, int, int, int, int);
102  double r_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
103  const char *, const char *, const char *, const char *, const char *, double *, double *, int, int,
104  int, int, int, int);
105 
106  void s_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
107  double *, int, int, int, int, int, int);
108  double s_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *,
109  const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *,
110  double *, int, int, int, std::shared_ptr<Matrix>);
111  double s_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
112  const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *,
113  double *, int, int, int, std::shared_ptr<Matrix>);
114 
115  void ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
116  const char *, const char *, int, const char *, const char *, const char *, double *, int, int, int,
117  std::shared_ptr<Matrix>, const char *);
118  double ccd_energy(const char *, const char *, int, int);
119  void ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
120  const char *, const char *, const char *, double *, int, int, int, std::shared_ptr<Matrix>);
121  double ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
122  const char *, const char *, const char *, const char *, double *, int, int, int, std::shared_ptr<Matrix>);
123 
124  void vvvv_prep(const char*, const char*, double**, int, int, std::shared_ptr<Matrix>);
125  double **vvvv_ccd(const char *, const char *, const char *, int, int, std::shared_ptr<Matrix>);
126  std::shared_ptr<Matrix> mo2no(int ampfile, const char* VV_opdm, int nvir, double cutoff);
127 
128  double **read_IJKL(int, char *, int, int);
129  void write_IJKL(double **, int, const char *, int, int);
130 
131  // CCD (S)
132  void disp_s_prep(const char *, const char *, const char *, const char *, int, const char *, const char *,
133  const char *, int, const char *, double *, int, int, int, int, int, int);
134 
135  // CCD (T)
136  void natural_orbitalify_ccd();
137  double disp220tccd(int, const char *, int, const char *, const char *, int, const char *, int, const char *,
138  const char *, double *, double *, int, int, int, int, int, int);
139 
140 public:
143  std::shared_ptr<PSIO>psio);
144  virtual ~SAPT2p();
145 
146  virtual double compute_energy();
147 
148  virtual void amplitudes();
149 
150  // PT Dispersion
151 
152  void disp21();
153  void disp22sdq();
154  void disp22t();
155 
156  // CCD Dispersion
157 
158  void disp2ccd();
159  void disp22tccd();
160 
161 };
162 
166 class SAPTDIIS {
167 
168 private:
169  int filenum_;
170  const char *vec_label_;
171  const char *err_label_;
173 
175  size_t vec_length_;
176 
179 
180  char *get_err_label(int);
181  char *get_vec_label(int);
182 
183 protected:
184  std::shared_ptr<PSIO> psio_;
185 
186 public:
187  SAPTDIIS(int, const char *, const char *, size_t, int, std::shared_ptr<PSIO>);
188  ~SAPTDIIS();
189 
190  void store_vectors();
191  void get_new_vector();
192 };
193 
194 }}
195 
196 #endif
Definition: sapt2.h:36
double e_sapt2p_ccd_
Definition: sapt2p.h:80
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:759
double ** read_IJKL(int, char *, int, int)
Definition: disp2ccd.cc:2015
Options & options() const
Definition: wavefunction.cc:412
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:379
bool mbpt_disp_
Definition: sapt2p.h:91
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:407
double e_est_disp22t_ccd_
Definition: sapt2p.h:79
size_t vec_length_
Definition: sapt2p.h:175
double disp220q_3(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int)
Definition: disp22sdq.cc:426
double ** vvvv_ccd(const char *, const char *, const char *, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1234
virtual ~SAPT2p()
Definition: sapt2p.cc:63
double disp220q_1(int, const char *, const char *, const char *, int, int)
Definition: disp22sdq.cc:338
int max_diis_vecs_
Definition: sapt2p.h:172
void vvvv_prep(const char *, const char *, double **, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1162
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:409
double disp220q_2(int, const char *, const char *, const char *, int, const char *, int, int, int)
Definition: disp22sdq.cc:377
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:220
virtual void amplitudes()
Definition: amplitudes.cc:649
int diis_file_
Definition: sapt2p.h:174
double disp211()
Definition: disp22sdq.cc:127
void write_IJKL(double **, int, const char *, int, int)
Definition: disp2ccd.cc:2026
void natural_orbitalify_ccd()
Definition: disp22t.cc:174
Definition: sapt2p.h:36
~SAPTDIIS()
Definition: disp2ccd.cc:2051
double disp21_2(int, const char *, const char *, int, int)
Definition: disp21.cc:88
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:276
double e_disp22sdq_
Definition: sapt2p.h:43
double e_disp22t_ccd_
Definition: sapt2p.h:78
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:703
int filenum_
Definition: sapt2p.h:169
double ccd_t_conv_
Definition: sapt2p.h:88
double r_ccd_energy(const char *, const char *, int, int, int, int)
Definition: disp2ccd.cc:389
void store_vectors()
Definition: disp2ccd.cc:2056
double ccd_e_conv_
Definition: sapt2p.h:87
char * get_vec_label(int)
Definition: disp2ccd.cc:2148
int max_ccd_vecs_
Definition: sapt2p.h:86
double disp220d_1(int, const char *, const char *, int, const char *, int, int, int)
Definition: disp22sdq.cc:229
double disp220d_2(int, const char *, const char *, int, const char *, int, int, int, int, int, int, double *, double *, const char)
Definition: disp22sdq.cc:268
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:1653
SAPTDIIS(int, const char *, const char *, size_t, int, std::shared_ptr< PSIO >)
Definition: disp2ccd.cc:2035
const char * err_label_
Definition: sapt2p.h:171
void disp22t()
Definition: disp22t.cc:33
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:589
double e_sapt2p_
Definition: sapt2p.h:46
virtual void print_header()
Definition: sapt2p.cc:147
Definition: liboptions.h:355
SAPT2p(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO >psio)
Definition: sapt2p.cc:36
int num_vecs_
Definition: sapt2p.h:178
void get_new_vector()
Definition: disp2ccd.cc:2081
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:1725
const char * vec_label_
Definition: sapt2p.h:170
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:1432
double e_disp22s_ccd_
Definition: sapt2p.h:77
std::shared_ptr< PSIO > psio_
Definition: sapt2p.h:184
virtual void print_results()
Definition: sapt2p.cc:210
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: sapt2p.cc:70
double disp21_1(int, const char *, const char *, int, int, int, int)
Definition: disp21.cc:63
Definition: sapt2p.h:166
std::shared_ptr< Matrix > mo2no(int ampfile, const char *VV_opdm, int nvir, double cutoff)
Definition: disp2ccd.cc:2155
int ccd_maxiter_
Definition: sapt2p.h:84
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:48
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:466
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:737
double disp220s(int, const char *, const char *, int, const char *, const char *, int, int, int)
Definition: disp22sdq.cc:188
void disp21()
Definition: disp21.cc:33
double ccd_energy(const char *, const char *, int, int)
Definition: disp2ccd.cc:1706
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:1096
int min_ccd_vecs_
Definition: sapt2p.h:85
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
void disp22tccd()
Definition: disp22t.cc:101
double e_est_disp22t_
Definition: sapt2p.h:45
char * get_err_label(int)
Definition: disp2ccd.cc:2141
double e_disp21_
Definition: sapt2p.h:42
void disp22sdq()
Definition: disp22sdq.cc:33
double e_disp22t_
Definition: sapt2p.h:44
bool ccd_disp_
Definition: sapt2p.h:83
double e_disp2d_ccd_
Definition: sapt2p.h:76
int curr_vec_
Definition: sapt2p.h:177
void disp2ccd()
Definition: disp2ccd.cc:38
double disp220q_4(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int)
Definition: disp22sdq.cc:491