<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>mbpt.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Generated by Doxygen 1.2.5 on Mon Oct 14 14:16:37 2002 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>mbpt.h</h1><div class="fragment"><pre>00001 <font class="comment">//</font> 00002 <font class="comment">// mbpt.h</font> 00003 <font class="comment">//</font> 00004 <font class="comment">// Copyright (C) 1996 Limit Point Systems, Inc.</font> 00005 <font class="comment">//</font> 00006 <font class="comment">// Author: Ida Nielsen <ibniels@kemi.aau.dk></font> 00007 <font class="comment">// Maintainer: LPS</font> 00008 <font class="comment">//</font> 00009 <font class="comment">// This file is part of the SC Toolkit.</font> 00010 <font class="comment">//</font> 00011 <font class="comment">// The SC Toolkit is free software; you can redistribute it and/or modify</font> 00012 <font class="comment">// it under the terms of the GNU Library General Public License as published by</font> 00013 <font class="comment">// the Free Software Foundation; either version 2, or (at your option)</font> 00014 <font class="comment">// any later version.</font> 00015 <font class="comment">//</font> 00016 <font class="comment">// The SC Toolkit is distributed in the hope that it will be useful,</font> 00017 <font class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</font> 00018 <font class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</font> 00019 <font class="comment">// GNU Library General Public License for more details.</font> 00020 <font class="comment">//</font> 00021 <font class="comment">// You should have received a copy of the GNU Library General Public License</font> 00022 <font class="comment">// along with the SC Toolkit; see the file COPYING.LIB. If not, write to</font> 00023 <font class="comment">// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.</font> 00024 <font class="comment">//</font> 00025 <font class="comment">// The U.S. Government is granted a limited license as per AL 91-7.</font> 00026 <font class="comment">//</font> 00027 00028 <font class="preprocessor">#ifndef _chemistry_qc_mbpt_mbpt_h</font> 00029 <font class="preprocessor"></font><font class="preprocessor">#define _chemistry_qc_mbpt_mbpt_h</font> 00030 <font class="preprocessor"></font> 00031 <font class="preprocessor">#ifdef __GNUC__</font> 00032 <font class="preprocessor"></font><font class="preprocessor">#pragma interface</font> 00033 <font class="preprocessor"></font><font class="preprocessor">#endif</font> 00034 <font class="preprocessor"></font> 00035 <font class="preprocessor">#include <util/group/memory.h></font> 00036 <font class="preprocessor">#include <util/group/message.h></font> 00037 <font class="preprocessor">#include <util/group/thread.h></font> 00038 <font class="preprocessor">#include <chemistry/qc/basis/obint.h></font> 00039 <font class="preprocessor">#include <chemistry/qc/basis/tbint.h></font> 00040 <font class="preprocessor">#include <chemistry/qc/scf/scf.h></font> 00041 00042 <font class="keyword">namespace </font>sc { 00043 00044 <font class="comment">// //////////////////////////////////////////////////////////////////////////</font> 00045 <a name="l00048"></a><a class="code" href="class_sc__MBPT2.html">00048</a> <font class="keyword">class </font>MBPT2: <font class="keyword">public</font> Wavefunction { 00049 <font class="keyword">protected</font>: 00050 <font class="preprocessor">#define ref_to_mp2_acc 100.0</font> 00051 <font class="preprocessor"></font> 00052 Ref<SCF> reference_; 00053 Ref<MemoryGrp> mem; 00054 <font class="keywordtype">int</font> nfzc, nfzv; 00055 size_t mem_alloc; 00056 00057 <font class="keywordtype">double</font> cphf_epsilon_; 00058 <font class="keywordtype">int</font> eliminate_in_gmat_; 00059 <font class="keyword">const</font> <font class="keywordtype">double</font> *intbuf_; 00060 Ref<TwoBodyInt> tbint_; 00061 Ref<TwoBodyInt> *tbints_; 00062 Ref<TwoBodyDerivInt> *tbintder_; 00063 <font class="keywordtype">int</font> nbasis; 00064 <font class="keywordtype">int</font> noso; 00065 Ref<MessageGrp> msg_; 00066 <font class="keywordtype">int</font> nvir, nocc, nsocc; 00067 00068 Ref<ThreadGrp> thr_; 00069 00070 <font class="comment">// use a dynamic load balance algorithm if possible if true</font> 00071 <font class="comment">// (will not work if messagegrp not thread safe and</font> 00072 <font class="comment">// memorygrp needs catchup to work)</font> 00073 <font class="keywordtype">int</font> dynamic_; 00074 00075 <font class="comment">// The maximum number of orbitals in a pass.</font> 00076 <font class="keywordtype">int</font> max_norb_; 00077 00078 <font class="comment">// the irreps of the orbitals and the offset within the irrep</font> 00079 <font class="keywordtype">int</font> *symorb_irrep_; 00080 <font class="keywordtype">int</font> *symorb_num_; 00081 00082 <font class="keywordtype">char</font> *method_; 00083 <font class="keywordtype">char</font> *algorithm_; 00084 <font class="comment">// if do_d1_ is true, D1(MP2) will be computed even if the gradient is not</font> 00085 <font class="keywordtype">int</font> do_d1_; 00086 <font class="comment">// if do_d2_ is true, D2(MP1) will be computed </font> 00087 <font class="keywordtype">int</font> do_d2_; 00088 00089 <font class="keywordtype">int</font> nfuncmax; 00090 00091 <font class="keywordtype">double</font> hf_energy_; 00092 RefSCVector hf_gradient_; 00093 00094 <font class="keywordtype">double</font> restart_ecorr_; 00095 <font class="keywordtype">int</font> restart_orbital_v1_; 00096 <font class="keywordtype">int</font> restart_orbital_memgrp_; 00097 00098 <font class="keyword">protected</font>: 00099 <font class="keywordtype">void</font> init_variables(); 00100 00101 <font class="comment">// implement the Compute::compute() function</font> 00102 <font class="keywordtype">void</font> <a class="code" href="class_sc__MBPT2.html#b1">compute</a>(); 00103 00104 <font class="comment">// Fill in the eigenvectors and eigenvalues (Guest & Saunders general</font> 00105 <font class="comment">// form is used for the Fock matrix in the open shell case).</font> 00106 <font class="keywordtype">void</font> eigen(RefDiagSCMatrix &vals, RefSCMatrix &vecs, 00107 RefDiagSCMatrix &occs); 00108 00109 <font class="comment">// calculate the opt2 energy using algorithm v1</font> 00110 <font class="keywordtype">void</font> compute_hsos_v1(); 00111 00112 <font class="comment">// calculate the opt2 energy using algorithm v2</font> 00113 distsize_t compute_v2_memory(<font class="keywordtype">int</font> ni, 00114 <font class="keywordtype">int</font> nfuncmax, <font class="keywordtype">int</font> nbfme, <font class="keywordtype">int</font> nshell, 00115 <font class="keywordtype">int</font> ndocc, <font class="keywordtype">int</font> nsocc, <font class="keywordtype">int</font> nvir, <font class="keywordtype">int</font> nproc); 00116 <font class="keywordtype">void</font> compute_hsos_v2(); 00117 00118 <font class="comment">// calculate the opt2 energy using the load balanced version of v2</font> 00119 <font class="keywordtype">void</font> compute_hsos_v2_lb(); 00120 00121 <font class="comment">// calculate the closed shell mp2 energy and gradient</font> 00122 <font class="keywordtype">int</font> compute_cs_batchsize(size_t mem_static, <font class="keywordtype">int</font> nocc_act); 00123 <font class="comment">// distsize_t is used to allow memory requirements to be</font> 00124 <font class="comment">// estimated by starting the calculation on a single processor</font> 00125 distsize_t compute_cs_dynamic_memory(<font class="keywordtype">int</font> ni, <font class="keywordtype">int</font> nocc_act); 00126 <font class="keywordtype">int</font> make_cs_gmat(RefSymmSCMatrix& Gmat, <font class="keywordtype">double</font> *DPmat); 00127 <font class="keywordtype">int</font> make_cs_gmat_new(RefSymmSCMatrix& Gmat, <font class="keyword">const</font> RefSymmSCMatrix& DPmat); 00128 <font class="keywordtype">void</font> form_max_dens(<font class="keywordtype">double</font> *DPmat, <font class="keywordtype">signed</font> <font class="keywordtype">char</font> *maxp); 00129 <font class="keywordtype">int</font> init_cs_gmat(); 00130 <font class="keywordtype">void</font> done_cs_gmat(); 00131 <font class="keywordtype">int</font> make_g_d_nor(RefSymmSCMatrix& Gmat, 00132 <font class="keywordtype">double</font> *DPmat, <font class="keyword">const</font> <font class="keywordtype">double</font> *mgdbuff); 00133 <font class="keywordtype">void</font> cs_cphf(<font class="keywordtype">double</font> **scf_vector, 00134 <font class="keywordtype">double</font> *Laj, <font class="keywordtype">double</font> *eigval, RefSCMatrix& P2aj); 00135 <font class="keywordtype">void</font> s2pdm_contrib(<font class="keyword">const</font> <font class="keywordtype">double</font> *intderbuf, <font class="keywordtype">double</font> *PHF, 00136 <font class="keywordtype">double</font> *P2AO, <font class="keywordtype">double</font> **hf_ginter, <font class="keywordtype">double</font> **ginter); 00137 <font class="keywordtype">void</font> hcore_cs_grad(<font class="keywordtype">double</font> *PHF, <font class="keywordtype">double</font> *PMP2, 00138 <font class="keywordtype">double</font> **hf_ginter, <font class="keywordtype">double</font> **ginter); 00139 <font class="keywordtype">void</font> overlap_cs_grad(<font class="keywordtype">double</font> *WHF, <font class="keywordtype">double</font> *WMP2, 00140 <font class="keywordtype">double</font> **hf_ginter, <font class="keywordtype">double</font> **ginter); 00141 <font class="keywordtype">void</font> compute_cs_grad(); 00142 <font class="keyword">public</font>: 00143 <a class="code" href="class_sc__MBPT2.html#a1">MBPT2</a>(StateIn&); 00227 <a class="code" href="class_sc__MBPT2.html#a1">MBPT2</a>(<font class="keyword">const</font> Ref<KeyVal>&); 00228 ~MBPT2(); 00229 00230 <font class="keywordtype">void</font> <a class="code" href="class_sc__MBPT2.html#a3">save_data_state</a>(StateOut&); 00231 00232 Ref<SCF> ref()<font class="keyword"> </font>{ <font class="keywordflow">return</font> reference_; } 00233 <font class="keywordtype">double</font> ref_energy(); 00234 <font class="keywordtype">double</font> corr_energy(); 00235 RefSCVector ref_energy_gradient(); 00236 RefSCVector corr_energy_gradient(); 00237 00238 <font class="keywordtype">int</font> <a class="code" href="class_sc__MBPT2.html#a9">nelectron</a>(); 00239 00240 RefSymmSCMatrix <a class="code" href="class_sc__MBPT2.html#a10">density</a>(); 00241 <font class="keywordtype">int</font> <a class="code" href="class_sc__MBPT2.html#a11">spin_polarized</a>(); 00242 00243 <font class="keywordtype">int</font> gradient_implemented() <font class="keyword">const</font>; 00244 <font class="keywordtype">int</font> <a class="code" href="class_sc__MBPT2.html#a13">value_implemented</a>() <font class="keyword">const</font>; 00245 00246 <font class="keywordtype">void</font> <a class="code" href="class_sc__MBPT2.html#a14">symmetry_changed</a>(); 00247 00248 <font class="comment">// override compute's obsolete so we can call the reference's obsolete</font> 00249 <font class="keywordtype">void</font> <a class="code" href="class_sc__MBPT2.html#a15">obsolete</a>(); 00250 00251 <font class="keywordtype">void</font> <a class="code" href="class_sc__MBPT2.html#a16">print</a>(std::ostream&o=ExEnv::out0()) <font class="keyword">const</font>; 00252 }; 00253 00254 } 00255 00256 <font class="preprocessor">#endif</font> 00257 <font class="preprocessor"></font> 00258 <font class="comment">// Local Variables:</font> 00259 <font class="comment">// mode: c++</font> 00260 <font class="comment">// c-file-style: "CLJ"</font> 00261 <font class="comment">// End:</font> </div></pre><hr> <address> <small> Generated at Mon Oct 14 14:16:37 2002 for <a href="http://aros.ca.sandia.gov/~cljanss/mpqc">MPQC</a> 2.1.2 using the documentation package <a href="http://www.stack.nl/~dimitri/doxygen/index.html">Doxygen</a> 1.2.5. </small> </address> </body> </html>