MPQC  3.0.0-alpha
lcorr.h
1 
2 /*
3  * Copyright 2009 Sandia Corporation. Under the terms of Contract
4  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
5  * retains certain rights in this software.
6  *
7  * This file is a part of the MPQC LMP2 library.
8  *
9  * The MPQC LMP2 library is free software: you can redistribute it
10  * and/or modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation, either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this program. If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef _chemistry_qc_lmp2_lcorr_h
26 #define _chemistry_qc_lmp2_lcorr_h
27 
28 #include <math.h>
29 
30 #include <util/misc/scexception.h>
31 
32 #include <math/optimize/diis.h>
33 #include <math/scmat/repl.h>
34 #include <math/scmat/matrix.h>
35 
36 #include <chemistry/qc/basis/basis.h>
37 #include <chemistry/qc/basis/tbint.h>
38 #include <chemistry/qc/scf/scf.h>
39 
40 #include <chemistry/qc/lmp2/sma.h>
41 #include <chemistry/qc/lmp2/domain.h>
42 #include <chemistry/qc/lmp2/util.h>
43 
44 namespace sc {
45 
48 class LCorr: public sc::Wavefunction {
50  double W_eigval_threshold_;
51 
54  std::vector<std::vector<int> > virb_to_bfns_;
55 
56  // compute_W fills these in:
57  std::map<domainmapvirbs_t, sma2::Array<2> > unique_W_;
58  std::map<domainmapvirbs_t, std::vector<double> > unique_eigvals_;
59  std::map<domainmapvirbs_t, sma2::Array<2> > unique_F_tilde_;
60 
64  void compute_W_index_maps(int blockdim, int blockdim_nonred,
65  std::set<int> &virbs,
66  std::vector<int> &index_map1,
67  std::vector<int> &index_map2,
68  const sma2::Range &vir);
69 
70  protected:
71 
72  int n_unique_W() const { return unique_W_.size(); }
73  sma2::Array<2> &unique_W(const domainmapvirbs_t &i);
74  std::vector<double> &unique_eigvals(const domainmapvirbs_t &i);
75  sma2::Array<2> &unique_F_tilde(const domainmapvirbs_t &i);
76 
78  void init_virb_to_bfns(const sma2::Range &vir);
79 
80  void compute_W(domainmapvirbs_t &virset,
82  sc::RefSCMatrix &F_vir_mat, sc::RefSCMatrix &S_mat,
83  const sma2::Range &vir, int nocc_act,
84  double bound);
85 
89  const sc::Ref<sc::MessageGrp> &msg);
90 
92  void clear();
93 
95  void print_parameters() const;
96 
97  public:
112  LCorr(const sc::Ref<sc::KeyVal> &);
113  LCorr(sc::StateIn &);
114  ~LCorr();
116 };
117 
118 }
119 
120 #endif // _chemistry_qc_lmp2_lccsd_h
sc::LCorr::init_virb_to_bfns
void init_virb_to_bfns(const sma2::Range &vir)
This must be called before compute_W is called.
sc::RefSCMatrix
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
sc::Ref< sc::GaussianBasisSet >
sc::LCorr::transform_array
void transform_array(sma2::Array< 2 > &A, sma2::Array< 2 > &B, sma2::Array< 2 > &C, sma2::Array< 2 > &D, const sc::Ref< sc::MessageGrp > &msg)
Transform A to D using transformation matrices B,C: D = B^T*A*C.
sc::Wavefunction
A Wavefunction is a MolecularEnergy that utilizies a GaussianBasisSet.
Definition: wfn.h:52
sc::StateIn
Definition: statein.h:79
sc::sma2::Array< 2 >
sc::LCorr::clear
void clear()
Release stored data.
sc::sma2::Range
An Range represent a set of integers, [0, N).
Definition: sma.h:93
sc::LCorr
A base class for local correlation methods.
Definition: lcorr.h:48
sc::LCorr::save_data_state
void save_data_state(sc::StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::Wavefunction::basis
Ref< GaussianBasisSet > basis() const
Returns the basis set.
sc::StateOut
Definition: stateout.h:71
sc::LCorr::LCorr
LCorr(const sc::Ref< sc::KeyVal > &)
Construct an LCorr object from KeyVal input.
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::LCorr::print_parameters
void print_parameters() const
Print input parameters.

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