28 #ifndef _mpqc_src_lib_chemistry_qc_mbptr12_pt2r12_h
29 #define _mpqc_src_lib_chemistry_qc_mbptr12_pt2r12_h
31 #include <chemistry/qc/wfn/wfn.h>
32 #include <chemistry/qc/wfn/spin.h>
33 #include <chemistry/qc/mbptr12/r12wfnworld.h>
34 #include <chemistry/qc/mbptr12/r12int_eval.h>
35 #include <chemistry/qc/wfn/rdm.h>
38 #if defined(MPQC_NEW_FEATURES)
39 #include <chemistry/qc/mbptr12/sr_r12intermediates.h>
40 #include <chemistry/qc/mbptr12/singles_casscf.h>
90 RefSCMatrix transform_MO();
100 enum Tensor4_Permute {Permute23 =1, Permute34 = 2, Permute14 = 3};
101 static double ref_to_pt2r12_acc() {
return 0.01; }
103 Ref< RDM<Two> > rdm2_;
104 Ref< RDM<One> > rdm1_;
105 Ref<R12IntEval> r12eval_;
106 Ref<R12WavefunctionWorld> r12world_;
110 bool pt2_correction_;
112 std::string cabs_singles_h0_;
114 bool cabs_singles_coupling_;
120 std::vector<double> B_;
121 std::vector<double> X_;
122 std::vector<double> V_;
125 RefSymmSCMatrix rdm1(SpinCase1 spin);
127 RefSymmSCMatrix rdm2(SpinCase2 spin);
129 RefSymmSCMatrix lambda2(SpinCase2 spin);
131 RefSymmSCMatrix rdm1_gg(SpinCase1 spin);
133 RefSymmSCMatrix rdm2_gg(SpinCase2 spin);
135 RefSymmSCMatrix lambda2_gg(SpinCase2 spin);
137 RefSymmSCMatrix _rdm2_to_gg(SpinCase2 spin,
138 RefSymmSCMatrix input);
141 RefSCMatrix C(SpinCase2 S);
143 RefSCMatrix V_genref_projector2(SpinCase2 pairspin);
144 RefSCMatrix V_transformed_by_C(SpinCase2 pairspin);
145 RefSymmSCMatrix X_transformed_by_C(SpinCase2 pairspin);
146 RefSymmSCMatrix B_transformed_by_C(SpinCase2 pairspin);
148 double compute_DC_energy_GenRefansatz2();
151 double energy_PT2R12_projector1(SpinCase2 pairspin);
152 double energy_PT2R12_projector2(SpinCase2 pairspin);
155 template<Tensor4_Permute HowPermute>
156 RefSCMatrix RefSCMAT4_permu(RefSCMatrix rdm2_4space_int,
157 const Ref<OrbitalSpace> b1space,
158 const Ref<OrbitalSpace> b2space,
159 const Ref<OrbitalSpace> k1space,
160 const Ref<OrbitalSpace> k2space);
165 double cabs_singles_Fock(SpinCase1 spin);
167 double cabs_singles_Dyall();
170 RefSymmSCMatrix hcore_mo();
171 RefSymmSCMatrix hcore_mo(SpinCase1 spin);
173 RefSCMatrix moints(SpinCase2 pairspin = AlphaBeta);
175 RefSCMatrix g(SpinCase2 pairspin,
176 const Ref<OrbitalSpace>& space1,
177 const Ref<OrbitalSpace>& space2);
179 RefSCMatrix g(SpinCase2 pairspin,
180 const Ref<OrbitalSpace>& bra1,
181 const Ref<OrbitalSpace>& bra2,
182 const Ref<OrbitalSpace>& ket1,
183 const Ref<OrbitalSpace>& ket2);
187 RefSCMatrix f(SpinCase1 spin);
196 RefSymmSCMatrix phi_cumulant(SpinCase2 pairspin);
198 RefSymmSCMatrix phi_gg(SpinCase2 spin);
201 double energy_recomputed_from_densities();
204 void brillouin_matrix();
210 double compute_energy(
const RefSCMatrix &hmat,
212 bool print_pair_energies =
true,
266 RefSCMatrix transform_MO();
276 enum Tensor4_Permute {Permute23 =1, Permute34 = 2, Permute14 = 3};
277 static double ref_to_pt2r12_acc() {
return 0.01; }
279 Ref< SpinFreeRDM<Two> > rdm2_;
280 Ref< SpinFreeRDM<One> > rdm1_;
281 Ref<R12IntEval> r12eval_;
282 Ref<R12WavefunctionWorld> r12world_;
285 bool pt2_correction_;
287 #if defined(MPQC_NEW_FEATURES)
289 std::string cabs_singles_h0_;
294 bool cabs_singles_coupling_;
296 std::shared_ptr<CabsSingles> cabs_singles_engine_;
302 std::vector<double> B_;
303 std::vector<double> X_;
304 std::vector<double> V_;
310 RefSymmSCMatrix rdm1();
312 RefSymmSCMatrix rdm2();
314 RefSymmSCMatrix rdm1_gg();
316 RefSymmSCMatrix rdm2_gg();
318 RefSymmSCMatrix _rdm2_to_gg(RefSymmSCMatrix input);
324 double compute_DC_energy_GenRefansatz2();
327 double energy_PT2R12_projector2();
328 RefSCMatrix V_genref_projector2();
330 RefSCMatrix X_term_Gamma_F_T();
331 RefSymmSCMatrix X_transformed_by_C();
332 RefSCMatrix B_others();
335 RefSCMatrix rdm1_gg_sf();
336 RefSymmSCMatrix rdm1_sf();
337 RefSymmSCMatrix rdm1_sf_transform();
338 RefSCMatrix rdm1_sf_2spaces(
const Ref<OrbitalSpace> bspace,
const Ref<OrbitalSpace> kspace);
340 RefSymmSCMatrix rdm2_sf();
342 RefSCMatrix rdm2_sf_4spaces(
const Ref<OrbitalSpace> b1space,
const Ref<OrbitalSpace> b2space,
const Ref<OrbitalSpace> k1space,
const Ref<OrbitalSpace> k2space);
344 RefSCMatrix rdm2_sf_4spaces_int(
const double a,
const double b,
double const c,
345 const Ref<OrbitalSpace> b1space,
346 const Ref<OrbitalSpace> b2space,
347 const Ref<OrbitalSpace> k1space,
348 const Ref<OrbitalSpace> k2space);
351 template<Tensor4_Permute HowPermute>
352 RefSCMatrix RefSCMAT4_permu(RefSCMatrix rdm2_4space_int,
353 const Ref<OrbitalSpace> b1space,
354 const Ref<OrbitalSpace> b2space,
355 const Ref<OrbitalSpace> k1space,
356 const Ref<OrbitalSpace> k2space);
360 RefSymmSCMatrix hcore_mo();
362 RefSCMatrix moints();
364 RefSCMatrix g(
const Ref<OrbitalSpace>& space1,
365 const Ref<OrbitalSpace>& space2);
367 RefSCMatrix g(
const Ref<OrbitalSpace>& bra1,
368 const Ref<OrbitalSpace>& bra2,
369 const Ref<OrbitalSpace>& ket1,
370 const Ref<OrbitalSpace>& ket2);
377 double energy_recomputed_from_densities();
380 void brillouin_matrix();
385 double compute_energy(
const RefSCMatrix &hmat,
386 bool print_pair_energies =
true,
391 std::pair<double,double> energy_PT2R12_projector2_mpqc3();
392 #if defined(MPQC_NEW_FEATURES)
394 std::shared_ptr< SingleReference_R12Intermediates<double> > srr12intrmds_;
399 void shutdown_mpqc3();
402 auto _Tg(
const std::string& key) -> decltype(srr12intrmds_->_Tg(key)) {
403 return srr12intrmds_->_Tg(key);
405 auto _4(
const std::string& key) -> decltype(srr12intrmds_->_4(key)) {
406 return srr12intrmds_->_4(key);
408 auto _2(
const std::string& key) -> decltype(srr12intrmds_->_2(key)) {
409 return srr12intrmds_->_2(key);
411 auto V_sf(
bool b) -> decltype(srr12intrmds_->V_spinfree(b)) {
412 return srr12intrmds_->V_spinfree(b);
414 auto X_sf(
bool b) -> decltype(srr12intrmds_->X_spinfree(b)) {
415 return srr12intrmds_->X_spinfree(b);
417 auto B_sf(
bool b) -> decltype(srr12intrmds_->B_spinfree(b)) {
418 return srr12intrmds_->B_spinfree(b);
425 ParsedTwoBodyFourCenterIntKey pkey(key);
426 const std::string annotation = pkey.bra1() +
"," + pkey.bra2() +
"," + pkey.ket1() +
"," + pkey.ket2();
428 return srr12intrmds_->ijxy(key);
435 ParsedOneBodyIntKey pkey(key);
436 const std::string annotation = pkey.bra() +
"," + pkey.ket();
438 return srr12intrmds_->xy(key);
449 #endif // end of header guard