28#ifndef _chemistry_qc_mbptr12_r12technology_h
29#define _chemistry_qc_mbptr12_r12technology_h
31#include <util/state/state.h>
32#include <chemistry/qc/basis/intdescr.h>
33#include <math/optimize/gaussianfit.h>
54 enum StandardApproximation {
62 enum ABSMethod {ABS_CABS = 2,
77 enum PositiveDefiniteB {
78 PositiveDefiniteB_no = 0,
79 PositiveDefiniteB_yes = 1,
80 PositiveDefiniteB_weak = 2
83 enum GeminalAmplitudeAnsatz {
84 GeminalAmplitudeAnsatz_fullopt = 0,
85 GeminalAmplitudeAnsatz_fixed = 1,
86 GeminalAmplitudeAnsatz_scaledfixed = 2
89 enum H0_dk_approx_pauli {
90 H0_dk_approx_pauli_true = 0,
91 H0_dk_approx_pauli_fHf = 1,
92 H0_dk_approx_pauli_fHf_Q = 2,
93 H0_dk_approx_pauli_false = 3
152 R12Technology::GeminalAmplitudeAnsatz amplitudes()
const;
160 R12Technology::GeminalAmplitudeAnsatz amplitudes_;
176 std::vector<std::string> params_;
180 GeminalDescriptor(
const std::string& type,
const std::vector<std::string> ¶ms);
182 std::string type()
const;
183 std::vector<std::string> params()
const;
221 virtual double value(
unsigned int c,
double r12)
const =0;
279 double value(
unsigned int c,
double r12)
const;
304 double value(
unsigned int c,
double r12)
const;
308 template<
class IntParam>
310 typedef typename IntParam::PrimitiveGeminal PrimitiveGeminal;
311 typedef typename IntParam::ContractedGeminal ContractedGeminal;
312 typedef std::vector<ContractedGeminal> ContractedGeminals;
315 static double epsilon;
316 static bool equiv(
const ContractedGeminals& A,
317 const ContractedGeminals& B);
320 static bool equiv(
const PrimitiveGeminal& A,
321 const PrimitiveGeminal& B);
330 typedef IntParamsG12::ContractedGeminal ContractedGeminal;
341 const ContractedGeminal&
function(
unsigned int c)
const;
365 double value(
unsigned int c,
double r12)
const;
371 void print_params(std::ostream& os,
unsigned int f)
const;
381 typedef IntParamsG12::ContractedGeminal ContractedGeminal;
392 const ContractedGeminal&
function(
unsigned int c)
const;
414 double value(
unsigned int c,
double r12)
const;
416 static ContractedGeminal product(
const ContractedGeminal& A,
417 const ContractedGeminal& B);
423 void print_params(std::ostream& os,
unsigned int f)
const;
429 const char* invalid_id_;
441 const std::vector<double> &gamma);
447 const unsigned int nf_A = A->nfunctions();
448 const unsigned int nf_B = B->nfunctions();
449 typedef typename CF::CorrelationParameters CorrParams;
450 CorrParams corrparams;
451 for (
int f = 0; f < nf_A; ++f) {
452 for (
int g = 0; g < nf_B; ++g) {
453 corrparams.push_back(CF::product(A->function(f), B->function(g)));
456 return new CF(corrparams);
462 void init_from_kv(
const Ref<KeyVal>& keyval,
463 bool abs_eq_obs =
true,
464 bool vbs_eq_obs =
true);
469 Ref<CorrelationFactor> corrfactor_;
470 StandardApproximation stdapprox_;
471 Ref<R12Ansatz> ansatz_;
472 ABSMethod abs_method_;
473 double abs_lindep_tol_;
475 unsigned int maxnabs_;
480 bool coupling_1rdm_f12b_;
482 H0_dk_approx_pauli H0_dk_approx_pauli_;
485 PositiveDefiniteB posdef_B_;
493 struct GTGFitWeight {
494 typedef enum {TewKlopper, Cusp} Type;
496 GTGFitWeight::Type gtg_fit_weight_;
500 R12Technology(StateIn&);
667 unsigned int maxnabs()
const;
670 bool coupling()
const;
671 bool compute_1rdm()
const;
672 bool coupling_1rdm_f12b()
const;
673 ABSMethod abs_method()
const;
674 int abs_nlindep()
const;
675 double abs_lindep_tol()
const;
676 StandardApproximation stdapprox()
const;
678 bool spinadapted()
const;
680 H0_dk_approx_pauli H0_dk_approx()
const;
681 bool H0_dk_keep()
const;
682 bool safety_check()
const;
683 PositiveDefiniteB posdef_B()
const;
712template<
class IntParam>
714 const ContractedGeminals& A,
715 const ContractedGeminals& B) {
716 unsigned int nf = A.size();
720 for (
unsigned int f = 0; f < nf; ++f) {
721 const ContractedGeminal& Af = A[f];
722 const ContractedGeminal& Bf = B[f];
723 unsigned int np = Af.size();
726 for (
unsigned int p = 0; p < np; ++p) {
727 if (!equiv(Af[p], Bf[p]))
static std::ostream & out0()
Return an ostream that writes from node 0.
std::pair< double, double > PrimitiveGeminal
std::pair< g, c > as in c * exp( - g*r12^2)
Definition intparams.h:147
CorrelationFactor is a set of one or more two-particle functions of the interparticle distance.
Definition r12technology.h:198
virtual unsigned int nprimitives(unsigned int c) const
Returns the number of primitive functions in contraction c.
virtual void print_params(std::ostream &os, unsigned int f) const
Print out parameters of function f. Base implementation prints nothing.
virtual TwoBodyOper::type tbint_type_t2f12() const
Returns TwoBodyOper::type corresponding to integrals over [T2,f12].
CorrelationFactor(const std::string &label, const Ref< GeminalDescriptor > &geminaldescriptor)
Definitions of primitive and contracted Geminals.
virtual TwoBodyOper::type tbint_type_f12f12_anti() const
Returns TwoBodyOper::type corresponding to integrals over f12*f12' antisymmetrized wrt exponents,...
virtual Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int fbra, unsigned int fket) const
Returns TwoBodyIntDescr needed to compute matrix elements where correlation functions fbra and fket a...
const std::string & label() const
Returns label.
virtual TwoBodyOper::type tbint_type_f12t1f12() const
Returns TwoBodyOper::type corresponding to integrals over [f12,[T1,f12]].
virtual unsigned int nfunctions() const
Returns the number of contracted two-particle functions in the set.
virtual double value(unsigned int c, double r12) const =0
Computes value of function c when electrons are at distance r12.
virtual TwoBodyOper::type tbint_type_t1f12() const
Returns TwoBodyOper::type corresponding to integrals over [T1,f12].
virtual TwoBodyOper::type tbint_type_f12eri() const
Returns TwoBodyOper::type corresponding to integrals over f12/r12.
void print(std::ostream &os=ExEnv::out0()) const
print the correlation factor
virtual TwoBodyOper::type tbint_type_f12f12() const
Returns TwoBodyOper::type corresponding to integrals over f12^2.
virtual Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int f) const
Returns TwoBodyIntDescr needed to compute matrix elements where correlation function f appears in eit...
virtual TwoBodyOper::type tbint_type_eri() const
Returns TwoBodyOper::type corresponding to electron repulsion integrals.
virtual unsigned int max_num_tbint_types() const =0
Returns the maximum number of two-body integral types produced by the appropriate integral evaluator.
virtual TwoBodyOper::type tbint_type_f12() const
Returns TwoBodyOper::type corresponding to integrals over correlation operator.
G12CorrelationFactor stands for Gaussian geminals correlation factor, usable with methods that requir...
Definition r12technology.h:326
IntParamsG12::PrimitiveGeminal PrimitiveGeminal
Definitions of primitive and contracted Geminals.
Definition r12technology.h:329
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int f) const
Overload of CorrelationFactor::tbintdescr(f)
double value(unsigned int c, double r12) const
Implementation of CorrelationFactor::value()
const PrimitiveGeminal & primitive(unsigned int c, unsigned int p) const
Returns std::pair<primitive_parameter,coefficient> in primitive p of contraction c.
TwoBodyOper::type tbint_type_f12t1f12() const
Reimplementation of CorrelationFactor::tbint_type_f12t1f12()
TwoBodyOper::type tbint_type_f12f12() const
Reimplementation of CorrelationFactor::tbint_type_f12f12()
unsigned int max_num_tbint_types() const
Implementation of CorrelationFactor::max_num_tbint_types()
Definition r12technology.h:347
TwoBodyOper::type tbint_type_t1f12() const
Reimplementation of CorrelationFactor::tbint_type_t1f12()
unsigned int nfunctions() const
Reimplementation of CorrelationFactor::nfunctions()
TwoBodyOper::type tbint_type_f12() const
Reimplementation of CorrelationFactor::tbint_type_f12()
std::vector< ContractedGeminal > CorrelationParameters
Vector of contracted 2 particle functions.
Definition r12technology.h:332
const ContractedGeminal & function(unsigned int c) const
Returns contracted function c.
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int fbra, unsigned int fket) const
Overload of CorrelationFactor::tbintdescr(fbra,fket)
TwoBodyOper::type tbint_type_t2f12() const
Reimplementation of CorrelationFactor::tbint_type_t2f12()
unsigned int nprimitives(unsigned int c) const
Reimplementation of CorrelationFactor::nprimitives()
TwoBodyOper::type tbint_type_f12eri() const
Reimplementation of CorrelationFactor::tbint_type_f12eri()
bool equiv(const Ref< CorrelationFactor > &cf) const
Implementation of CorrelationFactor::equiv()
G12NCCorrelationFactor stands for Gaussian geminals correlation factor, usable with methods that do n...
Definition r12technology.h:377
TwoBodyOper::type tbint_type_f12f12_anti() const
Reimplementation of CorrelationFactor::tbint_type_f12f12_anti()
TwoBodyOper::type tbint_type_f12() const
Reimplementation of CorrelationFactor::tbint_type_f12()
std::vector< ContractedGeminal > CorrelationParameters
Vector of contracted 2 particle functions.
Definition r12technology.h:383
TwoBodyOper::type tbint_type_f12eri() const
Reimplementation of CorrelationFactor::tbint_type_f12eri()
unsigned int nfunctions() const
Reimplementation of CorrelationFactor::nfunctions()
const PrimitiveGeminal & primitive(unsigned int c, unsigned int p) const
Returns std::pair<primitive_parameter,coefficient> in primitive p of contraction c.
TwoBodyOper::type tbint_type_f12f12() const
Reimplementation of CorrelationFactor::tbint_type_f12f12()
TwoBodyOper::type tbint_type_f12t1f12() const
Reimplementation of CorrelationFactor::tbint_type_f12t1f12()
const ContractedGeminal & function(unsigned int c) const
Returns contracted function c.
bool equiv(const Ref< CorrelationFactor > &cf) const
Implementation of CorrelationFactor::equiv()
double value(unsigned int c, double r12) const
Implementation of CorrelationFactor::value()
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int f) const
Overload of CorrelationFactor::tbintdescr(f)
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int fbra, unsigned int fket) const
Overload of CorrelationFactor::tbintdescr(fbra,fket)
unsigned int max_num_tbint_types() const
Implementation of CorrelationFactor::max_num_tbint_types()
Definition r12technology.h:398
unsigned int nprimitives(unsigned int c) const
Reimplementation of CorrelationFactor::nprimitives()
IntParamsG12::PrimitiveGeminal PrimitiveGeminal
Definitions of primitive and contracted Geminals.
Definition r12technology.h:380
Definition r12technology.h:427
Definition r12technology.h:168
NullCorrelationFactor stands for no correlation factor; only for test.
Definition r12technology.h:270
bool equiv(const Ref< CorrelationFactor > &cf) const
Implementation of CorrelationFactor::equiv()
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int fbra, unsigned int fket) const
Overload of CorrelationFactor::tbintdescr(fbra,fket)
unsigned int max_num_tbint_types() const
Implementation of CorrelationFactor::max_num_tbint_types()
Definition r12technology.h:277
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int f) const
Overload of CorrelationFactor::tbintdescr(f)
double value(unsigned int c, double r12) const
Implementation of CorrelationFactor::value()
R12Ansatz specifies the manner in which the R12 geminals are constructed.
Definition r12technology.h:99
void print(std::ostream &o=ExEnv::out0()) const
Print the object.
R12Ansatz(const Ref< KeyVal > &)
The KeyVal constructor.
R12Ansatz(StateIn &)
The StateIn constructor.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
R12Ansatz()
The default constructor creates orbital-invariant ansatz with projector 2.
R12CorrelationFactor stands for no correlation factor.
Definition r12technology.h:287
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int f, unsigned int g) const
Returns TwoBodyIntDescr needed to compute matrix elements where correlation functions fbra and fket a...
TwoBodyOper::type tbint_type_f12() const
Reimplementation of CorrelationFactor::tbint_type_f12()
double value(unsigned int c, double r12) const
Implementation of CorrelationFactor::value()
bool equiv(const Ref< CorrelationFactor > &cf) const
Implementation of CorrelationFactor::equiv()
unsigned int max_num_tbint_types() const
Implementation of CorrelationFactor::max_num_tbint_types()
Definition r12technology.h:294
TwoBodyOper::type tbint_type_t2f12() const
Reimplementation of CorrelationFactor::tbint_type_t2f12()
TwoBodyOper::type tbint_type_t1f12() const
Reimplementation of CorrelationFactor::tbint_type_t1f12()
Ref< TwoBodyIntDescr > tbintdescr(const Ref< Integral > &IF, unsigned int f) const
Returns TwoBodyIntDescr needed to compute matrix elements where correlation function f appears in eit...
R12Technology describes technical features of the R12 approach.
Definition r12technology.h:40
OrbitalProduct_GG
geminal generating space
Definition r12technology.h:66
void print(std::ostream &o=ExEnv::out0()) const
Print the object.
static std::string default_cabs_name(const std::string &obs_name)
tries to translate a library basis set label to the corresponding default value for the CABS
Projector
Projector of R12 methods: 0: Q_{12} = 1 1: Q_{12} = (1 - P_1)(1 - P_2) 2: Q_{12} = (1 - V_1 V_2)(1 - ...
Definition r12technology.h:50
static double single_slater_exponent(const Ref< GeminalDescriptor > &gdesc)
Returns a single Slater type geminal exponent. Throws if geminal is not of Slater type and if there i...
static double default_stg_exponent(const std::string &obs_name)
tries to translate a library basis set label to the corresponding default value for the F12 exponent
OrbitalProduct_gg
space of orbital products from which geminal substitutions are allowed
Definition r12technology.h:72
R12Technology(const Ref< KeyVal > &)
The KeyVal constructor.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void corrfactor(const Ref< CorrelationFactor > &)
this changes the correlation factor
The base class for all reference counted objects.
Definition ref.h:192
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
Contains all MPQC code up to version 3.
Definition mpqcin.h:14
Compares CorrelationParamaters corresponding to IntParam.
Definition r12technology.h:309
type
types of known two-body operators
Definition operator.h:318