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