28 #ifndef _chemistry_qc_mbptr12_r12inteval_h
29 #define _chemistry_qc_mbptr12_r12inteval_h
31 #include <util/ref/ref.h>
32 #include <chemistry/qc/mbptr12/r12wfnworld.h>
33 #include <chemistry/qc/mbptr12/r12technology.h>
34 #include <chemistry/qc/mbptr12/twoparticlecontraction.h>
35 #include <chemistry/qc/wfn/spin.h>
36 #include <chemistry/qc/mbptr12/fixedcoefficient.h>
37 #include <chemistry/qc/mbptr12/twobodytensorinfo.h>
41 class TwoBodyMOIntsTransform;
44 class R12EnergyIntermediates;
53 static const bool USE_FOCKBUILD =
true;
84 double emp2_obs_singles_;
85 double emp2_cabs_singles_;
92 void spinadapt_mospace_labels(SpinCase1 spin, std::string&
id, std::string& name)
const;
96 void f_bra_ket(SpinCase1 spin,
172 void init_intermeds_();
174 void init_intermeds_r12_();
176 void init_intermeds_g12_();
178 void r2_contrib_to_X_new_();
196 SpinCase1 S = Alpha);
201 bool include_T =
true,
202 bool include_V =
true,
203 bool include_MV =
true);
210 const bool momentum=
false);
227 void checkpoint_()
const;
230 void contrib_to_VXB_a_();
231 void contrib_to_VXB_c_ansatz1_();
232 void contrib_to_VX_GenRefansatz2_();
233 void contrib_to_VX_GenRefansatz2_spinfree_();
235 void contrib_to_VXB_a_vbsneqobs_();
237 void contrib_to_B_DKH_a_();
240 void compute_mp2_pair_energies_(
RefSCVector& emp2pair,
246 const std::string& tform_key);
290 template <
typename DataProcess,
bool CorrFactorInBra,
bool CorrFactorInKet>
298 const std::vector<std::string>& tform_keys);
340 template <
typename DataProcessBra,
341 typename DataProcessKet,
342 typename DataProcessBraKet,
343 bool CorrFactorInBra,
344 bool CorrFactorInKet,
345 bool CorrFactorInInt>
346 DEPRECATED
void contract_tbint_tensor(
360 const std::vector<std::string>& tformkeys_bra,
361 const std::vector<std::string>& tformkeys_ket);
370 template <
bool CorrFactorInBra,
371 bool CorrFactorInKet>
372 void DEPRECATED contract_tbint_tensor(
386 const std::vector<std::string>& tformkeys_bra,
387 const std::vector<std::string>& tformkeys_ket);
394 template <
bool CorrFactorInBra,
395 bool CorrFactorInKet>
397 contract_tbint_tensor(
411 const std::vector<std::string>& tformkeys_bra,
412 const std::vector<std::string>& tformkeys_ket);
451 template <
typename DataProcessBra,
452 typename DataProcessKet,
453 bool CorrFactorInBra,
454 bool CorrFactorInKet,
455 bool CorrFactorInInt>
469 const std::vector<std::string>& tformkeys_bra,
470 const std::vector<std::string>& tformkeys_ket);
490 bool F2_only =
false);
524 void AT2_contrib_to_V_();
527 void AF12_contrib_to_B_();
530 void compute_B_gbc_();
534 void compute_B_fX_();
541 void compute_BC_ansatz1_();
542 void compute_BC_GenRefansatz2_();
543 void compute_BC_GenRefansatz2_spinfree();
550 void compute_BApp_();
553 void compute_B_DKH_();
561 double compute_emp2_obs_singles(
bool obs_singles);
566 double compute_emp2_cabs_singles();
574 double compute_emp2_cabs_singles_noncanonical(
bool vir_cabs_coupling);
578 double compute_emp2_cabs_singles_noncanonical_ccsd(
const RefSCMatrix& T1_ia_alpha,
587 void compute_amps_();
594 void globally_sum_scmatrix_(
RefSCMatrix&
A,
bool to_all_tasks =
false,
bool to_average =
false);
601 void globally_sum_scvector_(
RefSCVector&
A,
bool to_all_tasks =
false,
bool to_average =
false);
607 void globally_sum_intermeds_(
bool to_all_tasks =
false);
616 virtual void obsolete();
618 void debug(
int d) { debug_ = d; }
620 int dk()
const {
return r12world()->refwfn()->dk(); }
624 R12Technology::ABSMethod abs_method()
const {
return r12world()->r12tech()->abs_method(); }
626 bool spin_polarized()
const {
return r12world()->refwfn()->spin_polarized(); }
627 bool gbc()
const {
return r12world()->r12tech()->gbc(); }
628 bool ebc()
const {
return r12world()->r12tech()->ebc(); }
629 bool coupling()
const {
return r12world()->r12tech()->coupling(); }
630 bool compute_1rdm()
const {
return r12world()->r12tech()->compute_1rdm(); }
631 bool coupling_1rdm_f12b()
const {
return r12world()->r12tech()->coupling_1rdm_f12b(); }
632 R12Technology::StandardApproximation stdapprox()
const {
return r12world()->r12tech()->stdapprox(); }
633 bool omit_P()
const {
return r12world()->r12tech()->omit_P(); }
659 if (
r12world()->spinadapted())
return 1;
660 return ::sc::nspincases1(
r12world()->refwfn()->spin_polarized());
664 if (
r12world()->spinadapted())
return 1;
665 return ::sc::nspincases2(
r12world()->refwfn()->spin_polarized());
703 std::vector<Ref<DistArray4> >
V_distarray4(SpinCase2 spincase2,
707 std::vector<Ref<DistArray4> >
U_distarray4(SpinCase2 spincase2,
926 const std::string& operator_label = std::string())
const;
933 const std::string& operator_label = std::string())
const;
939 unsigned int f12_left,
940 unsigned int f12_right,
941 const std::string& operator_label = std::string())
const;
953 const std::string& tform_key);
965 const std::vector<std::string>& transform_keys);
973 double scale_J = 1.0,
double scale_K = 1.0,
double scale_H = 1.0,
975 int override_pauli = -1);
987 #if defined(MPQC_NEW_FEATURES)
994 void gf2_r12(
int orbital = -1);
997 void compute_TA_mp2f12_1rdm();
1004 return this->
r12world()->world()->tfactory()->orbital_registry();
1008 return this->
r12world()->world()->tfactory()->ao_registry();
1013 std::vector< Ref<DistArray4> >
1014 A_distarray4(SpinCase2 spincase2,
const Ref<R12IntEval>& r12eval);
1017 RefSCMatrix Onerdm_X_F12(SpinCase1 spin,
const Ref<R12IntEval>& r12eval,
int debug);
1020 RefSCMatrix Onerdm_X_CABS_Singles(SpinCase1 spin,
1021 const Ref<R12IntEval>& r12eval,
1022 const Ref<R12EnergyIntermediates>& r12intermediates,
DEPRECATED void compute_tbint_tensor(RefSCMatrix &T, TwoBodyOper::type tbint_type, const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2, const Ref< OrbitalSpace > &space3, const Ref< OrbitalSpace > &space4, bool antisymmetrize, const std::vector< std::string > &tform_keys)
compute_tbint_tensor computes a 2-body tensor T using integrals of type tbint_type.
const Ref< OrbitalSpace > & F_i_P(SpinCase1 S)
Form <P|F|i> space.
const Ref< OrbitalSpace > & F_i_a(SpinCase1 S)
Form <a|F|i> space.
const RefSCVector & emp2(SpinCase2 S)
Returns alpha-alpha MP2 pair energies.
const Ref< OrbitalSpace > & K_x_p(SpinCase1 S)
Form <p|K|x> space.
const Ref< OrbitalSpace > & F_m_m(SpinCase1 S)
Form <m|F|m> space.
const Ref< OrbitalSpace > & F_x_p(SpinCase1 S)
Form <p|F|x> space.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
const Ref< OrbitalSpaceRegistry > & orbital_registry() const
returns the OrbitalSpaceRegistry object
Definition: r12int_eval.h:1003
RefSCMatrix V_genref_spinfree(const Ref< OrbitalSpace > &p, const Ref< OrbitalSpace > &q)
Compute V intermediates in SF-[2]R12.
const Ref< OrbitalSpace > & K_x_P(SpinCase1 S)
Form <P|K|x> space.
const Ref< OrbitalSpace > & hj_x_A(SpinCase1 S)
Form <A|h+J|x> space.
const Ref< OrbitalSpace > & hj_i_p(SpinCase1 S)
Form <p|h+J|i> space.
const Ref< OrbitalSpace > & F_x_P(SpinCase1 S)
Form <P|F|x> space.
const Ref< OrbitalSpace > & F_gg_P(SpinCase1 S)
Form <P|F|gg> space.
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
const Ref< OrbitalSpace > & K_p_m(SpinCase1 S)
Form <m|K|p> space.
const Ref< OrbitalSpace > & F_x_A(SpinCase1 S)
Form <A|F|x> space.
const Ref< OrbitalSpace > & K_i_A(SpinCase1 S)
Form <A|K|i> space.
const Ref< OrbitalSpace > & hj_P_P(SpinCase1 S)
Form <P|h+J|P> space.
const Ref< OrbitalSpace > & Fgamma_p_P()
Form <P|Fgamma|p> space using spin-average rdm1.
RefSymmSCMatrix ordm() const
Returns the total 1-RDM in the `‘MO’' basis (i.e. that provided by orbs() )
std::vector< Ref< DistArray4 > > U_distarray4(SpinCase2 spincase2, const Ref< OrbitalSpace > &p, const Ref< OrbitalSpace > &q)
Compute .
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
void compute_T2_(RefSCMatrix &T2, const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2, const Ref< OrbitalSpace > &space3, const Ref< OrbitalSpace > &space4, bool antisymmetrize, const std::string &tform_key)
Compute T2 amplitude in basis <space1, space3 | space2, space4>.
double emp2_obs_singles()
Returns the OBS singles correction to the MP2 energy.
A template class that maintains references counts.
Definition: ref.h:361
RefSCDimension dim_aa(SpinCase2 S) const
Dimension for any/any pairs of spin case S.
Definition: r12int_eval.h:649
const Ref< OrbitalSpace > & F_P_P(SpinCase1 S)
Form <P|F|P> space.
const Ref< OrbitalSpace > & K_p_p(SpinCase1 S)
Form <p|K|p> space.
Definition: reftestx.h:32
const Ref< AOSpaceRegistry > & ao_registry() const
returns the AOSpaceRegistry object
Definition: r12int_eval.h:1007
Ref< R12Amplitudes > amps()
Returns amplitudes of pair correlation functions.
const Ref< OrbitalSpace > & hj_p_a(SpinCase1 S)
Form <a|h+J|p> space.
const RefSCMatrix & A(SpinCase2 S)
Returns S block of intermediate A.
const Ref< OrbitalSpace > & hj_i_A(SpinCase1 S)
Form <A|h+J|i> space.
const Ref< OrbitalSpace > & K_a_a(SpinCase1 S)
Form <a|K|a> space.
int nspincases1() const
Returns the number of unique spin cases.
Definition: r12int_eval.h:658
virtual void compute()
This function causes the intermediate matrices to be computed.
RefSCDimension dim_gg(SpinCase2 S) const
Dimension of orbital product space from which geminal substitutions are allowed.
Definition: r12int_eval.h:655
RefSCMatrix fock(const Ref< OrbitalSpace > &bra_space, const Ref< OrbitalSpace > &ket_space, SpinCase1 S=Alpha, double scale_J=1.0, double scale_K=1.0, double scale_H=1.0, int override_pauli=-1)
Compute the Fock matrix between bra_ and ket_ spaces of spin S.
const Ref< OrbitalSpace > & F_p_a(SpinCase1 S)
Form <a|F|p> space.
void compute_F12_(RefSCMatrix &F12, const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2, const Ref< OrbitalSpace > &space3, const Ref< OrbitalSpace > &space4, bool antisymmetrize, const std::vector< std::string > &transform_keys)
Compute F12 integrals in basis <space1, space3 | f12 | space2, space4>.
const Ref< OrbitalSpace > & cabs_space_canonical(SpinCase1 s)
compute canonical CABS space for spin s
double emp2_cabs_singles(bool vir_cabs_coupling=true)
Returns the CABS singles correction to the MP2 energy.
RefSymmSCMatrix X()
Returns spin-free intermediate X.
const Ref< OrbitalSpace > & K_A_P(SpinCase1 S)
Form <P|K|A> space.
std::vector< Ref< DistArray4 > > V_distarray4(SpinCase2 spincase2, const Ref< OrbitalSpace > &p, const Ref< OrbitalSpace > &q)
Compute .
RefSymmSCMatrix B()
Returns spin-free intermediate B.
const Ref< OrbitalSpace > & hj_m_m(SpinCase1 S)
Form <m|h+J|m> space.
const Ref< OrbitalSpace > & cabs_space_hcanonical(SpinCase1 s)
compute CABS space for spin s canonicalized by diagonalization of core hamitonian
const Ref< OrbitalSpace > & hj_a_A(SpinCase1 S)
Form <A|h+J|a> space.
const Ref< OrbitalSpace > & F_p_p(SpinCase1 S)
Form <p|F|p> space.
const Ref< OrbitalSpace > & hj_x_p(SpinCase1 S)
Form <p|h+J|x> space.
bool bc() const
does Brillouin condition hold?
RefSymmSCMatrix P(SpinCase2 S)
Compute P = RgR.
RefSCDimension dim_vv(SpinCase2 S) const
Dimension for active-vir/active-vir pairs of spin case S.
Definition: r12int_eval.h:647
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:152
const Ref< OrbitalSpace > & orbs(SpinCase1 S) const
Returns the OBS space for spin case S.
const Ref< OrbitalSpace > & F_x_m(SpinCase1 S)
Form <m|F|x> space.
Ref< OrbitalSpace > obtensor_p_A(const RefSCMatrix &obtensor, SpinCase1 S)
Form <A|obtensor|p> space obtensor should have the dimension ncabs*norbs.
const Ref< OrbitalSpace > & F_a_A(SpinCase1 S)
Form <A|F|a> space.
const Ref< OrbitalSpace > & J_P_P(SpinCase1 S)
Form <P|J|P> space.
const Ref< OrbitalSpace > & hj_p_A(SpinCase1 S)
Form <A|h+J|p> space.
const Ref< OrbitalSpace > & F_i_p(SpinCase1 S)
Form <p|F|i> space.
const Ref< OrbitalSpace > & gamma_p_p_av()
Form spin-average <p|gamma|p> space using average (instead of total) rdm.
const Ref< OrbitalSpace > & F_p_P(SpinCase1 S)
Form <P|F|p> space.
RefSCDimension dim_f12(SpinCase2 S) const
Dimension for geminal functions of spin case S = # of correlation factors x dim_GG.
Definition: r12int_eval.h:651
const Ref< OrbitalSpace > & vir(SpinCase1 S) const
Returns the vir space for spin case S.
const Ref< OrbitalSpace > & F_i_A(SpinCase1 S)
Form <A|F|i> space.
const Ref< OrbitalSpace > & hj_i_P(SpinCase1 S)
Form <P|h+J|i> space.
const RefSCMatrix & F12(SpinCase2 S)
Returns S block of intermediate F12.
const Ref< OrbitalSpace > & F_p_m(SpinCase1 S)
Form <m|F|p> space.
const Ref< OrbitalSpace > & K_i_P(SpinCase1 S)
Form <P|K|i> space.
const Ref< OrbitalSpace > & K_x_a(SpinCase1 S)
Form <a|K|x> space.
const RefSCMatrix & T1_cabs(SpinCase1 spin) const
returns CABS singles amplitudes.
const Ref< OrbitalSpace > & occ(SpinCase1 S) const
Returns the occ space for spin case S.
const Ref< OrbitalSpace > & hj_i_m(SpinCase1 S)
Form <m|h+J|i> space.
const Ref< OrbitalSpace > & F_i_m(SpinCase1 S)
Form <m|F|i> space.
const RefSCMatrix & V()
Returns spin-free intermediate V.
const Ref< OrbitalSpace > & K_i_p(SpinCase1 S)
Form <p|K|i> space.
const Ref< OrbitalSpace > & hj_p_m(SpinCase1 S)
Form <m|h+J|p> space.
RefSCMatrix V_cabs(SpinCase2 spincase2, const Ref< OrbitalSpace > &p, const Ref< OrbitalSpace > &q)
Compute V intermediates using CABS/CABS+ approach.
const Ref< OrbitalSpace > & K_p_P(SpinCase1 S)
Form <P|K|p> space.
const Ref< OrbitalSpace > & hj_p_P(SpinCase1 S)
Form <P|h+J|p> space.
RefSCDimension dim_GG(SpinCase2 S) const
Dimension of orbital product space that multiply the correlation factor to produce geminal functions.
Definition: r12int_eval.h:653
const Ref< OrbitalSpace > & J_i_P(SpinCase1 S)
Form <P|J|i> space.
const Ref< OrbitalSpace > & occ_act(SpinCase1 S) const
Returns the act occ space for spin case S.
const Ref< R12WavefunctionWorld > & r12world() const
the R12World in which this object lives
Definition: r12int_eval.h:642
const Ref< OrbitalSpace > & F_p_A(SpinCase1 S)
Form <A|F|p> space.
const Ref< OrbitalSpace > & K_x_m(SpinCase1 S)
Form <i|K|x> space.
const Ref< OrbitalSpace > & hj_p_p(SpinCase1 S)
Form <p|h+J|p> space.
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
Definition: stateout.h:71
const Ref< OrbitalSpace > & J_x_p(SpinCase1 S)
Form <p|J|x> space.
Provides information about the type of a two body tensor.
Definition: twobodytensorinfo.h:37
const Ref< OrbitalSpace > & K_p_A(SpinCase1 S)
Form <A|K|p> space.
int nspincases2() const
Returns the number of unique combinations of 2 spin cases.
Definition: r12int_eval.h:663
const Ref< OrbitalSpace > & K_i_a(SpinCase1 S)
Form <a|K|i> space.
const Ref< OrbitalSpace > & ggspace(SpinCase1 S) const
Returns the space for spin case S from which geminal-generating substitutions are allowed.
const Ref< OrbitalSpace > & F_m_P(SpinCase1 S)
Form <P|F|m> space.
const Ref< OrbitalSpace > & hj_x_P(SpinCase1 S)
Form <P|h+J|x> space.
const Ref< OrbitalSpace > & K_m_a(SpinCase1 S)
Form <a|K|m> space.
type
types of known two-body operators
Definition: operator.h:318
const Ref< OrbitalSpace > & vir_act(SpinCase1 S) const
Returns the act vir space for spin case S.
double C_CuspConsistent(int i, int j, int k, int l, SpinCase2 pairspin)
Returns the cusp consistent coefficient .
const Ref< OrbitalSpace > & hj_i_a(SpinCase1 S)
Form <a|h+J|i> space.
const Ref< OrbitalSpace > & F_m_A(SpinCase1 S)
Form <A|F|m> space.
const Ref< OrbitalSpace > & K_x_A(SpinCase1 S)
Form <A|K|x> space.
const Ref< OrbitalSpace > & K_a_p(SpinCase1 S)
Form <p|K|a> space.
const Ref< OrbitalSpace > & K_P_P(SpinCase1 S)
Form <P|K|P> space.
const Ref< OrbitalSpace > & K_p_a(SpinCase1 S)
Form <a|K|p> space.
RefSCDimension dim_oo(SpinCase2 S) const
Dimension for active-occ/active-occ pairs of spin case S.
Definition: r12int_eval.h:645
const Ref< OrbitalSpace > & J_i_p(SpinCase1 S)
Form <p|J|i> space.
const Ref< OrbitalSpace > & hj_x_m(SpinCase1 S)
Form <m|h+J|x> space.
const Ref< OrbitalSpace > & F_a_a(SpinCase1 S)
Form <a|F|a> space.
RefSymmSCMatrix ordm_av() const
Returns the average 1-RDM in the `‘MO’' basis (i.e. that provided by orbs() ): (alpha-rdm1 + beta-rdm...
const Ref< OrbitalSpace > & GGspace(SpinCase1 S) const
Returns the geminal-generating orbital space for spin case S.
Base class for objects that can save/restore state.
Definition: state.h:45
const Ref< OrbitalSpace > & hj_m_p(SpinCase1 S)
Form <p|h+J|m> space.
const Ref< OrbitalSpace > & F_x_a(SpinCase1 S)
Form <a|F|x> space.
RefSymmSCMatrix BB(SpinCase2 S)
Returns S block of the difference between intermediate B of approximations B and A'.
const Ref< OrbitalSpace > & h_P_P(SpinCase1 S)
Form <P|h|P> space.
const Ref< OrbitalSpace > & F_m_a(SpinCase1 S)
Form <a|F|m> space.
void antisymmetrize(RefSCMatrix &Aanti, const RefSCMatrix &A, const Ref< OrbitalSpace > &bra, const Ref< OrbitalSpace > &ket, bool accumulate=false)
Antisymmetrizes 4-index quantity <ij|A|kl> -> <ij|A|kl> - <ij|A|lk> and saves to Aanti.
const Ref< OrbitalSpace > & gamma_p_p(SpinCase1 S)
Form <p|gamma|p> space.
const RefSCMatrix & T2(SpinCase2 S)
Returns S block of intermediate T2.
const Ref< OrbitalSpace > & F_A_A(SpinCase1 S)
Form <A|F|A> space.
void contract_tbint_tensors_to_obtensor(RefSCMatrix &T, SpinCase2 pairspin, TwoBodyTensorInfo tbtensor_type_bra, TwoBodyTensorInfo tbtensor_type_ket, const Ref< OrbitalSpace > &space1_bra, const Ref< OrbitalSpace > &space1_intb, const Ref< OrbitalSpace > &space2_intb, const Ref< OrbitalSpace > &space3_intb, const Ref< OrbitalSpace > &space1_ket, const Ref< OrbitalSpace > &space1_intk, const Ref< OrbitalSpace > &space2_intk, const Ref< OrbitalSpace > &space3_intk, const Ref< mbptr12::TwoParticleContraction > &tpcontract, const std::vector< std::string > &tformkeys_bra, const std::vector< std::string > &tformkeys_ket)
<space1bra space1_intb |Tbra| space2_intb space3_intb> * <space2_intk space3_intk |Tket| space1ket sp...
Definition: contract_tbint_tensors_to_obtensor.h:46
const Ref< OrbitalSpace > & hj_x_a(SpinCase1 S)
Form <a|h+J|x> space.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
std::string transform_label(const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2, const Ref< OrbitalSpace > &space3, const Ref< OrbitalSpace > &space4, const std::string &operator_label=std::string()) const
Generates canonical id for transform. no correlation function included.
const Ref< OrbitalSpace > & K_i_m(SpinCase1 S)
Form <m|K|i> space.
R12IntEval is the top-level class which computes intermediates occuring in R12 theories.
Definition: r12int_eval.h:50
const Ref< OrbitalSpace > & F_m_p(SpinCase1 S)
Form <p|F|m> space.
const Ref< OrbitalSpace > & K_a_P(SpinCase1 S)
Form <P|K|a> space.
Generated at Sun Jan 26 2020 23:23:59 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.