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 program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef CCWAVE_H
29 #define CCWAVE_H
30 
32 #include "MOInfo.h"
33 #include "Params.h"
34 #include "Local.h"
35 
36 namespace psi {
37 class Wavefunction;
38 class Options;
39 struct dpd_file4_cache_entry;
40 struct dpdfile2;
41 struct dpdbuf4;
42 }
43 
44 namespace psi { namespace ccenergy {
45 
47 {
48 public:
49  CCEnergyWavefunction(std::shared_ptr<Wavefunction> reference_wavefunction, Options &options);
50  virtual ~CCEnergyWavefunction();
51 
52  double compute_energy();
53 
54 private:
55 
56  /* setup, info and teardown */
57  void init();
58  void init_io();
59  void init_ioff(void);
60  void exit_io(void);
61  void cleanup(void);
62  void status(const char *, std::string );
63  void title(void);
64 
65  /* calculation info */
66  void get_moinfo(void);
67  void get_params(Options &);
68 
69  /* amplitude handling */
70  void init_amps(void);
71  void sort_amps(void);
72  void tsave(void);
73  void ccdump(void);
74  void spinad_amps(void);
75  void amp_write(void);
76  void checkpoint(void);
77 
78  /* intermediates */
79  void update(void);
80  void Fae_build(void);
81  void Fmi_build(void);
82  void Fme_build(void);
83  void Wmnij_build(void);
84  void Wmbej_build(void);
85  void purge_Wabei(void);
86  void purge_Wmnij(void);
87  void purge_Wmnie(void);
88  void purge_Wmbij(void);
89  void purge_Wamef(void);
90  void FaetT2(void);
91  void FmitT2(void);
92  void WmnijT2(void);
93  void WmbejT2(void);
94  void BT2(void);
95  void CT2(void);
96  void DT2(void);
97  void ET2(void);
98  void FT2(void);
99  void ZT2(void);
100  void dijabT2(void);
101  void t1_build(void);
102  void tau_build(void);
103  void taut_build(void);
104  void Z_build(void);
105  void Y_build(void);
106  void X_build(void);
107  void t2_build(void);
108  int converged(double);
109 
110  /* DPD cache */
111  void init_priority_list(void);
112  int **cacheprep_uhf(int level, int *cachefiles);
113  int **cacheprep_rhf(int level, int *cachefiles);
114  void cachedone_rhf(int **cachelist);
115  void cachedone_uhf(int **cachelist);
116 
117  /* Brueckner */
118  int rotate(void);
119  double **fock_build(double **D);
120 
121  /* CC2 / CC3 */
122  void cc2_fmiT2(void);
123  void cc2_faeT2(void);
124  void cc2_WmbijT2(void);
125  void cc2_WabeiT2(void);
126  void cc2_WabijT2(void);
127  void cc2_Wmnij_build(void);
128  void cc2_Wmbij_build(void);
129  void cc2_Wabei_build(void);
130  void cc2_t2_build(void);
131  void FT2_CC2(void);
132  void purge_cc2_Wmnij(void);
133  void purge_cc2_Wmbij(void);
134  void purge_cc2_Wabei(void);
135  void t1_ijab(void);
136  void cc3_Wmnie(void);
137  void cc3_Wamef(void);
138  void cc3_Wmnij(void);
139  void cc3_Wmbij(void);
140  void cc3_Wabei(void);
141  void cc3(void);
142 
143  /* energies */
144  double energy(void);
145  double mp2_energy(void);
146  double uhf_mp2_energy(void);
147  double rhf_mp2_energy(void);
148  void one_step(void);
149  void denom(void);
150  void pair_energies(double** epair_aa, double** epair_ab);
151  void print_pair_energies(double* emp2_aa, double* emp2_ab, double* ecc_aa,
152  double* ecc_ab);
153 
154  void form_df_ints(Options &options, int **cachelist, int *cachefiles, dpd_file4_cache_entry *priority);
155 
156  /* diagnostics */
157  void analyze(void);
158  double diagnostic(void);
159  double d1diag(void);
160  double new_d1diag(void);
161  double new_d1diag_t1_rohf(void);
162  double d2diag(void);
163  double d1diag_t1_rhf(void);
164  double d1diag_t1_rohf(void);
165  double d2diag_rhf(void);
166 
167  /* local correlation */
168  void lmp2(void);
169  void local_filter_T1(dpdfile2 *T1);
170  void local_filter_T2(dpdbuf4 *T2);
171  void local_init(void);
172  void local_done(void);
173 
174 
175  /* AO basis */
176  void BT2_AO(void);
177  void halftrans(dpdbuf4 *Buf1, int dpdnum1, dpdbuf4 *Buf2, int dpdnum2, double ***C1, double ***C2,
178  int nirreps, int **mo_row, int **so_row, int *mospi_left, int *mospi_right,
179  int *sospi, int type, double alpha, double beta);
180  int AO_contribute(struct iwlbuf *InBuf, dpdbuf4 *tau1_AO, dpdbuf4 *tau2_AO);
181 
182 
183  double rhf_energy(void);
184  double uhf_energy(void);
185  double rohf_energy(void);
186  void rhf_fock_build(double **fock, double **D);
187  void uhf_fock_build(double **fock_a, double **fock_b, double **D_a, double **D_b);
188 
189  /* DIIS */
190  void diis(int iter);
191  void diis_RHF(int);
192  void diis_ROHF(int);
193  void diis_UHF(int);
194  void diis_invert_B(double** B, double* C, int dimension, double tolerance);
195 
196  /* member variables */
197  int *ioff_;
202 };
203 
204 }}
205 
206 #endif // CCWAVE_H
MOInfo moinfo_
Definition: ccwave.h:198
void purge_Wmnie(void)
Definition: cc3_Wmnie.cc:223
void lmp2(void)
Definition: lmp2.cc:70
void t1_build(void)
Definition: t1.cc:42
void local_init(void)
Definition: ccenergy/local.cc:64
Definition: ccenergy/Params.h:41
void purge_cc2_Wabei(void)
Definition: ccenergy/cc2_Wabei.cc:327
Options & options() const
Definition: wavefunction.cc:400
void cc2_WabeiT2(void)
Definition: cc2_WabeiT2.cc:42
void Wmbej_build(void)
Definition: ccenergy/Wmbej.cc:55
void diis_ROHF(int)
Definition: diis_ROHF.cc:61
void init_io()
Definition: ccenergy.cc:527
void FT2_CC2(void)
Definition: FT2_cc2.cc:38
double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: ccenergy.cc:88
void print_pair_energies(double *emp2_aa, double *emp2_ab, double *ecc_aa, double *ecc_ab)
Definition: pair_energies.cc:151
void purge_cc2_Wmbij(void)
Definition: ccenergy/cc2_Wmbij.cc:501
Definition: iwl.h:46
void tsave(void)
Definition: tsave.cc:40
void cc2_faeT2(void)
Definition: cc2_faeT2.cc:40
void taut_build(void)
Definition: ccenergy/taut.cc:41
double rhf_mp2_energy(void)
Definition: mp2_energy.cc:54
double new_d1diag_t1_rohf(void)
Definition: new_d1diag.cc:48
void status(const char *, std::string)
Definition: ccenergy/status.cc:38
double uhf_energy(void)
Definition: ccenergy/energy.cc:144
void t2_build(void)
Definition: t2.cc:43
void init()
Definition: ccenergy.cc:83
void cc3_Wamef(void)
Definition: cc3_Wamef.cc:49
void analyze(void)
Definition: ccenergy/analyze.cc:44
CCEnergyWavefunction(std::shared_ptr< Wavefunction > reference_wavefunction, Options &options)
Definition: ccenergy.cc:68
double diagnostic(void)
Definition: diagnostic.cc:43
int converged(double)
Definition: ccenergy/converged.cc:43
void cc2_Wmbij_build(void)
Definition: ccenergy/cc2_Wmbij.cc:45
double d1diag_t1_rohf(void)
Definition: d1diag.cc:146
int ** cacheprep_rhf(int level, int *cachefiles)
Definition: ccenergy/cache.cc:123
void FT2(void)
Definition: FT2.cc:43
void cc3_Wabei(void)
Definition: cc3_Wabei.cc:57
double rhf_energy(void)
Definition: ccenergy/energy.cc:52
void init_priority_list(void)
Definition: priority.cc:43
void local_filter_T1(dpdfile2 *T1)
Definition: ccenergy/local.cc:89
void one_step(void)
Definition: ccenergy.cc:572
void cc3(void)
Definition: cc3.cc:48
void title(void)
Definition: ccenergy.cc:535
double d2diag_rhf(void)
Definition: d2diag.cc:50
void denom(void)
Definition: ccenergy/denom.cc:46
double d2diag(void)
Definition: d2diag.cc:179
void checkpoint(void)
Definition: ccenergy.cc:563
int AO_contribute(struct iwlbuf *InBuf, dpdbuf4 *tau1_AO, dpdbuf4 *tau2_AO)
Definition: ccenergy/AO_contribute.cc:46
void cc2_t2_build(void)
Definition: cc2_t2.cc:41
void amp_write(void)
Definition: ccenergy/amp_write.cc:62
void purge_Wmbij(void)
Definition: cc3_Wmbij.cc:483
double new_d1diag(void)
Definition: new_d1diag.cc:154
double ** fock_build(double **D)
void cachedone_rhf(int **cachelist)
Definition: ccenergy/cache.cc:753
void cc3_Wmnij(void)
Definition: cc3_Wmnij.cc:50
void diis_RHF(int)
Definition: diis_RHF.cc:60
Definition: libdpd/dpd.h:151
void ET2(void)
Definition: ET2.cc:41
void cc3_Wmbij(void)
Definition: cc3_Wmbij.cc:52
void update(void)
Definition: ccenergy/update.cc:39
void form_df_ints(Options &options, int **cachelist, int *cachefiles, dpd_file4_cache_entry *priority)
Definition: form_df_ints.cc:50
Local local_
Definition: ccwave.h:200
void tau_build(void)
Definition: ccenergy/tau.cc:41
void cleanup(void)
Definition: ccenergy/get_moinfo.cc:316
double energy(void)
Definition: ccenergy/energy.cc:42
void cc2_Wmnij_build(void)
Definition: cc2_Wmnij.cc:47
Definition: ccenergy/MOInfo.h:38
double mp2_energy(void)
Definition: mp2_energy.cc:43
Enter brief description of file here.
void cc2_WabijT2(void)
Definition: cc2_WabijT2.cc:40
Enter brief description of file here.
void get_params(Options &)
Definition: ccenergy/get_params.cc:46
double d1diag(void)
Definition: d1diag.cc:210
void BT2_AO(void)
Definition: BT2_AO.cc:49
void pair_energies(double **epair_aa, double **epair_ab)
Definition: pair_energies.cc:51
void Fmi_build(void)
Definition: Fmi.cc:41
void t1_ijab(void)
Definition: t1_ijab.cc:41
void exit_io(void)
Definition: ccenergy.cc:544
void local_done(void)
Definition: ccenergy/local.cc:83
Definition: ccenergy/Local.h:38
double rohf_energy(void)
Definition: ccenergy/energy.cc:89
void cc3_Wmnie(void)
Definition: cc3_Wmnie.cc:49
void purge_cc2_Wmnij(void)
Definition: cc2_Wmnij.cc:330
Definition: liboptions.h:359
void uhf_fock_build(double **fock_a, double **fock_b, double **D_a, double **D_b)
Definition: fock_build.cc:187
Definition: libdpd/dpd.h:139
void cachedone_uhf(int **cachelist)
Definition: ccenergy/cache.cc:748
void init_amps(void)
Definition: ccenergy/init_amps.cc:42
void WmnijT2(void)
Definition: WmnijT2.cc:41
void cc2_fmiT2(void)
Definition: cc2_fmiT2.cc:40
int rotate(void)
Definition: rotate.cc:59
void sort_amps(void)
Definition: ccenergy/sort_amps.cc:41
void purge_Wamef(void)
Definition: cc3_Wamef.cc:201
double d1diag_t1_rhf(void)
Definition: d1diag.cc:56
void Fme_build(void)
Definition: Fme.cc:40
void purge_Wabei(void)
Definition: cc3_Wabei.cc:1033
void FmitT2(void)
Definition: FmitT2.cc:40
std::shared_ptr< Wavefunction > reference_wavefunction() const
Returns the reference wavefunction.
Definition: wavefunction.cc:453
void get_moinfo(void)
Definition: ccenergy/get_moinfo.cc:57
int * ioff_
Definition: ccwave.h:197
void Fae_build(void)
Definition: Fae.cc:43
Simple wavefunction base class.
Definition: wavefunction.h:85
void cc2_WmbijT2(void)
Definition: cc2_WmbijT2.cc:40
void local_filter_T2(dpdbuf4 *T2)
Definition: ccenergy/local.cc:192
void CT2(void)
Definition: CT2.cc:75
void init_ioff(void)
Definition: ccenergy.cc:554
void diis_invert_B(double **B, double *C, int dimension, double tolerance)
Definition: ccenergy/diis.cc:74
Definition: libdpd/dpd.h:104
void spinad_amps(void)
Definition: ccenergy/spinad_amps.cc:61
Definition: pointgrp.h:112
void purge_Wmnij(void)
Definition: cc3_Wmnij.cc:299
Params params_
Definition: ccwave.h:199
void diis(int iter)
Definition: ccenergy/diis.cc:65
void dijabT2(void)
Definition: dijabT2.cc:42
void ZT2(void)
Definition: ZT2.cc:40
void diis_UHF(int)
Definition: diis_UHF.cc:60
void Wmnij_build(void)
Definition: Wmnij.cc:42
dpd_file4_cache_entry * cache_priority_list_
Definition: ccwave.h:201
void DT2(void)
Definition: DT2.cc:40
double uhf_mp2_energy(void)
Definition: mp2_energy.cc:106
void BT2(void)
Definition: BT2.cc:46
void Z_build(void)
Definition: Z.cc:41
void FaetT2(void)
Definition: FaetT2.cc:40
Enter brief description of file here.
virtual ~CCEnergyWavefunction()
Definition: ccenergy.cc:77
void WmbejT2(void)
Definition: WmbejT2.cc:118
int ** cacheprep_uhf(int level, int *cachefiles)
Definition: ccenergy/cache.cc:57
void rhf_fock_build(double **fock, double **D)
Definition: fock_build.cc:50
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:61
void cc2_Wabei_build(void)
Definition: ccenergy/cc2_Wabei.cc:57