# vxb_eval_info.h

    00001 //
    00002 // vxb_eval_info.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_vxbevalinfo_h
    00033 #define _chemistry_qc_mbptr12_vxbevalinfo_h
    00034
    00035 #include <string>
    00036 #include <util/misc/string.h>
    00037 #include <util/ref/ref.h>
    00038 #include <math/scmat/abstract.h>
    00039 #include <util/group/memory.h>
    00040 #include <chemistry/molecule/energy.h>
    00041 #include <chemistry/qc/scf/scf.h>
    00042 #include <chemistry/qc/mbptr12/linearr12.h>
    00043 #include <chemistry/qc/mbptr12/moindexspace.h>
    00044 #include <chemistry/qc/mbptr12/transform_factory.h>
    00045
    00046 namespace sc {
    00047
    00048 class MBPT2_R12;
    00049
    00053 class R12IntEvalInfo : virtual public SavableState {
    00054
    00055 public:
    00056
    00058   enum StoreMethod { mem_posix = 0, posix = 1, mem_mpi = 2, mpi = 3, mem_only = 4 };
    00059
    00060 private:
    00061
    00062   Wavefunction* wfn_;     // Wavefunction that owns this
    00063   Ref<SCF> ref_;
    00064   Ref<Integral> integral_;
    00065   Ref<GaussianBasisSet> bs_;
    00066   Ref<GaussianBasisSet> bs_aux_;
    00067   Ref<GaussianBasisSet> bs_vir_;
    00068   Ref<GaussianBasisSet> bs_ri_;
    00069   Ref<SCMatrixKit> matrixkit_;
    00070   Ref<MessageGrp> msg_;
    00071   Ref<MemoryGrp> mem_;
    00072   Ref<ThreadGrp> thr_;
    00073
    00074   int nocc_;
    00075   int nfzc_;
    00076   int nfzv_;
    00077
    00078   size_t memory_;
    00079   bool dynamic_;
    00080   double print_percent_;
    00081   int debug_;
    00082   StoreMethod ints_method_;
    00083   std::string ints_file_;
    00084   LinearR12::ABSMethod abs_method_;
    00085
    00086   int nlindep_aux_;
    00087   int nlindep_vir_;
    00088   int nlindep_ri_;
    00089
    00090   Ref<MOIndexSpace> mo_space_;   // symblocked MO space
    00091   Ref<MOIndexSpace> obs_space_;  // energy-sorted MO space
    00092   Ref<MOIndexSpace> abs_space_;
    00093   Ref<MOIndexSpace> ribs_space_;
    00094   Ref<MOIndexSpace> act_occ_space_;
    00095   Ref<MOIndexSpace> occ_space_;
    00096   Ref<MOIndexSpace> occ_space_symblk_;
    00097   Ref<MOIndexSpace> act_vir_space_;
    00098   Ref<MOIndexSpace> vir_space_;
    00099   Ref<MOIndexSpace> vir_space_symblk_;
    00100   Ref<MOIntsTransformFactory> tfactory_;
    00101
    00102   // construct the RI basis based on abs_method
    00103   void construct_ri_basis_(bool safe);
    00104   void construct_ri_basis_ks_(bool safe);
    00105   void construct_ri_basis_ksplus_(bool safe);
    00106   void construct_ri_basis_ev_(bool safe);
    00107   void construct_ri_basis_evplus_(bool safe);
    00108   // Uses ri_basis to construct a basis that spans the orthogonal complement to the OBS
    00109   void construct_ortho_comp_svd_();
    00110   // Returns true if ABS spans OBS
    00111   bool abs_spans_obs_();
    00112   // Construct eigenvector and eigenvalues sorted by energy
    00113   void eigen2_();
    00114   // Construct orthog_aux_
    00115   void construct_orthog_aux_();
    00116   // Construct orthog_vir_
    00117   void construct_orthog_vir_();
    00118   // Construct orthog_ri_
    00119   void construct_orthog_ri_();
    00120
    00121 public:
    00122   R12IntEvalInfo(StateIn&);
    00124   R12IntEvalInfo(MBPT2_R12*);
    00125   ~R12IntEvalInfo();
    00126
    00127   void save_data_state(StateOut&);
    00128
    00131   void set_dynamic(bool dynamic) { dynamic_ = dynamic; };
    00133   void set_print_percent(double print_percent) { print_percent_ = print_percent; };
    00135   void set_debug_level(int debug) { debug_ = debug; };
    00138   void set_ints_method(const StoreMethod method) { ints_method_ = method; };
    00141   void set_ints_file(const std::string& filename) { ints_file_ = filename; };
    00144   void set_memory(const size_t nbytes);
    00147   void set_absmethod(LinearR12::ABSMethod abs_method);
    00148
    00149   Wavefunction* wfn() const { return wfn_; };
    00150   Ref<SCF> ref() const { return ref_; };
    00151   Ref<Integral> integral() const { return integral_; };
    00153   Ref<GaussianBasisSet> basis() const { return bs_; };
    00155   Ref<GaussianBasisSet> basis_vir() const { return bs_vir_; };
    00157   Ref<GaussianBasisSet> basis_ri() const { return bs_ri_; };
    00158   Ref<SCMatrixKit> matrixkit() const { return matrixkit_; };
    00159   Ref<MemoryGrp> mem() const { return mem_;};
    00160   Ref<MessageGrp> msg() const { return msg_;};
    00161   Ref<ThreadGrp> thr() const { return thr_;};
    00162
    00163   bool dynamic() const { return dynamic_; };
    00164   double print_percent() const { return print_percent_; };
    00165   int debug_level() const { return debug_; };
    00166   const StoreMethod ints_method() const { return ints_method_; };
    00167   const std::string& ints_file() const;
    00168   const size_t memory() const { return memory_; };
    00169
    00170   const int nocc() const { return nocc_;};
    00171   const int nocc_act() const { return nocc_ - nfzc_;};
    00172   const int nfzc() const { return nfzc_;};
    00173   const int nvir() const { return vir_space_->rank();};
    00174   const int nvir_act() const { return act_vir_space_->rank();};
    00175   const int nfzv() const { return nfzv_;};
    00176
    00177   LinearR12::ABSMethod abs_method() const { return abs_method_; };
    00178
    00180   Ref<MOIndexSpace> mo_space() const { return mo_space_; };
    00182   Ref<MOIndexSpace> obs_space() const { return obs_space_; };
    00184   Ref<MOIndexSpace> act_occ_space() const { return act_occ_space_; };
    00186   Ref<MOIndexSpace> act_vir_space() const { return act_vir_space_; };
    00188   Ref<MOIndexSpace> occ_space() const { return occ_space_; };
    00190   Ref<MOIndexSpace> occ_space_symblk() const { return occ_space_symblk_; };
    00192   Ref<MOIndexSpace> vir_space() const { return vir_space_; };
    00194   Ref<MOIndexSpace> vir_space_symblk() const { return vir_space_symblk_; };
    00196   Ref<MOIndexSpace> abs_space() const { return abs_space_; };
    00198   Ref<MOIndexSpace> ribs_space() const { return ribs_space_; };
    00200   Ref<MOIntsTransformFactory> tfactory() const { return tfactory_; };
    00201
    00203   static Ref<MOIndexSpace> orthog_comp(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2,
    00204                                 const std::string& name, double lindep_tol);
    00207   static Ref<MOIndexSpace> orthogonalize(const std::string& name, const Ref<GaussianBasisSet>& bs, const Ref<Integral>& integral,
    00208                                   OverlapOrthog::OrthogMethod orthog_method, double lindep_tol,
    00209                                   int& nlindep);
    00210
    00213   static Ref<MOIndexSpace> gen_project(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2,
    00214                                        const std::string& name, double lindep_tol);
    00215
    00217   static void compute_overlap_ints(const Ref<MOIndexSpace>& space1,
    00218                             const Ref<MOIndexSpace>& space2,
    00219                             RefSCMatrix& S);
    00221   static void compute_multipole_ints(const Ref<MOIndexSpace>& space1,
    00222                               const Ref<MOIndexSpace>& space2,
    00223                               RefSCMatrix& MX,
    00224                               RefSCMatrix& MY,
    00225                               RefSCMatrix& MZ,
    00226                               RefSCMatrix& MXX,
    00227                               RefSCMatrix& MYY,
    00228                               RefSCMatrix& MZZ);
    00229
    00230 };
    00231
    00232 }
    00233
    00234 #endif
    00235
    00236 // Local Variables:
    00237 // mode: c++
    00238 // c-file-style: "CLJ"
    00239 // End:
    00240
    00241