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-2019 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>
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 
45 
46 namespace psi {
47 
48 class SAPTDenominator;
49 namespace sapt {
50 
51 class SAPT : public Wavefunction {
52  private:
53  void initialize(SharedWavefunction MonomerA, SharedWavefunction MonomerB);
54  void get_denom();
55 
56  protected:
57  std::shared_ptr<BasisSet> ribasis_;
58  std::shared_ptr<BasisSet> elstbasis_;
59  std::shared_ptr<BasisSet> zero_;
60 
61  size_t nsoA_;
62  size_t nmoA_;
63  size_t nsoB_;
64  size_t nmoB_;
65  size_t ndf_;
66  size_t noccA_;
67  size_t foccA_;
68  size_t aoccA_;
69  size_t noccB_;
70  size_t foccB_;
71  size_t aoccB_;
72  size_t nvirA_;
73  size_t nvirB_;
74  int NA_;
75  int NB_;
76  int natomsA_;
77  int natomsB_;
78 
80 
81  long int mem_;
82 
83  // Alpha exponent for exchange scaling
85 
86  double enuc_;
87  double eHF_;
88  double schwarz_;
89 
90  double *evalsA_;
91  double *evalsB_;
92  double *diagAA_;
93  double *diagBB_;
94 
95  double **CA_;
96  double **CB_;
97  double **CHFA_;
98  double **CHFB_;
99  double **sAB_;
100  double **vABB_;
101  double **vBAA_;
102  double **vAAB_;
103  double **vBAB_;
104 
105  std::shared_ptr<SAPTDenominator> denom_;
106 
107  size_t nvec_;
108 
109  double **dAR_;
110  double **dBS_;
111 
112  void zero_disk(int, const char *, int, int);
113 
114  public:
116  std::shared_ptr<PSIO> psio);
117  ~SAPT() override;
118 
119  double compute_energy() override = 0;
120 };
121 
122 class CPHFDIIS {
123  private:
125  size_t vec_length_;
126 
129 
130  double **t_vecs_;
131  double **err_vecs_;
132 
133  protected:
134  public:
135  CPHFDIIS(int, int);
136  ~CPHFDIIS();
137 
138  void store_vectors(double *, double *);
139  void get_new_vector(double *);
140 };
141 } // namespace sapt
142 } // namespace psi
143 
144 #endif
size_t ndf_
Definition: sapt.h:65
int curr_vec_
Definition: sapt.h:127
Options & options() const
Definition: wavefunction.cc:648
size_t nvirB_
Definition: sapt.h:73
void initialize(SharedWavefunction MonomerA, SharedWavefunction MonomerB)
Definition: sapt.cc:92
SAPT(SharedWavefunction Dimer, SharedWavefunction MonomerA, SharedWavefunction MonomerB, Options &options, std::shared_ptr< PSIO > psio)
Definition: sapt.cc:48
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:646
size_t nmoA_
Definition: sapt.h:62
void store_vectors(double *, double *)
Definition: sapt.cc:335
size_t nsoA_
Definition: sapt.h:61
void zero_disk(int, const char *, int, int)
Definition: utils.cc:42
int NA_
Definition: sapt.h:74
double * diagAA_
Definition: sapt.h:92
size_t nvirA_
Definition: sapt.h:72
void get_new_vector(double *)
Definition: sapt.cc:344
size_t foccA_
Definition: sapt.h:67
~CPHFDIIS()
Definition: sapt.cc:330
double ** vABB_
Definition: sapt.h:100
double ** t_vecs_
Definition: sapt.h:130
int num_vecs_
Definition: sapt.h:128
size_t vec_length_
Definition: sapt.h:125
Definition: sapt.h:122
int natomsB_
Definition: sapt.h:77
int NB_
Definition: sapt.h:75
double compute_energy() override=0
Compute energy. Subclasses override this function to compute its energy.
int max_diis_vecs_
Definition: sapt.h:124
std::shared_ptr< BasisSet > elstbasis_
Definition: sapt.h:58
size_t nsoB_
Definition: sapt.h:63
size_t nmoB_
Definition: sapt.h:64
double ** dBS_
Definition: sapt.h:110
double ** CHFB_
Definition: sapt.h:98
double ** CB_
Definition: sapt.h:96
double enuc_
Definition: sapt.h:86
CPHFDIIS(int, int)
Definition: sapt.cc:319
double ** vBAB_
Definition: sapt.h:103
double ** CHFA_
Definition: sapt.h:97
size_t aoccB_
Definition: sapt.h:71
std::shared_ptr< BasisSet > zero_
Definition: sapt.h:59
double exch_scale_alpha_
Definition: sapt.h:84
Definition: sapt.h:51
bool elst_basis_
Definition: sapt.h:79
std::shared_ptr< SAPTDenominator > denom_
Definition: sapt.h:105
Definition: liboptions.h:352
long int mem_
Definition: sapt.h:81
double ** err_vecs_
Definition: sapt.h:131
size_t nvec_
Definition: sapt.h:107
size_t aoccA_
Definition: sapt.h:68
int natomsA_
Definition: sapt.h:76
Simple wavefunction base class.
Definition: wavefunction.h:85
size_t foccB_
Definition: sapt.h:70
std::shared_ptr< BasisSet > ribasis_
Definition: sapt.h:57
double eHF_
Definition: sapt.h:87
double schwarz_
Definition: sapt.h:88
PsiReturnType sapt(SharedWavefunction, SharedWavefunction, SharedWavefunction, Options &)
Definition: sapt/wrapper.cc:50
size_t noccA_
Definition: sapt.h:66
~SAPT() override
Definition: sapt.cc:75
double * evalsB_
Definition: sapt.h:91
double ** vAAB_
Definition: sapt.h:102
double ** sAB_
Definition: sapt.h:99
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
double * diagBB_
Definition: sapt.h:93
void get_denom()
Definition: sapt.cc:293
double * evalsA_
Definition: sapt.h:90
double ** CA_
Definition: sapt.h:95
double ** vBAA_
Definition: sapt.h:101
double ** dAR_
Definition: sapt.h:109
size_t noccB_
Definition: sapt.h:69