Psi4
ccwave.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 CCWAVE_H
30 #define CCWAVE_H
31 
33 #include "MOInfo.h"
34 #include "Params.h"
35 #include "Local.h"
36 
37 namespace psi {
38 class Options;
39 struct dpd_file4_cache_entry;
40 struct dpdfile2;
41 struct dpdbuf4;
42 struct iwlbuf;
43 }
44 
45 namespace psi { namespace ccenergy {
46 
48 {
49 public:
50  CCEnergyWavefunction(std::shared_ptr<Wavefunction> reference_wavefunction, Options &options);
51  virtual ~CCEnergyWavefunction();
52 
53  double compute_energy();
54 
55 private:
56 
57  /* setup, info and teardown */
58  void init();
59  void init_io();
60  void init_ioff(void);
61  void exit_io(void);
62  void cleanup(void);
63  void status(const char *, std::string );
64  void title(void);
65 
66  /* calculation info */
67  void get_moinfo(void);
68  void get_params(Options &);
69 
70  /* amplitude handling */
71  void init_amps(void);
72  void sort_amps(void);
73  void tsave(void);
74  void ccdump(void);
75  void spinad_amps(void);
76  void amp_write(void);
77  void checkpoint(void);
78 
79  /* intermediates */
80  void update(void);
81  void Fae_build(void);
82  void Fmi_build(void);
83  void Fme_build(void);
84  void Wmnij_build(void);
85  void Wmbej_build(void);
86  void purge_Wabei(void);
87  void purge_Wmnij(void);
88  void purge_Wmnie(void);
89  void purge_Wmbij(void);
90  void purge_Wamef(void);
91  void FaetT2(void);
92  void FmitT2(void);
93  void WmnijT2(void);
94  void WmbejT2(void);
95  void BT2(void);
96  void CT2(void);
97  void DT2(void);
98  void ET2(void);
99  void FT2(void);
100  void ZT2(void);
101  void dijabT2(void);
102  void t1_build(void);
103  void tau_build(void);
104  void taut_build(void);
105  void Z_build(void);
106  void Y_build(void);
107  void X_build(void);
108  void t2_build(void);
109  int converged(double);
110 
111  /* DPD cache */
112  void init_priority_list(void);
113  int **cacheprep_uhf(int level, int *cachefiles);
114  int **cacheprep_rhf(int level, int *cachefiles);
115  void cachedone_rhf(int **cachelist);
116  void cachedone_uhf(int **cachelist);
117 
118  /* Brueckner */
119  int rotate(void);
120  double **fock_build(double **D);
121 
122  /* CC2 / CC3 */
123  void cc2_fmiT2(void);
124  void cc2_faeT2(void);
125  void cc2_WmbijT2(void);
126  void cc2_WabeiT2(void);
127  void cc2_WabijT2(void);
128  void cc2_Wmnij_build(void);
129  void cc2_Wmbij_build(void);
130  void cc2_Wabei_build(void);
131  void cc2_t2_build(void);
132  void FT2_CC2(void);
133  void purge_cc2_Wmnij(void);
134  void purge_cc2_Wmbij(void);
135  void purge_cc2_Wabei(void);
136  void t1_ijab(void);
137  void cc3_Wmnie(void);
138  void cc3_Wamef(void);
139  void cc3_Wmnij(void);
140  void cc3_Wmbij(void);
141  void cc3_Wabei(void);
142  void cc3(void);
143 
144  /* energies */
145  double energy(void);
146  double mp2_energy(void);
147  double uhf_mp2_energy(void);
148  double rhf_mp2_energy(void);
149  void one_step(void);
150  void denom(void);
151  void pair_energies(double** epair_aa, double** epair_ab);
152  void print_pair_energies(double* emp2_aa, double* emp2_ab, double* ecc_aa,
153  double* ecc_ab);
154 
155  void form_df_ints(Options &options, int **cachelist, int *cachefiles, dpd_file4_cache_entry *priority);
156 
157  /* diagnostics */
158  void analyze(void);
159  double diagnostic(void);
160  double d1diag(void);
161  double new_d1diag(void);
162  double new_d1diag_t1_rohf(void);
163  double d2diag(void);
164  double d1diag_t1_rhf(void);
165  double d1diag_t1_rohf(void);
166  double d2diag_rhf(void);
167 
168  /* local correlation */
169  void lmp2(void);
170  void local_filter_T1(dpdfile2 *T1);
171  void local_filter_T2(dpdbuf4 *T2);
172  void local_init(void);
173  void local_done(void);
174 
175 
176  /* AO basis */
177  void BT2_AO(void);
178  void halftrans(dpdbuf4 *Buf1, int dpdnum1, dpdbuf4 *Buf2, int dpdnum2, double ***C1, double ***C2,
179  int nirreps, int **mo_row, int **so_row, int *mospi_left, int *mospi_right,
180  int *sospi, int type, double alpha, double beta);
181  int AO_contribute(struct iwlbuf *InBuf, dpdbuf4 *tau1_AO, dpdbuf4 *tau2_AO);
182 
183 
184  double rhf_energy(void);
185  double uhf_energy(void);
186  double rohf_energy(void);
187  void rhf_fock_build(double **fock, double **D);
188  void uhf_fock_build(double **fock_a, double **fock_b, double **D_a, double **D_b);
189 
190  /* DIIS */
191  void diis(int iter);
192  void diis_RHF(int);
193  void diis_ROHF(int);
194  void diis_UHF(int);
195  void diis_invert_B(double** B, double* C, int dimension, double tolerance);
196 
197  /* member variables */
198  int *ioff_;
203 };
204 
205 }}
206 
207 #endif // CCWAVE_H
MOInfo moinfo_
Definition: ccwave.h:199
void purge_Wmnie(void)
Definition: cc3_Wmnie.cc:224
void lmp2(void)
Definition: lmp2.cc:76
void t1_build(void)
Definition: t1.cc:43
void local_init(void)
Definition: ccenergy/local.cc:68
Definition: ccenergy/Params.h:42
void purge_cc2_Wabei(void)
Definition: ccenergy/cc2_Wabei.cc:328
Options & options() const
Definition: wavefunction.cc:412
void cc2_WabeiT2(void)
Definition: cc2_WabeiT2.cc:43
void Wmbej_build(void)
Definition: ccenergy/Wmbej.cc:56
void diis_ROHF(int)
Definition: diis_ROHF.cc:62
void init_io()
Definition: ccenergy.cc:541
void FT2_CC2(void)
Definition: FT2_cc2.cc:39
double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: ccenergy.cc:94
void print_pair_energies(double *emp2_aa, double *emp2_ab, double *ecc_aa, double *ecc_ab)
Definition: pair_energies.cc:153
void purge_cc2_Wmbij(void)
Definition: ccenergy/cc2_Wmbij.cc:502
Definition: iwl.h:47
void tsave(void)
Definition: tsave.cc:41
void cc2_faeT2(void)
Definition: cc2_faeT2.cc:41
void taut_build(void)
Definition: ccenergy/taut.cc:42
double rhf_mp2_energy(void)
Definition: mp2_energy.cc:55
double new_d1diag_t1_rohf(void)
Definition: new_d1diag.cc:49
void status(const char *, std::string)
Definition: ccenergy/status.cc:39
double uhf_energy(void)
Definition: ccenergy/energy.cc:145
void t2_build(void)
Definition: t2.cc:44
void init()
Definition: ccenergy.cc:89
void cc3_Wamef(void)
Definition: cc3_Wamef.cc:50
void analyze(void)
Definition: ccenergy/analyze.cc:45
CCEnergyWavefunction(std::shared_ptr< Wavefunction > reference_wavefunction, Options &options)
Definition: ccenergy.cc:74
double diagnostic(void)
Definition: diagnostic.cc:44
int converged(double)
Definition: ccenergy/converged.cc:44
void cc2_Wmbij_build(void)
Definition: ccenergy/cc2_Wmbij.cc:46
double d1diag_t1_rohf(void)
Definition: d1diag.cc:147
int ** cacheprep_rhf(int level, int *cachefiles)
Definition: ccenergy/cache.cc:124
void FT2(void)
Definition: FT2.cc:44
void cc3_Wabei(void)
Definition: cc3_Wabei.cc:58
double rhf_energy(void)
Definition: ccenergy/energy.cc:53
void init_priority_list(void)
Definition: priority.cc:44
void local_filter_T1(dpdfile2 *T1)
Definition: ccenergy/local.cc:93
void one_step(void)
Definition: ccenergy.cc:586
void cc3(void)
Definition: cc3.cc:49
void title(void)
Definition: ccenergy.cc:549
double d2diag_rhf(void)
Definition: d2diag.cc:51
void denom(void)
Definition: ccenergy/denom.cc:47
double d2diag(void)
Definition: d2diag.cc:180
void checkpoint(void)
Definition: ccenergy.cc:577
int AO_contribute(struct iwlbuf *InBuf, dpdbuf4 *tau1_AO, dpdbuf4 *tau2_AO)
Definition: ccenergy/AO_contribute.cc:47
void cc2_t2_build(void)
Definition: cc2_t2.cc:42
void amp_write(void)
Definition: ccenergy/amp_write.cc:63
void purge_Wmbij(void)
Definition: cc3_Wmbij.cc:484
double new_d1diag(void)
Definition: new_d1diag.cc:155
double ** fock_build(double **D)
void cachedone_rhf(int **cachelist)
Definition: ccenergy/cache.cc:754
void cc3_Wmnij(void)
Definition: cc3_Wmnij.cc:51
void diis_RHF(int)
Definition: diis_RHF.cc:61
Definition: libdpd/dpd.h:152
void ET2(void)
Definition: ET2.cc:42
void cc3_Wmbij(void)
Definition: cc3_Wmbij.cc:53
void update(void)
Definition: ccenergy/update.cc:44
void form_df_ints(Options &options, int **cachelist, int *cachefiles, dpd_file4_cache_entry *priority)
Definition: form_df_ints.cc:51
Local local_
Definition: ccwave.h:201
void tau_build(void)
Definition: ccenergy/tau.cc:42
void cleanup(void)
Definition: ccenergy/get_moinfo.cc:321
double energy(void)
Definition: ccenergy/energy.cc:43
void cc2_Wmnij_build(void)
Definition: cc2_Wmnij.cc:48
Definition: ccenergy/MOInfo.h:39
double mp2_energy(void)
Definition: mp2_energy.cc:44
Enter brief description of file here.
void cc2_WabijT2(void)
Definition: cc2_WabijT2.cc:41
Enter brief description of file here.
void get_params(Options &)
Definition: ccenergy/get_params.cc:53
double d1diag(void)
Definition: d1diag.cc:211
void BT2_AO(void)
Definition: BT2_AO.cc:54
void pair_energies(double **epair_aa, double **epair_ab)
Definition: pair_energies.cc:53
void Fmi_build(void)
Definition: Fmi.cc:42
void t1_ijab(void)
Definition: t1_ijab.cc:42
void exit_io(void)
Definition: ccenergy.cc:558
void local_done(void)
Definition: ccenergy/local.cc:87
Definition: ccenergy/Local.h:41
double rohf_energy(void)
Definition: ccenergy/energy.cc:90
void cc3_Wmnie(void)
Definition: cc3_Wmnie.cc:50
void purge_cc2_Wmnij(void)
Definition: cc2_Wmnij.cc:331
Definition: liboptions.h:355
void uhf_fock_build(double **fock_a, double **fock_b, double **D_a, double **D_b)
Definition: fock_build.cc:188
Definition: libdpd/dpd.h:140
void cachedone_uhf(int **cachelist)
Definition: ccenergy/cache.cc:749
void init_amps(void)
Definition: ccenergy/init_amps.cc:46
void WmnijT2(void)
Definition: WmnijT2.cc:42
void cc2_fmiT2(void)
Definition: cc2_fmiT2.cc:41
int rotate(void)
Definition: rotate.cc:64
void sort_amps(void)
Definition: ccenergy/sort_amps.cc:42
void purge_Wamef(void)
Definition: cc3_Wamef.cc:202
double d1diag_t1_rhf(void)
Definition: d1diag.cc:57
void Fme_build(void)
Definition: Fme.cc:41
void purge_Wabei(void)
Definition: cc3_Wabei.cc:1034
void FmitT2(void)
Definition: FmitT2.cc:41
std::shared_ptr< Wavefunction > reference_wavefunction() const
Returns the reference wavefunction.
Definition: wavefunction.cc:465
void get_moinfo(void)
Definition: ccenergy/get_moinfo.cc:62
int * ioff_
Definition: ccwave.h:198
void Fae_build(void)
Definition: Fae.cc:44
Simple wavefunction base class.
Definition: wavefunction.h:84
void cc2_WmbijT2(void)
Definition: cc2_WmbijT2.cc:41
void local_filter_T2(dpdbuf4 *T2)
Definition: ccenergy/local.cc:196
void CT2(void)
Definition: CT2.cc:76
void init_ioff(void)
Definition: ccenergy.cc:568
void diis_invert_B(double **B, double *C, int dimension, double tolerance)
Definition: ccenergy/diis.cc:75
Definition: libdpd/dpd.h:105
void spinad_amps(void)
Definition: ccenergy/spinad_amps.cc:62
Definition: pointgrp.h:113
void purge_Wmnij(void)
Definition: cc3_Wmnij.cc:300
Params params_
Definition: ccwave.h:200
void diis(int iter)
Definition: ccenergy/diis.cc:66
void dijabT2(void)
Definition: dijabT2.cc:43
void ZT2(void)
Definition: ZT2.cc:41
void diis_UHF(int)
Definition: diis_UHF.cc:61
void Wmnij_build(void)
Definition: Wmnij.cc:43
dpd_file4_cache_entry * cache_priority_list_
Definition: ccwave.h:202
void DT2(void)
Definition: DT2.cc:41
double uhf_mp2_energy(void)
Definition: mp2_energy.cc:107
void BT2(void)
Definition: BT2.cc:47
void Z_build(void)
Definition: Z.cc:42
void FaetT2(void)
Definition: FaetT2.cc:41
Enter brief description of file here.
virtual ~CCEnergyWavefunction()
Definition: ccenergy.cc:83
void WmbejT2(void)
Definition: WmbejT2.cc:119
int ** cacheprep_uhf(int level, int *cachefiles)
Definition: ccenergy/cache.cc:58
void rhf_fock_build(double **fock, double **D)
Definition: fock_build.cc:51
void halftrans(dpdbuf4 *Buf1, int dpdnum1, dpdbuf4 *Buf2, int dpdnum2, double ***C1, double ***C2, int nirreps, int **mo_row, int **so_row, int *mospi_left, int *mospi_right, int *sospi, int type, double alpha, double beta)
Definition: ccenergy/halftrans.cc:62
void cc2_Wabei_build(void)
Definition: ccenergy/cc2_Wabei.cc:58