00001 // 00002 // df.h 00003 // 00004 // Copyright (C) 2009 Edward Valeev 00005 // 00006 // Author: Edward Valeev <evaleev@vt.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 _mpqc_src_lib_chemistry_qc_df_df_h 00033 #define _mpqc_src_lib_chemistry_qc_df_df_h 00034 00035 #include <util/state/state.h> 00036 #include <util/misc/compute.h> 00037 #include <math/scmat/result.h> 00038 #include <chemistry/qc/basis/integral.h> 00039 00040 namespace sc { 00041 00042 namespace test { 00043 00050 class BasisProductDecomposition: virtual public SavableState { 00051 public: 00052 ~BasisProductDecomposition(); 00053 BasisProductDecomposition(const Ref<Integral>& integral, const Ref< 00054 GaussianBasisSet>& basis1, const Ref<GaussianBasisSet>& basis2); 00055 BasisProductDecomposition(StateIn&); 00056 void save_data_state(StateOut&); 00057 00059 virtual const RefSCMatrix& C() const =0; 00060 00061 const Ref<Integral>& integral() const { 00062 return integral_; 00063 } 00064 const Ref<GaussianBasisSet>& basis(unsigned int i) const { 00065 return basis_[i]; 00066 } 00067 00068 virtual void compute() =0; 00069 00070 protected: 00071 const RefSCDimension& product_dimension() const { 00072 return pdim_; 00073 } 00074 00075 private: 00076 RefSCDimension pdim_; //< basis product dimension 00077 00078 Ref<Integral> integral_; 00079 Ref<GaussianBasisSet> basis_[2]; 00080 00081 }; 00082 00093 class DensityFitting: public BasisProductDecomposition { 00094 public: 00095 ~DensityFitting(); 00096 DensityFitting(const Ref<Integral>& integral, const Ref< 00097 GaussianBasisSet>& basis1, const Ref<GaussianBasisSet>& basis2, 00098 const Ref<GaussianBasisSet>& fitting_basis); 00099 DensityFitting(StateIn&); 00100 void save_data_state(StateOut&); 00101 00102 const RefSCMatrix& C() const { 00103 return C_; 00104 } 00106 const RefSymmSCMatrix& kernel() const { 00107 return kernel_; 00108 } 00110 const RefSCMatrix& conjugateC() const { 00111 return cC_; 00112 } 00113 00114 // implements BasisProductDecomposition::compute() 00115 void compute(); 00116 00117 private: 00118 RefSCMatrix C_; 00119 RefSymmSCMatrix kernel_; 00120 RefSCMatrix cC_; 00121 00122 Ref<GaussianBasisSet> fbasis_; 00123 00124 }; 00125 00126 } // end of namespace test 00127 00128 } // end of namespace sc 00129 00130 #endif // end of header guard 00131 00132 // Local Variables: 00133 // mode: c++ 00134 // c-file-style: "CLJ-CONDENSED" 00135 // End: