8 #ifndef F12POTENTIALS_H_
9 #define F12POTENTIALS_H_
25 std::shared_ptr<real_convolution_3d>
fop;
29 std::shared_ptr<real_convolution_3d>
bshop;
31 std::vector< std::shared_ptr< real_derivative_3d > >
gradop;
32 std::vector< std::shared_ptr< real_convolution_3d > >
slatergradop;
53 const size_t n=
acmos.size();
72 Tensor<double> compute_regularized_fluctuation_matrix(
const std::pair<vector_real_function_3d,vector_real_function_3d> & KPNOA,
const std::pair<vector_real_function_3d,vector_real_function_3d> & KPNOB,
const std::pair<real_function_3d,real_function_3d>& MKI,
const std::pair<real_function_3d,real_function_3d> MKJ)
const;
76 const std::valarray<vector_real_function_3d>& functions,
77 const std::shared_ptr<real_convolution_3d>&
op)
const;
81 const bool diagonal =
false)
const;
109 const std::valarray<vector_real_function_3d>& functions)
const;
114 const bool& use_no_intermediates =
false)
const;
118 std::valarray<Tensor<double> >
compute_cijab_integrals(
const std::valarray<vector_real_function_3d>& functions)
const;
132 const std::string& msg =
"")
const;
145 double f12_energy=0.0;
167 part1 = 2.0*(
compute_fQg_integral(moi,moj,
xi,moj) +
compute_fQg_integral(moi,moj,moi,xj) -
compute_fQg_integral(moj,moi,
xi,moj) +
compute_fQg_integral(moj,moi,moi,xj)) ;
205 if(it.diagonal()) factor=0.5;
206 const double result_ij = factor*(part1 - part2);
208 std::cout <<
"\npart1=" << part1 <<
"\npart2=" << part2 <<
"\n";
210 f12_energy += result_ij;
224 const std::valarray<vector_real_function_3d>& pnos)
const;
233 const std::valarray<vector_real_function_3d>& pnos)
const;
252 const std::valarray<vector_real_function_3d>& pnos,
const std::valarray<vector_real_function_3d>&
abs)
const;
258 const bool symmetric =
false)
const;
261 const bool symmetric =
false)
const;
Definition: test_ar.cc:118
Definition: test_ar.cc:141
Definition: PNOGuessFunctions.h:33
Definition: PNOParameters.h:227
Class that provides all necessary F12 Potentials and Integrals.
Definition: PNOF12Potentials.h:18
ElectronPairIterator pit() const
Convenience: Get electron pair iterator.
Definition: PNOF12Potentials.h:59
vector_real_function_3d initialize_active_mos(const madness::Nemo &nemo) const
Definition: PNOF12Potentials.h:43
std::pair< double, double > compute_fQc_integrals_ij(const vector_real_function_3d &Kmos, const vector_real_function_3d &functions, const ElectronPairIterator &it, const bool &use_no_intermediates=false) const
Definition: PNOF12Potentials.cpp:1004
std::shared_ptr< real_convolution_3d > fop
operator for convolutions with the correlation factor: f12 = 1/(2*\gamma)*(1-exp(-\gamma*r_{12}))
Definition: PNOF12Potentials.h:25
PairEnergies compute_hylleraas_f12_energies(const std::valarray< vector_real_function_3d > &pnos) const
Definition: PNOF12Potentials.cpp:1361
real_function_3d convolve_with_fU(const real_function_3d &bra, const real_function_3d &ket1, const real_function_3d &ket2, const bool symmetric=false) const
Definition: PNOF12Potentials.h:317
std::shared_ptr< real_convolution_3d > bshop
operator for convolutions with the bsh operator (parametrized with the exponent of the corrfac: gamma...
Definition: PNOF12Potentials.h:29
double inner(const Tensor< double > &A, const Tensor< double > &B) const
Inner product for X_ab Tensors. Convenience.
Definition: PNOF12Potentials.h:334
vector_real_function_3d convolve_with_slater_potential(const vector_real_function_3d &functions) const
Definition: PNOF12Potentials.h:277
Tensor< double > compute_xyab_integrals(const real_function_3d &x, const real_function_3d &y, const vector_real_function_3d &a, const vector_real_function_3d &b, const std::shared_ptr< real_convolution_3d > &op, const bool diagonal=false) const
Compute the <xy|op|ab> integrals, op==NULL pointer means overlap: <xy|ab>
Definition: PNOF12Potentials.cpp:124
std::valarray< Tensor< double > > compute_ijab_integrals(const std::valarray< vector_real_function_3d > &functions, const std::shared_ptr< real_convolution_3d > &op) const
Compute the <ij|op|ab> integrals.
Definition: PNOF12Potentials.cpp:691
World & world
MPI Communicator.
Definition: PNOF12Potentials.h:21
std::vector< std::shared_ptr< real_derivative_3d > > gradop
Gradient Operator.
Definition: PNOF12Potentials.h:31
std::valarray< double > compute_fQc_integrals(const vector_real_function_3d &Kmos, const std::valarray< vector_real_function_3d > &functions) const
Definition: PNOF12Potentials.cpp:990
vector_real_function_3d mos
Convolution with the gradient of the squared (\gamma*2) slater operator.
Definition: PNOF12Potentials.h:34
std::vector< real_function_3d > read_cabs_from_file(const std::string &filename) const
Definition: PNOF12Potentials.cpp:1321
real_function_3d convolve_with_fg(const real_function_3d &function) const
Definition: PNOF12Potentials.cpp:871
real_function_3d convolve_with_local_U(const real_function_3d &function) const
Definition: PNOF12Potentials.h:265
vector_real_function_3d convolve_with_gradslater(const vector_real_function_3d functions, const size_t axis, const bool &squared=false) const
convolve with the gradient of the slater potential or the squared slater potential
Definition: PNOF12Potentials.h:324
std::valarray< double > compute_fQg_integrals() const
Compute the <ij|fQg|ij> and |ij|fQg|ji> integrals.
Definition: PNOF12Potentials.cpp:700
std::vector< std::shared_ptr< real_convolution_3d > > slatergradop
Definition: PNOF12Potentials.h:32
double compute_fQg_integral(const real_function_3d bra1, const real_function_3d &bra2, const real_function_3d &ket1, const real_function_3d &ket2, const bool &diagonal=false) const
Definition: PNOF12Potentials.cpp:1216
ParametrizedExchange K
Exchange Operator.
Definition: PNOF12Potentials.h:37
F12Potentials(World &world, const Nemo &nemo, const BasisFunctions &basis, const F12Parameters &pp)
Definition: PNOF12Potentials.cpp:68
QProjector< double, 3 > Q
Projector on virtual space: Q = 1-|k><k|.
Definition: PNOF12Potentials.h:38
const Nemo & nemo
all SCF data
Definition: PNOF12Potentials.h:22
vector_real_function_3d convolve_with_fU(const vector_real_function_3d &bra, const real_function_3d &ket1, const real_function_3d &ket2, const bool symmetric=false) const
Definition: PNOF12Potentials.cpp:951
std::shared_ptr< real_convolution_3d > slaterop
operator for convolutions with the slater factor exp(-\gamma*r_{12})
Definition: PNOF12Potentials.h:26
PairEnergies compute_f12_energies() const
Definition: PNOF12Potentials.cpp:1254
std::valarray< double > compute_fQU_integrals() const
Compute the <ij|fQU|ij> and |ij|fQU|ji> integrals.
Definition: PNOF12Potentials.cpp:751
const BasisFunctions & basis
all methods to create basis functions
Definition: PNOF12Potentials.h:23
void print_f12_energies(const PairEnergies &pe, const std::string &msg="") const
print_f12_energies with PairEnergies POD
Definition: PNOF12Potentials.h:136
vector_real_function_3d apply_regularized_potential(const real_function_3d &moi, const real_function_3d &moj, const real_function_3d Ki, const real_function_3d &Kj, const vector_real_function_3d &bra, const vector_real_function_3d &Kpno) const
Definition: PNOF12Potentials.cpp:432
vector_real_function_3d acmos
Active Molecular Orbitals.
Definition: PNOF12Potentials.h:35
std::shared_ptr< real_convolution_3d > coulombop
operator for convolutions with the coulomb operator
Definition: PNOF12Potentials.h:28
vector_real_function_3d acKmos
Intermediate for K(active_mos) (takes approx. as much memory than the mos itself. Since mos<<<#PNOs t...
Definition: PNOF12Potentials.h:36
std::valarray< Tensor< double > > compute_gijab_integrals(const std::valarray< vector_real_function_3d > &functions) const
Compute the <ij|g|ab> integrals.
Definition: PNOF12Potentials.h:84
void print_pair_energies(const PNOPairs &pairs, const std::string &msg="") const
Definition: PNOF12Potentials.cpp:1170
size_t npairs() const
Convenience: Get number of pairs.
Definition: PNOF12Potentials.h:52
std::vector< std::shared_ptr< real_convolution_3d > > slatergradop_sq
Convolution with the gradient of the slater operator.
Definition: PNOF12Potentials.h:33
std::shared_ptr< real_convolution_3d > slaterop_sq
operator for convolutions with the slater factor exp(-2.0*\gamma*r_{12})
Definition: PNOF12Potentials.h:27
std::valarray< Tensor< double > > compute_cijab_integrals(const std::valarray< vector_real_function_3d > &functions) const
Compute the <ab|[f,K]|ij> integrals.
Definition: PNOF12Potentials.cpp:807
std::valarray< Tensor< double > > compute_fijab_integrals(const std::valarray< vector_real_function_3d > &functions) const
Compute the <ij|f|ab> integrals.
Definition: PNOF12Potentials.h:89
Tensor< double > compute_uijab_integrals(const size_t &i, const size_t &j, const vector_real_function_3d &functions) const
Compute the <ab|Ue|ij> Integrals.
Definition: PNOF12Potentials.h:122
real_function_3d convolve_with_nonlocal_U(const real_function_3d &bra, const real_function_3d &ket1, const real_function_3d &ket2, const bool symmetric=false, const bool &squared=false) const
Definition: PNOF12Potentials.cpp:903
std::shared_ptr< real_convolution_3d > bshop_sq
operator for convolutions with the bsh operator (parametrized with the exponent of the corrfac: 2*gam...
Definition: PNOF12Potentials.h:30
Tensor< double > compute_regularized_fluctuation_matrix(const ElectronPairIterator &it, const vector_real_function_3d &pnos, const vector_real_function_3d &Kpnos) const
compute <ab|g|ij> with the regularized coulomb operator g
Definition: PNOF12Potentials.cpp:478
real_function_3d convolve_with_U(const real_function_3d &bra, const real_function_3d &ket1, const real_function_3d &ket2, const bool symmetric=false) const
Definition: PNOF12Potentials.cpp:835
PairEnergies compute_f12_pair_energies(const std::valarray< vector_real_function_3d > &abs) const
Definition: PNOF12Potentials.cpp:318
Tensor< double > compute_fijab_integrals(const size_t &i, const size_t &j, const vector_real_function_3d &functions) const
Definition: PNOF12Potentials.h:92
PairEnergies compute_projected_f12_energies() const
return 2.0 <ij|fQg|ij> - <ji|fQg|ij> as well as singlet and triplets
Definition: PNOF12Potentials.cpp:1292
PairEnergies compute_f12_pair_energy(const std::valarray< vector_real_function_3d > &pnos, const std::valarray< vector_real_function_3d > &abs) const
Definition: PNOF12Potentials.cpp:146
PairEnergies compute_f12_correction(const std::valarray< vector_real_function_3d > &pnos, const std::valarray< vector_real_function_3d > &abs) const
Definition: PNOF12Potentials.cpp:168
F12Parameters param
parameters
Definition: PNOF12Potentials.h:24
PairEnergies compute_cispd_f12_energies(const vector_real_function_3d xcis) const
Definition: PNOF12Potentials.h:143
The Nemo class.
Definition: nemo.h:326
std::shared_ptr< SCF > get_calc() const
Definition: nemo.h:482
std::size_t freeze() const
Definition: PNOParameters.h:158
Definition: PNOStructures.h:45
simple projector class
Definition: projector.h:45
A parallel world class.
Definition: world.h:132
Tensor< double > op(const Tensor< double > &x)
Definition: kain.cc:508
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition: madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition: madness_exception.h:134
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
static const char * filename
Definition: legendre.cc:96
std::vector< Function< T, NDIM > > append(const std::vector< Function< T, NDIM > > &lhs, const std::vector< Function< T, NDIM > > &rhs)
combine two vectors
Definition: vmra.h:649
double abs(double x)
Definition: complexfun.h:48
response_space apply(World &world, std::vector< std::vector< std::shared_ptr< real_convolution_3d >>> &op, response_space &f)
Definition: basic_operators.cc:39
std::vector< real_function_3d > vector_real_function_3d
Definition: functypedefs.h:79
Function< T, NDIM > sum(World &world, const std::vector< Function< T, NDIM > > &f, bool fence=true)
Returns new function — q = sum_i f[i].
Definition: vmra.h:1421
double inner(response_space &a, response_space &b)
Definition: response_functions.h:442
std::string type(const PairType &n)
Definition: PNOParameters.h:18
PairType
Definition: PNOParameters.h:17
@ UNKNOWN_PAIRTYPE
Definition: PNOParameters.h:17
void matrix_inner(DistributedMatrix< T > &A, const std::vector< Function< T, NDIM > > &f, const std::vector< Function< T, NDIM > > &g, bool sym=false)
Definition: distpm.cc:46
static const double b
Definition: nonlinschro.cc:119
static const double a
Definition: nonlinschro.cc:118
const double xi
Exponent for delta function approx.
Definition: siam_example.cc:60
Definition: PNOStructures.h:174
POD for PNO code.
Definition: PNOStructures.h:245
POD structure for energies.
Definition: PNOStructures.h:112
std::valarray< double > eijt_f12
triplet f12 pair energies (for CIS(D) the ES Part)
Definition: PNOStructures.h:119
std::valarray< double > eijs_f12
singlet f12 pair energies (for CIS(D) the GS Part)
Definition: PNOStructures.h:118
double energy_f12
total f12 correlation energy
Definition: PNOStructures.h:122
std::size_t axis
Definition: testpdiff.cc:59