Psi4
sapt.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 SAPT_H
29 #define SAPT_H
30 
31 
32 #include "psi4/psifiles.h"
33 
34 #ifdef _OPENMP
35  #include <omp.h>
36 #endif
37 
38 #ifdef USING_LAPACK_MKL
39  #include <mkl.h>
40 #endif
41 
42 #define INDEX(i,j) ((i>=j) ? (ioff_[i] + j) : (ioff_[j] + i))
43 
44 
45 #include "psi4/libpsio/psio.h"
46 #include "psi4/libpsio/psio.hpp"
48 #include "psi4/libciomr/libciomr.h"
49 #include "psi4/libqt/qt.h"
50 #include "psi4/lib3index/3index.h"
52 
53 
54 namespace psi { namespace sapt {
55 
56 class SAPT : public Wavefunction {
57 
58 private:
59  void initialize(SharedWavefunction MonomerA, SharedWavefunction MonomerB);
60  void get_denom();
61 
62 protected:
63  std::shared_ptr<BasisSet> ribasis_;
64  std::shared_ptr<BasisSet> elstbasis_;
65  std::shared_ptr<BasisSet> zero_;
66 
67  size_t nsoA_;
68  size_t nmoA_;
69  size_t nsoB_;
70  size_t nmoB_;
71  size_t ndf_;
72  size_t noccA_;
73  size_t foccA_;
74  size_t aoccA_;
75  size_t noccB_;
76  size_t foccB_;
77  size_t aoccB_;
78  size_t nvirA_;
79  size_t nvirB_;
80  int NA_;
81  int NB_;
82  int natomsA_;
83  int natomsB_;
84 
86 
87  long int mem_;
88 
89  // Alpha exponent for exchange scaling
91 
92  double enuc_;
93  double eHF_;
94  double schwarz_;
95 
96  double *evalsA_;
97  double *evalsB_;
98  double *diagAA_;
99  double *diagBB_;
100 
101  double **CA_;
102  double **CB_;
103  double **CHFA_;
104  double **CHFB_;
105  double **sAB_;
106  double **vABB_;
107  double **vBAA_;
108  double **vAAB_;
109  double **vBAB_;
110 
111  std::shared_ptr<SAPTDenominator> denom_;
112 
113  size_t nvec_;
114 
115  double **dAR_;
116  double **dBS_;
117 
118  void zero_disk(int, const char *, int, int);
119 
120 public:
123  std::shared_ptr<PSIO> psio);
124  virtual ~SAPT();
125 
126  virtual double compute_energy()=0;
127 };
128 
129 class CPHFDIIS {
130 
131 private:
133  size_t vec_length_;
134 
137 
138  double **t_vecs_;
139  double **err_vecs_;
140 
141 protected:
142 
143 public:
144  CPHFDIIS(int, int);
145  ~CPHFDIIS();
146 
147  void store_vectors(double *, double *);
148  void get_new_vector(double *);
149 };
150 
151 }}
152 
153 #endif
size_t ndf_
Definition: sapt.h:71
int curr_vec_
Definition: sapt.h:135
Options & options() const
Definition: wavefunction.cc:400
size_t nvirB_
Definition: sapt.h:79
void initialize(SharedWavefunction MonomerA, SharedWavefunction MonomerB)
Definition: sapt.cc:88
SAPT(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO > psio)
Definition: sapt.cc:39
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:395
size_t nmoA_
Definition: sapt.h:68
void store_vectors(double *, double *)
Definition: sapt.cc:363
size_t nsoA_
Definition: sapt.h:67
void zero_disk(int, const char *, int, int)
Definition: utils.cc:34
int NA_
Definition: sapt.h:80
double * diagAA_
Definition: sapt.h:98
size_t nvirA_
Definition: sapt.h:78
void get_new_vector(double *)
Definition: sapt.cc:373
size_t foccA_
Definition: sapt.h:73
virtual double compute_energy()=0
Compute energy. Subclasses override this function to compute its energy.
~CPHFDIIS()
Definition: sapt.cc:357
double ** vABB_
Definition: sapt.h:106
double ** t_vecs_
Definition: sapt.h:138
int num_vecs_
Definition: sapt.h:136
size_t vec_length_
Definition: sapt.h:133
Definition: sapt.h:129
int natomsB_
Definition: sapt.h:83
int NB_
Definition: sapt.h:81
int max_diis_vecs_
Definition: sapt.h:132
std::shared_ptr< BasisSet > elstbasis_
Definition: sapt.h:64
size_t nsoB_
Definition: sapt.h:69
size_t nmoB_
Definition: sapt.h:70
double ** dBS_
Definition: sapt.h:116
double ** CHFB_
Definition: sapt.h:104
double ** CB_
Definition: sapt.h:102
double enuc_
Definition: sapt.h:92
CPHFDIIS(int, int)
Definition: sapt.cc:345
double ** vBAB_
Definition: sapt.h:109
double ** CHFA_
Definition: sapt.h:103
size_t aoccB_
Definition: sapt.h:77
std::shared_ptr< BasisSet > zero_
Definition: sapt.h:65
double exch_scale_alpha_
Definition: sapt.h:90
Definition: sapt.h:56
bool elst_basis_
Definition: sapt.h:85
std::shared_ptr< SAPTDenominator > denom_
Definition: sapt.h:111
Definition: liboptions.h:359
Header file for the Quantum Trio LibraryDavid Sherrill 1994.
long int mem_
Definition: sapt.h:87
double ** err_vecs_
Definition: sapt.h:139
size_t nvec_
Definition: sapt.h:113
size_t aoccA_
Definition: sapt.h:74
int natomsA_
Definition: sapt.h:82
Simple wavefunction base class.
Definition: wavefunction.h:85
size_t foccB_
Definition: sapt.h:76
std::shared_ptr< BasisSet > ribasis_
Definition: sapt.h:63
double eHF_
Definition: sapt.h:93
double schwarz_
Definition: sapt.h:94
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:43
size_t noccA_
Definition: sapt.h:72
double * evalsB_
Definition: sapt.h:97
double ** vAAB_
Definition: sapt.h:108
double ** sAB_
Definition: sapt.h:105
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
virtual ~SAPT()
Definition: sapt.cc:70
double * diagBB_
Definition: sapt.h:99
void get_denom()
Definition: sapt.cc:312
double * evalsA_
Definition: sapt.h:96
double ** CA_
Definition: sapt.h:101
double ** vBAA_
Definition: sapt.h:107
double ** dAR_
Definition: sapt.h:115
size_t noccB_
Definition: sapt.h:75