# mp2r12_energy.h

    00001 //
    00002 // mp2r12_energy.h
    00003 //
    00004 // Copyright (C) 2003 Edward Valeev
    00005 //
    00006 // Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
    00007 // Maintainer: EV
    00008 //
    00009 // This file is part of the SC Toolkit.
    00010 //
    00011 // The SC Toolkit is free software; you can redistribute it and/or modify
    00012 // it under the terms of the GNU Library General Public License as published by
    00013 // the Free Software Foundation; either version 2, or (at your option)
    00014 // any later version.
    00015 //
    00016 // The SC Toolkit is distributed in the hope that it will be useful,
    00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00019 // GNU Library General Public License for more details.
    00020 //
    00021 // You should have received a copy of the GNU Library General Public License
    00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
    00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00024 //
    00025 // The U.S. Government is granted a limited license as per AL 91-7.
    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 //#include <chemistry/qc/mbptr12/vxb_eval.h>
    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   // The coefficients are stored ij by kl, where kl is the r12-multiplied pair
    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   // Initialize SCVectors and SCMatrices
    00063   void init_();
    00064
    00065   // Computes values of all 2-body products from
    00066   // space1 and space2 if electron 1 is at r1 and
    00067   // electron 2 is at r2. equiv specifies whether electrons
    00068   // are equivalent (same spin) or not
    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 // Local Variables:
    00155 // mode: c++
    00156 // c-file-style: "CLJ"
    00157 // End:
    00158
    00159