MPQC  3.0.0-alpha
mbptr12.h
1 //
2 // mbptr12.h
3 //
4 // Copyright (C) 2001 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _chemistry_qc_mbptr12_mbptr12_h
29 #define _chemistry_qc_mbptr12_mbptr12_h
30 
31 #include <string>
32 #include <util/misc/compute.h>
33 #include <util/group/memory.h>
34 #include <util/group/message.h>
35 #include <util/group/thread.h>
36 #include <chemistry/qc/basis/obint.h>
37 #include <chemistry/qc/basis/tbint.h>
38 #include <chemistry/qc/scf/scf.h>
39 #include <chemistry/qc/mbpt/mbpt.h>
40 #include <chemistry/qc/mbptr12/r12int_eval.h>
41 #include <chemistry/qc/mbptr12/r12wfnworld.h>
42 #include <chemistry/qc/mbptr12/mp2r12_energy.h>
43 #include <chemistry/qc/mbptr12/twobodygrid.h>
44 
45 namespace sc {
46 
47 // //////////////////////////////////////////////////////////////////////////
48 
49 class R12IntEval;
50 class R12WavefunctionWorld;
51 class MP2R12Energy;
52 
55 class MBPT2_R12: public MBPT2 {
56 
57  Ref<R12IntEval> r12eval_; // the R12 intermediates evaluator
58  Ref<R12WavefunctionWorld> r12world_; // parameters for r12eval_
59 
62  Ref<MP2R12Energy> r12a_energy_;
63  Ref<MP2R12Energy> r12ap_energy_;
64  Ref<MP2R12Energy> r12app_energy_;
65  Ref<MP2R12Energy> r12b_energy_;
66  Ref<MP2R12Energy> r12c_energy_;
67 
68  Ref<TwoBodyGrid> twopdm_grid_; // The set of 2 particle positions on which to compute values of pair function
69  unsigned int plot_pair_function_[2];// Which pair function to plot
70 
71  static double ref_to_mp2r12_acc() { return 0.01; }
72 
73  double mp2_corr_energy_;
74 
75  bool cabs_singles_;
76  double cabs_singles_energy_;
77 
78  std::string occ_orbs_;
79  std::string uocc_orbs_;
80  double uocc_orbs_pno_truncate_threshold_;
81 
82  int gf2_orbital_; // orbital index to use for Green's function calcs, -1 = HOMO, +1 = LUMO, 0 = skip GF2
83 
84  // calculate the MP2-R12 energy (or energies, depending on which approximation is chosen)
85  void compute_energy_();
86 
95  std::vector< std::pair<RefSCMatrix,RefSCMatrix> >
96  mp1_pno(SpinCase2 spin,
97  bool deflate_geminal,
98  double truncate_threshold = 1e-8);
99 
100  protected:
101  // implement the Compute::compute() function,
102  // overrides MBPT2::compute()
103  void compute();
104 
105  public:
106  MBPT2_R12(StateIn&);
130  MBPT2_R12(const Ref<KeyVal>&);
131  ~MBPT2_R12();
132 
133  void save_data_state(StateOut&);
134 
135  const Ref<R12WavefunctionWorld>& r12world() const { return r12world_; }
136  const Ref<R12IntEval>& r12eval() const { return r12eval_; }
139 
141  double corr_energy();
143  double r12_corr_energy();
145  double cabs_singles_energy();
146 
148 
149  void obsolete();
150  bool analytic_gradient_implemented() const;
151  int value_implemented() const;
152  void set_desired_value_accuracy(double acc);
153 
154  void print(std::ostream&o=ExEnv::out0()) const;
155 };
156 
157 }
158 
159 #endif
160 
161 // Local Variables:
162 // mode: c++
163 // c-file-style: "CLJ"
164 // End:
sc::MBPT2_R12::set_desired_value_accuracy
void set_desired_value_accuracy(double acc)
set the value accuracy
sc::MBPT2_R12
The MBPT2_R12 class implements several R12 second-order Moeller-Plesset perturbation theory methods.
Definition: mbptr12.h:55
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
sc::MBPT2_R12::density
RefSymmSCMatrix density()
Returns the SO density.
sc::MBPT2_R12::r12_corr_energy
double r12_corr_energy()
R12 doubles contribution to the MBPT(2)-R12 energy.
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::MBPT2_R12::corrfactor
void corrfactor(const Ref< R12Technology::CorrelationFactor > &)
this changes the correlation factor
sc::MBPT2_R12::corr_energy
double corr_energy()
total MBPT(2)-R12 energy (does not include CABS singles)
sc::MBPT2_R12::obsolete
void obsolete()
Marks all results as being out of date.
sc::MBPT2_R12::compute
void compute()
Recompute at least the results that have compute true and are not already computed.
sc::MBPT2_R12::print
void print(std::ostream &o=ExEnv::out0()) const
Print information about the object.
sc::StateIn
Definition: statein.h:79
sc::MBPT2
The MBPT2 class implements several second-order perturbation theory methods.
Definition: mbpt.h:44
sc::MBPT2_R12::analytic_gradient_implemented
bool analytic_gradient_implemented() const
must overload this in a derived class if analytic gradient can be computed
sc::StateOut
Definition: stateout.h:71
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::MBPT2_R12::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::MBPT2_R12::value_implemented
int value_implemented() const
sc::MBPT2_R12::cabs_singles_energy
double cabs_singles_energy()
CABS singles contribution to the total energy.
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:23:59 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.