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