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-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 SAPT_H
30 #define SAPT_H
31 
32 #include "psi4/psifiles.h"
33 
34 #ifdef _OPENMP
35 #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 #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"
54 
55 namespace psi {
56 namespace sapt {
57 
58 class SAPT : public Wavefunction {
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:
123  std::shared_ptr<PSIO> psio);
124  virtual ~SAPT();
125 
126  virtual double compute_energy() = 0;
127 };
128 
129 class CPHFDIIS {
130  private:
132  size_t vec_length_;
133 
136 
137  double **t_vecs_;
138  double **err_vecs_;
139 
140  protected:
141  public:
142  CPHFDIIS(int, int);
143  ~CPHFDIIS();
144 
145  void store_vectors(double *, double *);
146  void get_new_vector(double *);
147 };
148 }
149 }
150 
151 #endif
size_t ndf_
Definition: sapt.h:72
int curr_vec_
Definition: sapt.h:134
Options & options() const
Definition: wavefunction.cc:572
size_t nvirB_
Definition: sapt.h:80
void initialize(SharedWavefunction MonomerA, SharedWavefunction MonomerB)
Definition: sapt.cc:87
SAPT(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO > psio)
Definition: sapt.cc:43
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:570
size_t nmoA_
Definition: sapt.h:69
void store_vectors(double *, double *)
Definition: sapt.cc:330
size_t nsoA_
Definition: sapt.h:68
void zero_disk(int, const char *, int, int)
Definition: utils.cc:38
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:339
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:325
double ** vABB_
Definition: sapt.h:107
double ** t_vecs_
Definition: sapt.h:137
int num_vecs_
Definition: sapt.h:135
size_t vec_length_
Definition: sapt.h:132
Definition: sapt.h:129
int natomsB_
Definition: sapt.h:84
int NB_
Definition: sapt.h:82
int max_diis_vecs_
Definition: sapt.h:131
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:314
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:58
bool elst_basis_
Definition: sapt.h:86
std::shared_ptr< SAPTDenominator > denom_
Definition: sapt.h:112
Definition: liboptions.h:353
Header file for the Quantum Trio LibraryDavid Sherrill 1994.
long int mem_
Definition: sapt.h:88
double ** err_vecs_
Definition: sapt.h:138
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:85
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:48
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:54
virtual ~SAPT()
Definition: sapt.cc:70
double * diagBB_
Definition: sapt.h:100
void get_denom()
Definition: sapt.cc:288
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