Psi4
mrccsd_t.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 _psi_src_bin_psimrcc_mrccsd_t_h_
29 #define _psi_src_bin_psimrcc_mrccsd_t_h_
30 
31 #include <vector>
32 
33 namespace psi{ namespace psimrcc{
34 
35 class CCIndex;
36 class BlockMatrix;
37 class IndexMatrix;
38 class Hamiltonian;
39 
40 class MRCCSD_T
41 {
43 public:
44  // Constructor and destructor
45  MRCCSD_T(Options& options,Hamiltonian* h_eff_);
46  ~MRCCSD_T();
47 private:
48  void startup();
49  void cleanup();
50  void compute();
51  void compute_ooo_triples();
52  void compute_OOO_triples();
53  void compute_ooO_triples();
54  void compute_oOO_triples();
55 
56  void compute_restricted();
61 
62  void compute_spin_adapted();
67 
68  void compute_ooo_contribution_to_Heff(int i,int j,int k,int mu,BlockMatrix* T3);
69  void compute_ooO_contribution_to_Heff(int i,int j,int k,int mu,BlockMatrix* T3);
70  void compute_oOO_contribution_to_Heff(int i,int j,int k,int mu,BlockMatrix* T3);
71  void compute_OOO_contribution_to_Heff(int i,int j,int k,int mu,BlockMatrix* T3);
72 
73  double compute_A_ooo_contribution_to_Heff(int u_abs,int x_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
74  double compute_A_ooO_contribution_to_Heff(int u_abs,int x_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
75  double compute_A_oOO_contribution_to_Heff(int u_abs,int x_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
76 
77  double compute_B_ooO_contribution_to_Heff(int U_abs,int X_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
78  double compute_B_oOO_contribution_to_Heff(int U_abs,int X_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
79  double compute_B_OOO_contribution_to_Heff(int U_abs,int X_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
80 
81  double compute_AB_ooO_contribution_to_Heff(int u_abs,int V_abs,int x_abs,int Y_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
82  double compute_AB_oOO_contribution_to_Heff(int u_abs,int V_abs,int x_abs,int Y_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
83 
84  void compute_ooo_contribution_to_Heff_restricted(int i,int j,int k,int mu,BlockMatrix* T3);
85  void compute_ooO_contribution_to_Heff_restricted(int i,int j,int k,int mu,BlockMatrix* T3);
86  void compute_oOO_contribution_to_Heff_restricted(int i,int j,int k,int mu,BlockMatrix* T3);
87  void compute_OOO_contribution_to_Heff_restricted(int i,int j,int k,int mu,BlockMatrix* T3);
88 
89  double compute_A_ooo_contribution_to_Heff_restricted(int u_abs,int x_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
90  double compute_A_ooO_contribution_to_Heff_restricted(int u_abs,int x_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
91  double compute_A_oOO_contribution_to_Heff_restricted(int u_abs,int x_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
92 
93  double compute_B_ooO_contribution_to_Heff_restricted(int U_abs,int X_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
94  double compute_B_oOO_contribution_to_Heff_restricted(int U_abs,int X_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
95  double compute_B_OOO_contribution_to_Heff_restricted(int U_abs,int X_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
96 
97  double compute_AB_ooO_contribution_to_Heff_restricted(int u_abs,int V_abs,int x_abs,int Y_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
98  double compute_AB_oOO_contribution_to_Heff_restricted(int u_abs,int V_abs,int x_abs,int Y_abs,int i_abs,int j_abs,int k_abs,int mu,BlockMatrix* T3);
99 
100 
101 
102  void form_T2_ij_a_b(IndexMatrix* T2_ij_a_b,bool spin1,bool spin2,bool transpose);
103  void form_T2_i_ab_j(IndexMatrix* T2_i_ab_j,bool spin1,bool spin2,bool transpose);
104  void form_V_k_bc_e(IndexMatrix* V_k_bc_e,double direct,double exchange);
105  void form_V_jk_c_m(IndexMatrix* V_jk_c_m,double direct,double exchange);
106 
107  void build_W_intermediates();
108  void check_intruders();
109 
111 
112  int nirreps;
113  int nrefs;
114 
115  double threshold;
116 
118 
120 
121  std::vector<std::vector<bool> > is_aocc;
122  std::vector<std::vector<bool> > is_bocc;
123  std::vector<std::vector<bool> > is_avir;
124  std::vector<std::vector<bool> > is_bvir;
125 
126  // Denominators
127  std::vector<std::vector<double> > e_oo;
128  std::vector<std::vector<double> > e_OO;
129  std::vector<std::vector<double> > e_vv;
130  std::vector<std::vector<double> > e_VV;
131 
132  std::vector<std::vector<double> > Mk_factor;
133  std::vector<double> Mk_shift;
134 
135  std::vector<double***> F_ov;
136  std::vector<double***> F_OV;
137 
138  std::vector<double***> F2_ov;
139  std::vector<double***> F2_OV;
140 
141  std::vector<double***> T1_ov;
142  std::vector<double***> T1_OV;
143 
144  std::vector<double***> W_ooov;
145  std::vector<double***> W_oOoV;
146  std::vector<double***> W_OoOv;
147  std::vector<double***> W_OOOV;
148 
149  std::vector<double***> W_vovv;
150  std::vector<double***> W_vOvV;
151  std::vector<double***> W_VoVv;
152  std::vector<double***> W_VOVV;
153 
154  double*** V_oovv;
155  double*** V_oOvV;
156 // double*** V_ooov;
157 // double*** V_oOoV;
158 // double*** V_vovv;
159 // double*** V_vOvV;
160 
161  std::vector<double***> T2_oovv;
162  std::vector<double***> T2_oOvV;
163  std::vector<double***> T2_OOVV;
164 
174 
181 
186 
191 
195 
199 
200  std::vector<double> e4T;
201  std::vector<double> e4ST;
202  std::vector<double> e4DT;
203 
204  double E4,E4T,E4ST,E4DT;
205 
206  std::vector<double> E4T_ooo;
207  std::vector<double> E4T_ooO;
208  std::vector<double> E4T_oOO;
209  std::vector<double> E4T_OOO;
210  std::vector<double> E4ST_ooo;
211  std::vector<double> E4ST_ooO;
212  std::vector<double> E4ST_oOO;
213  std::vector<double> E4ST_OOO;
214  std::vector<double> E4DT_ooo;
215  std::vector<double> E4DT_ooO;
216  std::vector<double> E4DT_oOO;
217  std::vector<double> E4DT_OOO;
218  std::vector<double> E4_ooo;
219  std::vector<double> E4_ooO;
220  std::vector<double> E4_oOO;
221  std::vector<double> E4_OOO;
222 
223  std::vector<std::vector<double> > d_h_eff;
224 };
225 
226 }} /* End Namespaces */
227 
228 #endif // _psi_src_bin_psimrcc_mrccsd_t_h_
std::vector< double *** > F_ov
Definition: mrccsd_t.h:135
double E4
Definition: mrccsd_t.h:204
std::vector< double > E4ST_oOO
Definition: mrccsd_t.h:212
void form_T2_ij_a_b(IndexMatrix *T2_ij_a_b, bool spin1, bool spin2, bool transpose)
Definition: mrccsd_t_form_matrices.cc:51
PsiReturnType psimrcc(SharedWavefunction, Options &)
Definition: psimrcc/main.cc:86
IndexMatrix * V_k_bC_E
Definition: mrccsd_t.h:194
BlockMatrix *** W
Definition: mrccsd_t.h:176
double compute_AB_oOO_contribution_to_Heff_restricted(int u_abs, int V_abs, int x_abs, int Y_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_ab_restricted.cc:180
std::vector< double > E4ST_ooo
Definition: mrccsd_t.h:210
void compute_ooO_triples()
Definition: mrccsd_t_compute.cc:401
void startup()
Definition: mrccsd_t_setup.cc:49
double compute_B_OOO_contribution_to_Heff(int U_abs, int X_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_b.cc:93
std::vector< double > E4_oOO
Definition: mrccsd_t.h:220
std::vector< std::vector< bool > > is_bvir
Definition: mrccsd_t.h:124
std::vector< double *** > W_VOVV
Definition: mrccsd_t.h:152
std::vector< double *** > T2_oOvV
Definition: mrccsd_t.h:162
void compute_spin_adapted()
Definition: mrccsd_t_compute_spin_adapted.cc:50
CCIndex * v
Definition: mrccsd_t.h:167
std::vector< double *** > W_OoOv
Definition: mrccsd_t.h:146
void build_W_intermediates()
Definition: mrccsd_t_setup.cc:602
std::vector< double > E4T_OOO
Definition: mrccsd_t.h:209
void compute_ooO_contribution_to_Heff_restricted(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_restricted.cc:52
CCIndex * o
Definition: mrccsd_t.h:165
double E4T
Definition: mrccsd_t.h:204
BlockMatrix *** W_jki
Definition: mrccsd_t.h:179
void form_T2_i_ab_j(IndexMatrix *T2_i_ab_j, bool spin1, bool spin2, bool transpose)
Definition: mrccsd_t_form_matrices.cc:99
std::vector< double > E4T_oOO
Definition: mrccsd_t.h:208
void compute_ooo_contribution_to_Heff_restricted(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_restricted.cc:35
void compute_oOO_triples()
Definition: mrccsd_t_compute.cc:559
void compute_ooo_triples_spin_adapted()
double compute_AB_oOO_contribution_to_Heff(int u_abs, int V_abs, int x_abs, int Y_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_ab.cc:124
Definition: index.h:66
Definition: pointgrp.h:105
void compute_OOO_triples_spin_adapted()
std::vector< double > E4ST_ooO
Definition: mrccsd_t.h:211
IndexMatrix * V_k_bc_e
Definition: mrccsd_t.h:192
double E4DT
Definition: mrccsd_t.h:204
CCIndex * ov
Definition: mrccsd_t.h:171
double E4ST
Definition: mrccsd_t.h:204
double compute_B_ooO_contribution_to_Heff_restricted(int U_abs, int X_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_b_restricted.cc:35
double compute_B_oOO_contribution_to_Heff(int U_abs, int X_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_b.cc:64
std::vector< double > E4ST_OOO
Definition: mrccsd_t.h:213
std::vector< double > e4ST
Definition: mrccsd_t.h:201
std::vector< std::vector< double > > e_oo
Definition: mrccsd_t.h:127
double compute_A_ooO_contribution_to_Heff_restricted(int u_abs, int x_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_a_restricted.cc:86
void compute()
Definition: mrccsd_t_compute.cc:52
MRCCSD_T(Options &options, Hamiltonian *h_eff_)
Definition: mrccsd_t.cc:34
std::vector< double *** > F_OV
Definition: mrccsd_t.h:136
std::vector< double > e4T
Definition: mrccsd_t.h:200
int nirreps
Definition: mrccsd_t.h:112
IndexMatrix * T2_IJ_A_B
Definition: mrccsd_t.h:185
double compute_A_oOO_contribution_to_Heff(int u_abs, int x_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_a.cc:89
CCIndex * ooo
Definition: mrccsd_t.h:173
std::vector< double *** > T1_ov
Definition: mrccsd_t.h:141
IndexMatrix * V_jK_C_m
Definition: mrccsd_t.h:198
IndexMatrix * T2_ij_a_b
Definition: mrccsd_t.h:182
std::vector< double > E4DT_oOO
Definition: mrccsd_t.h:216
TriplesAlgorithm
Definition: mrccsd_t.h:42
void compute_OOO_contribution_to_Heff_restricted(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_restricted.cc:104
IndexMatrix * T2_iJ_B_a
Definition: mrccsd_t.h:184
std::vector< double *** > W_vOvV
Definition: mrccsd_t.h:150
std::vector< double > E4DT_OOO
Definition: mrccsd_t.h:217
void compute_oOO_contribution_to_Heff(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff.cc:78
void compute_ooo_triples_restricted()
Definition: mrccsd_t_compute_restricted.cc:146
void compute_oOO_triples_restricted()
Definition: mrccsd_t_compute_restricted.cc:619
std::vector< std::vector< double > > d_h_eff
Definition: mrccsd_t.h:223
CCIndex * vo
Definition: mrccsd_t.h:170
std::vector< double *** > W_OOOV
Definition: mrccsd_t.h:147
TriplesAlgorithm triples_algorithm
Definition: mrccsd_t.h:117
IndexMatrix * T2_I_AB_J
Definition: mrccsd_t.h:190
std::vector< double *** > T2_OOVV
Definition: mrccsd_t.h:163
double *** V_oOvV
Definition: mrccsd_t.h:155
IndexMatrix * V_jk_c_m
Definition: mrccsd_t.h:196
Definition: special_matrices.h:62
double compute_A_oOO_contribution_to_Heff_restricted(int u_abs, int x_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_a_restricted.cc:125
std::vector< double > E4DT_ooo
Definition: mrccsd_t.h:214
void cleanup()
Definition: mrccsd_t_setup.cc:637
std::vector< double *** > F2_OV
Definition: mrccsd_t.h:139
std::vector< double *** > W_VoVv
Definition: mrccsd_t.h:151
BlockMatrix *** W_ijk
Definition: mrccsd_t.h:177
BlockMatrix *** W_ikj
Definition: mrccsd_t.h:178
void check_intruders()
Definition: mrccsd_t_setup.cc:395
void compute_restricted()
Definition: mrccsd_t_compute_restricted.cc:51
double compute_A_ooo_contribution_to_Heff_restricted(int u_abs, int x_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_a_restricted.cc:35
std::vector< double > E4_ooo
Definition: mrccsd_t.h:218
std::vector< double *** > T2_oovv
Definition: mrccsd_t.h:161
std::vector< std::vector< bool > > is_aocc
Definition: mrccsd_t.h:121
void compute_ooo_contribution_to_Heff(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff.cc:35
void compute_oOO_triples_spin_adapted()
std::vector< double > E4_ooO
Definition: mrccsd_t.h:219
std::vector< double > E4T_ooO
Definition: mrccsd_t.h:207
void form_V_jk_c_m(IndexMatrix *V_jk_c_m, double direct, double exchange)
Definition: mrccsd_t_form_matrices.cc:180
BlockMatrix *** Z
Definition: mrccsd_t.h:175
BlockMatrix *** T
Definition: mrccsd_t.h:180
void compute_OOO_triples()
Definition: mrccsd_t_compute.cc:271
IndexMatrix * V_jK_c_M
Definition: mrccsd_t.h:197
std::vector< std::vector< double > > Mk_factor
Definition: mrccsd_t.h:132
std::vector< double *** > T1_OV
Definition: mrccsd_t.h:142
Hamiltonian * h_eff
Definition: mrccsd_t.h:119
IndexMatrix * T2_iJ_a_B
Definition: mrccsd_t.h:183
Definition: liboptions.h:359
IndexMatrix * T2_i_aB_J
Definition: mrccsd_t.h:188
void compute_ooo_triples()
Definition: mrccsd_t_compute.cc:138
std::vector< double > Mk_shift
Definition: mrccsd_t.h:133
std::vector< std::vector< double > > e_VV
Definition: mrccsd_t.h:130
CCIndex * vv
Definition: mrccsd_t.h:168
Definition: heff.h:35
std::vector< double *** > W_oOoV
Definition: mrccsd_t.h:145
~MRCCSD_T()
Definition: mrccsd_t.cc:48
double *** V_oovv
Definition: mrccsd_t.h:154
CCIndex * oo
Definition: mrccsd_t.h:166
double compute_B_oOO_contribution_to_Heff_restricted(int U_abs, int X_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_b_restricted.cc:64
CCIndex * ovv
Definition: mrccsd_t.h:172
double compute_AB_ooO_contribution_to_Heff(int u_abs, int V_abs, int x_abs, int Y_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_ab.cc:35
std::vector< std::vector< bool > > is_avir
Definition: mrccsd_t.h:123
std::vector< double > e4DT
Definition: mrccsd_t.h:202
std::vector< double *** > W_ooov
Definition: mrccsd_t.h:144
double compute_B_ooO_contribution_to_Heff(int U_abs, int X_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_b.cc:35
std::vector< std::vector< double > > e_vv
Definition: mrccsd_t.h:129
double threshold
Definition: mrccsd_t.h:115
std::vector< std::vector< double > > e_OO
Definition: mrccsd_t.h:128
IndexMatrix * T2_i_ab_j
Definition: mrccsd_t.h:187
void compute_OOO_contribution_to_Heff(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff.cc:104
std::vector< std::vector< bool > > is_bocc
Definition: mrccsd_t.h:122
std::vector< double > E4_OOO
Definition: mrccsd_t.h:221
void compute_OOO_triples_restricted()
Definition: mrccsd_t_compute_restricted.cc:302
void compute_oOO_contribution_to_Heff_restricted(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_restricted.cc:78
std::vector< double > E4DT_ooO
Definition: mrccsd_t.h:215
double compute_A_ooO_contribution_to_Heff(int u_abs, int x_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_a.cc:62
std::vector< double *** > F2_ov
Definition: mrccsd_t.h:138
int nrefs
Definition: mrccsd_t.h:113
void compute_ooO_triples_restricted()
Definition: mrccsd_t_compute_restricted.cc:452
IndexMatrix * V_K_bC_e
Definition: mrccsd_t.h:193
std::vector< double *** > W_vovv
Definition: mrccsd_t.h:149
double compute_AB_ooO_contribution_to_Heff_restricted(int u_abs, int V_abs, int x_abs, int Y_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_ab_restricted.cc:36
void form_V_k_bc_e(IndexMatrix *V_k_bc_e, double direct, double exchange)
Definition: mrccsd_t_form_matrices.cc:149
void compute_ooO_triples_spin_adapted()
Definition: mrccsd_t_compute_spin_adapted.cc:112
void compute_ooO_contribution_to_Heff(int i, int j, int k, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff.cc:52
double compute_B_OOO_contribution_to_Heff_restricted(int U_abs, int X_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_b_restricted.cc:108
double compute_A_ooo_contribution_to_Heff(int u_abs, int x_abs, int i_abs, int j_abs, int k_abs, int mu, BlockMatrix *T3)
Definition: mrccsd_t_heff_a.cc:35
Definition: special_matrices.h:103
IndexMatrix * T2_J_aB_i
Definition: mrccsd_t.h:189
std::vector< double > E4T_ooo
Definition: mrccsd_t.h:206
Definition: mrccsd_t.h:40
Options & options_
Definition: mrccsd_t.h:110
CCIndex * vvv
Definition: mrccsd_t.h:169