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-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 SAPT2p_H
30 #define SAPT2p_H
31 
32 #include "sapt2.h"
33 
34 namespace psi {
35 namespace sapt {
36 
37 class SAPT2p : public SAPT2 {
38  private:
39  virtual void print_header();
40  virtual void print_results();
41 
42  protected:
43  double e_disp21_;
44  double e_disp22sdq_;
45  double e_disp22t_;
47  double e_sapt2p_;
48 
49  void gARARxtARBS(int, const char *, const char, int, const char *, const char *, const char *, int, int, int, int,
50  int, int, int, 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 *, const char *, int, int, int);
57  double disp220d_1(int, const char *, const char *, int, const char *, int, int, int);
58  double disp220d_2(int, const char *, const char *, int, const char *, int, int, int, int, int, int, double *,
59  double *, const char);
60  double disp220q_1(int, const char *, const char *, const char *, int, int);
61  double disp220q_2(int, const char *, const char *, const char *, int, const char *, int, int, int);
62  double disp220q_3(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int);
63  double disp220q_4(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int);
64 
65  double disp220t(int, const char *, const char *, const char *, int, const char *, int, const char *, int, int, int,
66  int, int, int, double *, double *);
67 
68  // CCD Dispersion Values
69  double e_disp2d_ccd_;
73  double e_sapt2p_ccd_;
74 
75  // CCD Dispersion Parameters
76  bool ccd_disp_;
80  double ccd_e_conv_;
81  double ccd_t_conv_;
82 
83  // Do MBPT and CCD dispersion?
84  bool mbpt_disp_;
85 
86  // CCD Dispersion Methods
87  void r_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
88  const char *, const char *, const char *, const char *, const char *, const char *, const char *,
89  const char *, const char *, const char *, int, const char *, int, const char *, double *, double *,
90  int, int, int, int, int, int);
91  double r_ccd_energy(const char *, const char *, int, int, int, int);
92  double r_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *,
93  const char *, const char *, const char *, const char *, const char *, const char *, double *,
94  double *, int, int, int, int, int, int);
95  double r_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
96  const char *, const char *, const char *, const char *, const char *, double *, double *,
97  int, int, int, int, int, int);
98 
99  void s_ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
100  double *, int, int, int, int, int, int);
101  double s_ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *,
102  const char *, const char *, const char *, const char *, const char *, const char *,
103  const char *, const char *, const char *, double *, int, int, int, std::shared_ptr<Matrix>);
104  double s_ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
105  const char *, const char *, const char *, const char *, const char *, const char *,
106  const char *, const char *, const char *, double *, int, int, int, std::shared_ptr<Matrix>);
107 
108  void ccd_prep(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
109  const char *, const char *, int, const char *, const char *, const char *, double *, int, int, int,
110  std::shared_ptr<Matrix>, const char *);
111  double ccd_energy(const char *, const char *, int, int);
112  void ccd_iterate(const char *, const char *, const char *, const char *, const char *, const char *, const char *,
113  const char *, const char *, const char *, double *, int, int, int, std::shared_ptr<Matrix>);
114  double ccd_amplitudes(const char *, const char *, const char *, const char *, const char *, const char *,
115  const char *, const char *, const char *, const char *, double *, int, int, int,
116  std::shared_ptr<Matrix>);
117 
118  void vvvv_prep(const char *, const char *, double **, int, int, std::shared_ptr<Matrix>);
119  double **vvvv_ccd(const char *, const char *, const char *, int, int, std::shared_ptr<Matrix>);
120  std::shared_ptr<Matrix> mo2no(int ampfile, const char *VV_opdm, int nvir, double cutoff);
121 
122  double **read_IJKL(int, char *, int, int);
123  void write_IJKL(double **, int, const char *, int, int);
124 
125  // CCD (S)
126  void disp_s_prep(const char *, const char *, const char *, const char *, int, const char *, const char *,
127  const char *, int, const char *, double *, int, int, int, int, int, int);
128 
129  // CCD (T)
130  void natural_orbitalify_ccd();
131  double disp220tccd(int, const char *, int, const char *, const char *, int, const char *, int, const char *,
132  const char *, double *, double *, int, int, int, int, int, int);
133 
134  public:
136  std::shared_ptr<PSIO> psio);
137  virtual ~SAPT2p();
138 
139  virtual double compute_energy();
140 
141  virtual void amplitudes();
142 
143  // PT Dispersion
144 
145  void disp21();
146  void disp22sdq();
147  void disp22t();
148 
149  // CCD Dispersion
150 
151  void disp2ccd();
152  void disp22tccd();
153 };
154 
158 class SAPTDIIS {
159  private:
160  int filenum_;
161  const char *vec_label_;
162  const char *err_label_;
164 
166  size_t vec_length_;
167 
170 
171  char *get_err_label(int);
172  char *get_vec_label(int);
173 
174  protected:
175  std::shared_ptr<PSIO> psio_;
176 
177  public:
178  SAPTDIIS(int, const char *, const char *, size_t, int, std::shared_ptr<PSIO>);
179  ~SAPTDIIS();
180 
181  void store_vectors();
182  void get_new_vector();
183 };
184 }
185 }
186 
187 #endif
Definition: sapt2.h:37
double e_sapt2p_ccd_
Definition: sapt2p.h:73
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:699
double ** read_IJKL(int, char *, int, int)
Definition: disp2ccd.cc:2002
Options & options() const
Definition: wavefunction.cc:572
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:348
bool mbpt_disp_
Definition: sapt2p.h:84
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:570
double e_est_disp22t_ccd_
Definition: sapt2p.h:72
size_t vec_length_
Definition: sapt2p.h:166
double disp220q_3(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int)
Definition: disp22sdq.cc:380
double ** vvvv_ccd(const char *, const char *, const char *, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1189
virtual ~SAPT2p()
Definition: sapt2p.cc:62
double disp220q_1(int, const char *, const char *, const char *, int, int)
Definition: disp22sdq.cc:304
int max_diis_vecs_
Definition: sapt2p.h:163
void vvvv_prep(const char *, const char *, double **, int, int, std::shared_ptr< Matrix >)
Definition: disp2ccd.cc:1117
SAPT2p(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO > psio)
Definition: sapt2p.cc:37
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:371
double disp220q_2(int, const char *, const char *, const char *, int, const char *, int, int, int)
Definition: disp22sdq.cc:337
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:196
virtual void amplitudes()
Definition: amplitudes.cc:603
int diis_file_
Definition: sapt2p.h:165
double disp211()
Definition: disp22sdq.cc:106
void write_IJKL(double **, int, const char *, int, int)
Definition: disp2ccd.cc:2010
void natural_orbitalify_ccd()
Definition: disp22t.cc:156
Definition: sapt2p.h:37
~SAPTDIIS()
Definition: disp2ccd.cc:2032
double disp21_2(int, const char *, const char *, int, int)
Definition: disp21.cc:76
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:251
double e_disp22sdq_
Definition: sapt2p.h:44
double e_disp22t_ccd_
Definition: sapt2p.h:71
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:650
int filenum_
Definition: sapt2p.h:160
double ccd_t_conv_
Definition: sapt2p.h:81
double r_ccd_energy(const char *, const char *, int, int, int, int)
Definition: disp2ccd.cc:355
void store_vectors()
Definition: disp2ccd.cc:2034
double ccd_e_conv_
Definition: sapt2p.h:80
char * get_vec_label(int)
Definition: disp2ccd.cc:2114
int max_ccd_vecs_
Definition: sapt2p.h:79
double disp220d_1(int, const char *, const char *, int, const char *, int, int, int)
Definition: disp22sdq.cc:204
double disp220d_2(int, const char *, const char *, int, const char *, int, int, int, int, int, int, double *, double *, const char)
Definition: disp22sdq.cc:237
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:1630
SAPTDIIS(int, const char *, const char *, size_t, int, std::shared_ptr< PSIO >)
Definition: disp2ccd.cc:2016
const char * err_label_
Definition: sapt2p.h:162
void disp22t()
Definition: disp22t.cc:34
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:535
double e_sapt2p_
Definition: sapt2p.h:47
virtual void print_header()
Definition: sapt2p.cc:140
Definition: liboptions.h:353
int num_vecs_
Definition: sapt2p.h:169
void get_new_vector()
Definition: disp2ccd.cc:2054
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:1693
const char * vec_label_
Definition: sapt2p.h:161
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:1393
double e_disp22s_ccd_
Definition: sapt2p.h:70
std::shared_ptr< PSIO > psio_
Definition: sapt2p.h:175
virtual void print_results()
Definition: sapt2p.cc:195
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: sapt2p.cc:68
double disp21_1(int, const char *, const char *, int, int, int, int)
Definition: disp21.cc:56
Definition: sapt2p.h:158
std::shared_ptr< Matrix > mo2no(int ampfile, const char *VV_opdm, int nvir, double cutoff)
Definition: disp2ccd.cc:2120
int ccd_maxiter_
Definition: sapt2p.h:77
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:420
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:672
double disp220s(int, const char *, const char *, int, const char *, const char *, int, int, int)
Definition: disp22sdq.cc:167
void disp21()
Definition: disp21.cc:34
double ccd_energy(const char *, const char *, int, int)
Definition: disp2ccd.cc:1677
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:1054
int min_ccd_vecs_
Definition: sapt2p.h:78
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
void disp22tccd()
Definition: disp22t.cc:91
double e_est_disp22t_
Definition: sapt2p.h:46
char * get_err_label(int)
Definition: disp2ccd.cc:2108
double e_disp21_
Definition: sapt2p.h:43
void disp22sdq()
Definition: disp22sdq.cc:34
double e_disp22t_
Definition: sapt2p.h:45
bool ccd_disp_
Definition: sapt2p.h:76
double e_disp2d_ccd_
Definition: sapt2p.h:69
int curr_vec_
Definition: sapt2p.h:168
void disp2ccd()
Definition: disp2ccd.cc:39
double disp220q_4(int, const char *, const char *, const char, int, const char *, int, int, int, int, int, int)
Definition: disp22sdq.cc:435