|
MPQC
3.0.0-alpha
|
00001 // 00002 // ccr12_triples.h : computes unconventional triples correction to (T) model 00003 // 00004 // Copyright (C) 2009 Toru Shiozaki 00005 // 00006 // Author: Toru Shiozaki <shiozaki.toru@gmail.com> 00007 // Maintainer: TS 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 #pragma once 00029 #ifndef __chemistry_qc_ccr12_ccr12_triples_h 00030 #define __chemistry_qc_ccr12_ccr12_triples_h 00031 00032 #include <chemistry/qc/ccr12/ccr12_info.h> 00033 #include <iostream> 00034 00035 00036 //define this when GGspace = ip is to be used. 00037 #define USE_GG_SPACE_EQ_IP 00038 00039 namespace sc { 00040 00041 class CCR12_Triples : virtual public RefCount { 00042 protected: 00043 CCR12_Info* z; 00044 00045 Ref<Tensor> singles_intermediate_; 00046 Ref<Tensor> doubles_intermediate_; 00047 Ref<Tensor> rhs_intermediate_; 00048 Ref<Tensor> lhs_intermediate_; 00049 00050 // Prediagonalization scheme 00051 // only for ii cases. 00052 void prediagon(); 00053 void fill_in_ltensors(); 00054 int pair_size_; 00055 00056 RefDiagSCMatrix bdiag_; 00057 RefSCMatrix lmatrix_; 00058 Ref<Tensor> ltensor1_; 00059 Ref<Tensor> ltensor2_; 00060 00061 // Two cases. From here... 00062 // for GGspace = ii 00063 void singles(); 00064 void doubles(); 00065 void denom_contraction(); 00066 void denom_contraction_new(); 00067 void offset_hhphhh(Ref<Tensor>&); 00068 double get_energy(); 00069 // for GGspace = ip 00070 void doubles_ig(Ref<Tensor>& out); 00071 void singles_ig(Ref<Tensor>& out); 00072 void denom_contraction_ig(); 00073 void offset_hgphhh(Ref<Tensor>&); 00074 double get_energy_ig(); 00075 // to here... 00076 00077 void offset_bphhh(Ref<Tensor>&); 00078 00079 public: 00080 CCR12_Triples(CCR12_Info* inz) : z(inz) {}; 00081 ~CCR12_Triples() {}; 00082 00083 double compute(); 00084 00085 }; 00086 00087 } 00088 00089 #endif 00090