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