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