~ubuntu-branches/ubuntu/oneiric/mpqc/oneiric

« back to all changes in this revision

Viewing changes to src/lib/chemistry/qc/mbptr12/mbptr12.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2005-11-27 11:41:49 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127114149-zgz9r3gk50w8ww2q
Tags: 2.3.0-1
* New upstream release.
* debian/rules (SONAME): Activate awk snippet for automatic so-name
  detection again, resulting in a bump to `7' and making a `c2a' for
  the C++ allocator change unnecessary; closes: #339232.
* debian/patches/00list (08_gcc-4.0_fixes): Removed, no longer needed.
* debian/rules (test): Remove workarounds, do not abort build if tests
  fail.
* debian/ref: Removed.
* debian/control.in (libsc): Added Conflict against libsc6c2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#pragma interface
33
33
#endif
34
34
 
 
35
#include <string>
35
36
#include <util/misc/compute.h>
36
37
#include <util/group/memory.h>
37
38
#include <util/group/message.h>
41
42
#include <chemistry/qc/scf/scf.h>
42
43
#include <chemistry/qc/mbpt/mbpt.h>
43
44
#include <chemistry/qc/mbptr12/linearr12.h>
44
 
#include <chemistry/qc/mbptr12/vxb_eval.h>
 
45
//#include <chemistry/qc/mbptr12/vxb_eval.h>
 
46
#include <chemistry/qc/mbptr12/r12int_eval.h>
45
47
#include <chemistry/qc/mbptr12/vxb_eval_info.h>
46
48
#include <chemistry/qc/mbptr12/mp2r12_energy.h>
 
49
#include <chemistry/qc/mbptr12/twobodygrid.h>
47
50
 
48
51
namespace sc {
49
52
 
65
68
    Ref<MP2R12Energy> r12ap_energy_;
66
69
    Ref<MP2R12Energy> r12b_energy_;
67
70
 
68
 
    Ref<GaussianBasisSet> aux_basis_;
 
71
    Ref<GaussianBasisSet> aux_basis_;   // This is the auxiliary basis set (ABS)
 
72
    Ref<GaussianBasisSet> vir_basis_;   // This is the virtuals basis set (VBS)
69
73
    Ref<SCVector> epair_0_, epair_1_;   // Singlet/triplet pair energies if spin-adapted
70
74
                                        // Alpha-beta/alpha-alpha pair energies if spin-orbital
71
75
 
 
76
    Ref<TwoBodyGrid> twopdm_grid_aa_;     // The set of 2 particle positions on which to compute values of alpha-alpha 2-PDM
 
77
    Ref<TwoBodyGrid> twopdm_grid_ab_;     // The set of 2 particle positions on which to compute values of alpha-beta 2-PDM
 
78
 
72
79
#define ref_to_mp2r12_acc_ 100.0
73
80
 
74
81
    double mp2_corr_energy_;
75
82
    double r12_corr_energy_;
76
83
    LinearR12::StandardApproximation stdapprox_;
 
84
    LinearR12::ABSMethod abs_method_;
77
85
    R12IntEvalInfo::StoreMethod r12ints_method_;
78
 
    char* r12ints_file_;
 
86
    std::string r12ints_file_;
 
87
    bool gbc_;
 
88
    bool ebc_;
79
89
    bool spinadapted_;
 
90
    bool include_mp1_;
80
91
 
81
92
    void init_variables_();
82
93
 
83
94
    // This checks if the integral factory is suitable for R12 calculations
84
95
    void check_integral_factory_();
85
96
 
86
 
    /* calculate the MP2-R12 energy in std approximations A and A' */
 
97
    // calculate the MP2-R12 energy in std approximations A and A'
87
98
    void compute_energy_a_();
88
99
 
89
100
  protected:
96
107
    /** The KeyVal constructor.
97
108
        <dl>
98
109
 
 
110
        <dt><tt>gbc</tt><dd> This boolean specifies whether Generalized Brillouin
 
111
        Condition (GBC) is assumed to hold. The default is "true". This keyword is
 
112
        only valid if stdapprox=A'.
 
113
        The effect of setting this keyword to true is rather small --
 
114
        hence it is not recommended to use this keyword.
 
115
 
 
116
        <dt><tt>ebc</tt><dd> This boolean specifies whether Extended Brillouin
 
117
        Condition (EBC) is assumed to hold. The default is "true". This keyword
 
118
        is only valid if stdapprox=A'.
 
119
        The effect of setting this keyword to true is rather small --
 
120
        hence it is not recommended to use this keyword.
 
121
      
99
122
        <dt><tt>stdapprox</tt><dd> This gives a string that must take on one
100
 
        of the values below.  The default is A.
 
123
        of the values below.  The default is A'.
101
124
 
102
125
        <dl>
103
126
 
104
 
          <dt><tt>A</tt><dd> Use second order M\o{}ller-Plesset perturbation theory
 
127
          <dt><tt>A</tt><dd> Use second order M&oslash;ller-Plesset perturbation theory
105
128
          with linear R12 terms in standard approximation A (MP2-R12/A).
106
129
          Only energies can be computed with the MP2-R12/A method.
107
130
 
108
 
          <dt><tt>A'</tt><dd> Use second order M\o{}ller-Plesset perturbation theory
 
131
          <dt><tt>A'</tt><dd> Use second order M&oslash;ller-Plesset perturbation theory
109
132
          with linear R12 terms in standard approximation A' (MP2-R12/A').
110
133
          This will cause MP2-R12/A energies to be computed also.
111
134
          Only energies can be computed with the MP2-R12/A' method.
112
135
 
113
 
          <dt><tt>B</tt><dd> Use second order M\o{}ller-Plesset perturbation theory
 
136
          <dt><tt>B</tt><dd> Use second order M&oslash;ller-Plesset perturbation theory
114
137
          with linear R12 terms in standard approximation B. 
115
138
          This method is not implemented yet.
116
139
 
117
140
        </dl>
 
141
        
118
142
 
119
 
        <dt><tt>spinadapted</tt><dd> This specifies whether to compute spin-adapted
 
143
        <dt><tt>spinadapted</tt><dd> This boolean specifies whether to compute spin-adapted
120
144
        or spin-orbital pair energies. Default is to compute spin-adapted energies.
121
145
 
122
146
        <dt><tt>aux_basis</tt><dd> This specifies the auxiliary basis to be used for the resolution
123
147
        of the identity. Default is to use the same basis as for the orbital expansion.
124
148
 
 
149
        <dt><tt>vir_basis</tt><dd> This specifies the basis to be used for the virtual orbitals.
 
150
        Default is to use the same basis as for the orbital expansion.
 
151
 
 
152
        <dt><tt>include_mp1</tt><dd> This specifies whether to compute MP1 correction to
 
153
        the MP2 and MP2-R12 energies. This option only has effect if vir_basis is not the same as basis.
 
154
        MP1 correction is a perturbative estimate of the difference between the HF energy computed
 
155
        in vir_basis and basis. Usually, it is a very poor estimate -- therefore this keyword should
 
156
        be avoided by non-experts. Default is false.
 
157
 
 
158
        <dt><tt>abs_method</tt><dd> This string specifies whether the old ABS method, introduced
 
159
        by Klopper and Samson, or the new ABS variant, CABS, introduced by Valeev, should be used.
 
160
        Valid values are "ABS" (Klopper and Samson), "ABS+", "CABS", and "CABS+", where the "+" labels
 
161
        a method where the union of OBS and ABS is used to construct the RI basis. The default is "ABS".
 
162
        The default in 2.3.0 and later will be "CABS+".
 
163
 
 
164
        <dt><tt>lindep_tol</tt><dd> The tolerance used to detect linearly
 
165
        dependent basis functions in the RI basis set.
 
166
        The precise meaning depends on the
 
167
        orthogonalization method.  The default value is 1e-8.
 
168
 
125
169
        <dt><tt>r12ints</tt><dd> This specifies how to store transformed MO integrals.
126
170
        Valid values are:
127
171
 
130
174
          <dt><tt>mem-posix</tt><dd> Store integrals in memory for single-pass situations
131
175
          and in a binary file on task 0's node using POSIX I/O for multipass situations.
132
176
          <tt>posix</tt> is usually less efficient than <tt>mpi</tt> for distributed
133
 
          parallel multipass runs since the I/O is performed by one task only. However, this method guaranteed to
 
177
          parallel multipass runs since the I/O is performed by one task only. However, this method is guaranteed to
134
178
          work in all types of environments, hence <tt>mem-posix</tt> is the default.
135
179
 
136
180
          <dt><tt>posix</tt><dd> Store integrals in a binary file on task 0's node using POSIX I/O.
149
193
          and testing purposes.
150
194
 
151
195
          <dt><tt>mem</tt><dd> Store integrals in memory. Can only be used with single-pass
152
 
          transformations. This method should only be used for testing purposes
 
196
          transformations for MP2-R12/A and MP2-R12/A' methods.
 
197
          This method should only be used for testing purposes.
153
198
 
154
199
        </dl>
155
200
 
157
202
        If user wishes to use MPI-I/O, pending its availability, for higher parallel efficiency,
158
203
        <tt>r12ints</tt> should be explicitly set to <tt>mem-mpi</tt>.
159
204
 
160
 
        <dt><tt>r12ints_file</tt><dd> This specifies which file to use to store transformed
161
 
        MO integrals if <tt>r12ints=posix-io</tt> or <tt>r12ints=mpi-io</tt> is used.
162
 
        Default is "./<inputbasename>.r12ints.dat", where <inputbasename> is the name of the input
 
205
        <dt><tt>r12ints_file</tt><dd> This specifies the prefix for the transformed
 
206
        MO integrals file if <tt>r12ints</tt> is set to <tt>posix</tt>, <tt>mpi</tt>, <tt>mem-posix</tt>
 
207
        or <tt>mem-mpi</tt> is used.
 
208
        Default is "./<i>inputbasename</i>.r12ints", where <i>inputbasename</i> is the name of the input
163
209
        file without ".in". If MPI-I/O is used then it is user's responsibility to ensure
164
210
        that the file resides on a file system that supports MPI-I/O.
165
211
 
 
212
        <dt><tt>twopdm_grid_aa</tt><dd> This optional keyword specifies a TwoBodyGrid object which to
 
213
        use for coordinates at which to compute alpha-alpha part of 2-PDM.
 
214
 
 
215
        <dt><tt>twopdm_grid_ab</tt><dd> This optional keyword specifies a TwoBodyGrid object which to
 
216
        use for coordinates at which to compute alpha-beta part of 2-PDM.
 
217
 
166
218
        </dl> */
167
219
    MBPT2_R12(const Ref<KeyVal>&);
168
220
    ~MBPT2_R12();
170
222
    void save_data_state(StateOut&);
171
223
 
172
224
    Ref<GaussianBasisSet> aux_basis() const;
 
225
    Ref<GaussianBasisSet> vir_basis() const;
 
226
    bool gbc() const;
 
227
    bool ebc() const;
 
228
    LinearR12::ABSMethod abs_method() const;
173
229
    LinearR12::StandardApproximation stdapprox() const;
174
230
    bool spinadapted() const;
175
231
    R12IntEvalInfo::StoreMethod r12ints_method() const;
176
 
    char* r12ints_file() const;
 
232
    const std::string& r12ints_file() const;
177
233
 
178
234
    double corr_energy();
179
235
    double r12_corr_energy();