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 }
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:224
void lmp2(void)
Definition: lmp2.cc:71
void t1_build(void)
Definition: t1.cc:43
void local_init(void)
Definition: ccenergy/local.cc:65
Definition: ccenergy/Params.h:42
void purge_cc2_Wabei(void)
Definition: ccenergy/cc2_Wabei.cc:328
Options & options() const
Definition: wavefunction.cc:396
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:535
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:89
void print_pair_energies(double *emp2_aa, double *emp2_ab, double *ecc_aa, double *ecc_ab)
Definition: pair_energies.cc:152
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:84
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:69
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:90
void one_step(void)
Definition: ccenergy.cc:580
void cc3(void)
Definition: cc3.cc:49
void title(void)
Definition: ccenergy.cc:543
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:571
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:40
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:200
void tau_build(void)
Definition: ccenergy/tau.cc:42
void cleanup(void)
Definition: ccenergy/get_moinfo.cc:317
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:47
double d1diag(void)
Definition: d1diag.cc:211
void BT2_AO(void)
Definition: BT2_AO.cc:50
void pair_energies(double **epair_aa, double **epair_ab)
Definition: pair_energies.cc:52
void Fmi_build(void)
Definition: Fmi.cc:42
void t1_ijab(void)
Definition: t1_ijab.cc:42
void exit_io(void)
Definition: ccenergy.cc:552
void local_done(void)
Definition: ccenergy/local.cc:84
Definition: ccenergy/Local.h:39
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:360
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:43
void WmnijT2(void)
Definition: WmnijT2.cc:42
void cc2_fmiT2(void)
Definition: cc2_fmiT2.cc:41
int rotate(void)
Definition: rotate.cc:60
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:450
void get_moinfo(void)
Definition: ccenergy/get_moinfo.cc:58
int * ioff_
Definition: ccwave.h:197
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:193
void CT2(void)
Definition: CT2.cc:76
void init_ioff(void)
Definition: ccenergy.cc:562
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:199
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:201
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:78
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