00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifdef __GNUG__
00029 #pragma interface
00030 #endif
00031
00032 #ifndef _chemistry_qc_mbptr12_mp2r12energy_h
00033 #define _chemistry_qc_mbptr12_mp2r12energy_h
00034
00035 #include <util/ref/ref.h>
00036 #include <chemistry/qc/mbptr12/linearr12.h>
00037
00038 #include <chemistry/qc/mbptr12/r12int_eval.h>
00039 #include <chemistry/qc/mbptr12/twobodygrid.h>
00040
00041 namespace sc {
00042
00045 class MP2R12Energy : virtual public SavableState {
00046
00047 Ref<R12IntEval> r12eval_;
00048 LinearR12::StandardApproximation stdapprox_;
00049 bool ebc_;
00050 int debug_;
00051 bool evaluated_;
00052
00053 RefSCVector er12_aa_, er12_ab_, emp2r12_aa_, emp2r12_ab_;
00054
00055 RefSCMatrix Caa_, Cab_;
00056
00057 double emp2tot_aa_() const;
00058 double emp2tot_ab_() const;
00059 double er12tot_aa_();
00060 double er12tot_ab_();
00061
00062
00063 void init_();
00064
00065
00066
00067
00068
00069 RefSCVector compute_2body_values_(bool equiv, const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2,
00070 const SCVector3& r1, const SCVector3& r2) const;
00071
00072 public:
00073
00074 MP2R12Energy(StateIn&);
00075 MP2R12Energy(Ref<R12IntEval>& r12eval, LinearR12::StandardApproximation stdapp, int debug);
00076 ~MP2R12Energy();
00077
00078 void save_data_state(StateOut&);
00079 void obsolete();
00080 void print(std::ostream&o=ExEnv::out0()) const;
00081 void print_pair_energies(bool spinadapted, std::ostream&so=ExEnv::out0());
00082
00083 Ref<R12IntEval> r12eval() const;
00084 LinearR12::StandardApproximation stdapp() const;
00087 bool gbc() const;
00090 bool ebc() const;
00091 void set_debug(int debug);
00092 int get_debug() const;
00093
00094 RefSCDimension dim_aa() const;
00095 RefSCDimension dim_ab() const;
00096 RefSCDimension dim_s() const;
00097 RefSCDimension dim_t() const;
00098
00100 void compute();
00103 double compute_pair_function_aa(int ij, const SCVector3& r1, const SCVector3& r2);
00106 double compute_pair_function_ab(int ij, const SCVector3& r1, const SCVector3& r2);
00108 void compute_pair_function_aa(int ij, const Ref<TwoBodyGrid>& tbgrid);
00110 void compute_pair_function_ab(int ij, const Ref<TwoBodyGrid>& tbgrid);
00111
00113 RefSCVector emp2_aa() const;
00115 RefSCVector emp2_ab() const;
00117 RefSCVector er12_aa() const;
00119 RefSCVector er12_ab() const;
00121 RefSCVector emp2r12_aa() const;
00123 RefSCVector emp2r12_ab() const;
00125 double energy();
00126
00131 RefSCMatrix C_aa();
00136 RefSCMatrix C_ab();
00141 RefSCMatrix T2_aa();
00146 RefSCMatrix T2_ab();
00147
00148 };
00149
00150 }
00151
00152 #endif
00153
00154
00155
00156
00157
00158
00159