MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
r12wfnworld.h
1//
2// r12wfnworld.h
3//
4// Copyright (C) 2003 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_vxbevalinfo_h
29#define _chemistry_qc_mbptr12_vxbevalinfo_h
30
31#include <string>
32#include <util/misc/string.h>
33#include <util/ref/ref.h>
34#include <math/scmat/abstract.h>
35#include <util/group/memory.h>
36#include <chemistry/molecule/energy.h>
37#include <chemistry/qc/scf/scf.h>
38#include <chemistry/qc/mbptr12/r12technology.h>
39#include <chemistry/qc/wfn/orbitalspace.h>
40#include <chemistry/qc/lcao/transform_factory.h>
41#include <chemistry/qc/nbody/ref.h>
42#include <chemistry/qc/lcao/moints_runtime.h>
43#include <chemistry/qc/lcao/fockbuild_runtime.h>
44
45namespace sc {
46
48class R12WavefunctionWorld : virtual public SavableState {
49
50 // change to 0 to use the old set of OrbitalSpace keys
51 static const int USE_NEW_ORBITALSPACE_KEYS = 1;
52
53public:
54
57
88
90
92 const Ref<RefWavefunction>& refwfn() const { return refwfn_; }
94 void refwfn(const Ref<RefWavefunction>& r) { if (refwfn_ != r) { this->obsolete(); refwfn_ = r; } }
95 const Ref<WavefunctionWorld>& world() const { return refwfn()->world(); }
96 Wavefunction* wfn() const { return world()->wfn(); }
97 Ref<R12Technology> r12tech() const { return r12tech_; }
99 const Ref<GaussianBasisSet>& basis() const { return refwfn()->basis(); }
101 const Ref<GaussianBasisSet>& basis_ri() const { return bs_ri_; }
103 const Ref<GaussianBasisSet>& basis_aux() const { return bs_aux_; }
105 const Ref<GaussianBasisSet>& basis_vir() const { return refwfn()->uocc_basis(); }
107 bool obs_eq_vbs() const { return obs_eq_vbs_; }
109 bool obs_eq_ribs() const;
111 bool spinadapted() const { return spinadapted_; }
112
113 OverlapOrthog::OrthogMethod orthog_method() const { return wfn()->orthog_method(); }
114 double lindep_tol() const { return wfn()->lindep_tol(); }
115 Ref<Integral> integral() const { return world()->integral(); }
117 bool sdref() const;
118
120 const Ref<OrbitalSpace>& abs_space() const { return abs_space_; }
124 const Ref<OrbitalSpace>& cabs_space(const SpinCase1& S) const;
125
126 void print(std::ostream& o) const;
127
131 void obsolete();
132
135
136
137private:
138
139 Ref<RefWavefunction> refwfn_;
140 Ref<R12Technology> r12tech_;
141 Ref<GaussianBasisSet> bs_aux_;
142 Ref<GaussianBasisSet> bs_ri_;
143 bool obs_eq_vbs_;
144
145 bool spinadapted_;
146 int nlindep_aux_;
147 int nlindep_ri_;
148
149 Ref<OrbitalSpace> abs_space_; // ABS space
150 Ref<OrbitalSpace> ribs_space_; // RIBS basis
151 bool ribs_space_given_; // true if ribs_space was given in the constructor, only used to detect
152 mutable Ref<OrbitalSpace> cabs_space_[NSpinCases1]; // CABS spaces
153 double ref_acc_for_cabs_space_; // CABS space depends on reference. this keeps track of the accuracy of reference used to compute cabs_space_
154
155
156
157 // construct the RI basis based on abs_method
158 void construct_ri_basis_(bool safe);
159 void construct_cabs_();
160 // Uses ri_basis to construct a basis that spans the orthogonal complement to the OBS
161 void construct_ortho_comp_svd_();
162 // Returns true if ABS spans OBS
163 bool abs_spans_obs_();
164 // Construct orthog_aux_
165 void construct_orthog_aux_();
166 // Construct orthog_ri_
167 void construct_orthog_ri_();
168};
169
170}
171
172#endif
173
174// Local Variables:
175// mode: c++
176// c-file-style: "CLJ"
177// End:
178
179
Ref< DescribedClass > ref()
Return this object wrapped up in a Ref smart pointer.
Definition class.h:251
OrthogMethod
An enum for the types of orthogonalization.
Definition orthog.h:42
Class R12WavefunctionWorld describes the environment of a Wavefunction implementing an R12 method.
Definition r12wfnworld.h:48
bool sdref() const
is this a single-determinant reference?
void obsolete()
Every wavefunction that owns a R12WavefunctionWorld should call this method when it obsoletes itself.
bool obs_eq_ribs() const
Returns true if RIBS is equivalent to OBS.
const Ref< GaussianBasisSet > & basis() const
Returns the orbital basis set (OBS) object.
Definition r12wfnworld.h:99
R12WavefunctionWorld(const Ref< KeyVal > &keyval, const Ref< RefWavefunction > &ref, Ref< OrbitalSpace > ri_space=Ref< OrbitalSpace >())
KeyVal constructor uses keywords of R12Technology and the following keywords:
const Ref< OrbitalSpace > & ribs_space() const
Returns the OrbitalSpace object for RI-BS: approximates the identity.
MOIntsTransform::StoreMethod StoreMethod
Describes the method of storing transformed MO integrals.
Definition r12wfnworld.h:56
bool obs_eq_vbs() const
Returns true if VBS is equivalent to OBS.
Definition r12wfnworld.h:107
const Ref< GaussianBasisSet > & basis_aux() const
Returns the auxiliary basis used for computing the RI basis used in R12.
Definition r12wfnworld.h:103
void print(std::ostream &o) const
Print the object.
bool spinadapted() const
Returns true is spin-free algorithm to be used.
Definition r12wfnworld.h:111
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
const Ref< OrbitalSpace > & abs_space() const
Returns the OrbitalSpace object for ABS.
Definition r12wfnworld.h:120
const Ref< GaussianBasisSet > & basis_ri() const
Returns the resolution-of-the-identity basis set (RIBS) object.
Definition r12wfnworld.h:101
void initialize()
makes R12WavefunctionWorld ready for use
const Ref< GaussianBasisSet > & basis_vir() const
Returns the virtuals basis set (VBS) object.
Definition r12wfnworld.h:105
const Ref< RefWavefunction > & refwfn() const
Return the RefWavefunction object.
Definition r12wfnworld.h:92
void refwfn(const Ref< RefWavefunction > &r)
Resets the RefWavefunction object.
Definition r12wfnworld.h:94
const Ref< OrbitalSpace > & cabs_space(const SpinCase1 &S) const
Returns subspace of ribs_space that is the complement to OBS. If abs_method = ABS/ABS+,...
A template class that maintains references counts.
Definition ref.h:361
Base class for objects that can save/restore state.
Definition state.h:45
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
double lindep_tol() const
Returns the tolerance for linear dependencies.
OverlapOrthog::OrthogMethod orthog_method() const
Returns the orthogonalization method.
Contains all MPQC code up to version 3.
Definition mpqcin.h:14
Describes the method of storing transformed MO integrals.
Definition transform.h:37

Generated at Wed Sep 25 2024 02:45:29 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.