MADNESS  0.10.1
PNOF12Potentials.h
Go to the documentation of this file.
1 /*
2  * F12Potentials.h
3  *
4  * Created on: Aug 4, 2017
5  * Author: kottmanj
6  */
7 
8 #ifndef F12POTENTIALS_H_
9 #define F12POTENTIALS_H_
10 
14 
15 namespace madness {
16 
17 /// Class that provides all necessary F12 Potentials and Integrals
19 
20 public:
21  World& world; ///< MPI Communicator
22  const Nemo& nemo; ///< all SCF data
23  const BasisFunctions& basis; ///< all methods to create basis functions
24  F12Parameters param; ///< parameters
25  std::shared_ptr<real_convolution_3d> fop; ///< operator for convolutions with the correlation factor: f12 = 1/(2*\gamma)*(1-exp(-\gamma*r_{12}))
26  std::shared_ptr<real_convolution_3d> slaterop; ///< operator for convolutions with the slater factor exp(-\gamma*r_{12})
27  std::shared_ptr<real_convolution_3d> slaterop_sq; ///< operator for convolutions with the slater factor exp(-2.0*\gamma*r_{12})
28  std::shared_ptr<real_convolution_3d> coulombop; ///< operator for convolutions with the coulomb operator
29  std::shared_ptr<real_convolution_3d> bshop; ///< operator for convolutions with the bsh operator (parametrized with the exponent of the corrfac: gamma)
30  std::shared_ptr<real_convolution_3d> bshop_sq; ///< operator for convolutions with the bsh operator (parametrized with the exponent of the corrfac: 2*gamma)
31  std::vector< std::shared_ptr< real_derivative_3d > > gradop; ///< Gradient Operator
32  std::vector< std::shared_ptr< real_convolution_3d > > slatergradop; /// Convolution with the gradient of the slater operator
33  std::vector< std::shared_ptr< real_convolution_3d > > slatergradop_sq; /// Convolution with the gradient of the squared (\gamma*2) slater operator
34  vector_real_function_3d mos; ///< all molecular orbitals (needed for Q projection parts)
35  vector_real_function_3d acmos; ///< Active Molecular Orbitals
36  vector_real_function_3d acKmos; ///< Intermediate for K(active_mos) (takes approx. as much memory than the mos itself. Since #mos<<<#PNOs this should not be a problem
37  ParametrizedExchange K; ///< Exchange Operator
38  QProjector<double, 3> Q; ///< Projector on virtual space: Q = 1-|k><k|
39 
40 
42 
46  for(size_t i=param.freeze();i<mos.size();++i) ac.push_back(mos[i]);
47  MADNESS_ASSERT(ac.size()==mos.size()-param.freeze());
48  return ac;
49  }
50 
51  /// Convenience: Get number of pairs
52  size_t npairs()const{
53  const size_t n=acmos.size();//mos.size()-param.freeze();
54  return n*(n+1)/2;
55  }
56 
57 
58  /// Convenience: Get electron pair iterator
60 
61  /// apply the regularized potential
62  /// \f$ result = <bra|Ue-[f,K]|ket1,ket2> \f$
63  /// \f$ <bra|Ue|ket1,ket2> \f$
64  /// \f$ <bra|[f,K]|ket1,ket2> = <bra[f,K1]|ket1,ket2> + <bra[f,K2]|ket1,ket2> \f$
65  /// \f$ <bra|[f,K1]|ket1,ket2> = <bra|f|K(ket1)>*|ket2> - <K(bra)|f|ket1>*|ket2>
66  /// \f$ <bra|[f,K2]|ket1,ket2> = <bra|f|ket1>*|K(ket2)> - |K(<bra|f|ket1>*ket2)>
68  const vector_real_function_3d& bra, const vector_real_function_3d& Kpno) const;
69 
70  /// compute <ab|g|ij> with the regularized coulomb operator g
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;
73 
74  /// Compute the <ij|op|ab> integrals
75  std::valarray<Tensor<double> > compute_ijab_integrals(
76  const std::valarray<vector_real_function_3d>& functions,
77  const std::shared_ptr<real_convolution_3d>& op) const;
78 
79  /// Compute the <xy|op|ab> integrals, op==NULL pointer means overlap: <xy|ab>
80  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,
81  const bool diagonal = false) const;
82 
83  /// Compute the <ij|g|ab> integrals
84  std::valarray<Tensor<double> > compute_gijab_integrals(const std::valarray<vector_real_function_3d>& functions)const{
85  return compute_ijab_integrals(functions,coulombop);
86  }
87 
88  /// Compute the <ij|f|ab> integrals
89  std::valarray<Tensor<double> > compute_fijab_integrals(const std::valarray<vector_real_function_3d>& functions)const{
90  return compute_ijab_integrals(functions,fop);
91  }
92  Tensor<double> compute_fijab_integrals(const size_t &i, const size_t& j,const vector_real_function_3d& functions)const{
93  return compute_xyab_integrals(acmos[i], acmos[j], functions, functions, fop, i==j);
94  }
95 
96  /// Compute the <ij|fQg|ij> and |ij|fQg|ji> integrals
97  std::valarray<double> compute_fQg_integrals() const;
98 
99  /// Compute the <ij|fQU|ij> and |ij|fQU|ji> integrals
100  std::valarray<double> compute_fQU_integrals() const;
101 
102  /// Compute the fQc integrals with ABS used as: Q12 = Q*|a><a|
103  /// K1f: <i|fja|x>, with fja = <a|f|j> and x=QK(<a|f|j>*i)
104  /// K2f: <i|fja|y>, with y = Q(<Ka|f|j>*i
105  /// fK2: <i|fja|z>, with z = Q(<a|f|Kj>*i) (note: actually no abs needed for fK1)
106  /// fK1: <i|fja|w>, with w = Q(<a|f|j>*Ki)
107  std::valarray<double> compute_fQc_integrals(
108  const vector_real_function_3d& Kmos,
109  const std::valarray<vector_real_function_3d>& functions) const;
110  std::pair<double, double> compute_fQc_integrals_ij(
111  const vector_real_function_3d& Kmos,
112  const vector_real_function_3d& functions,
113  const ElectronPairIterator& it,
114  const bool& use_no_intermediates = false) const;
115 
116 
117  /// Compute the <ab|[f,K]|ij> integrals
118  std::valarray<Tensor<double> > compute_cijab_integrals(const std::valarray<vector_real_function_3d>& functions) const;
119  Tensor<double> compute_cijab_integrals(const size_t &i, const size_t& j, const real_function_3d& Ki, const real_function_3d& Kj , const vector_real_function_3d& functions)const;
120 
121  /// Compute the <ab|Ue|ij> Integrals
122  Tensor<double> compute_uijab_integrals(const size_t&i, const size_t&j, const vector_real_function_3d& functions)const{
123  const vector_real_function_3d vUij = convolve_with_U(functions,acmos[i],acmos[j]);
124  const Tensor<double> result = matrix_inner(world,functions,vUij);
125  return result;
126  }
127 
128  /// convenience for formated printing
129  /// @param[in] es: singlet pair energies
130  /// @param[in] et: triplet pair energies
131  void print_pair_energies(const PNOPairs& pairs,
132  const std::string& msg = "") const;
133  void print_pair_energies(const std::valarray<double>& es, const std::valarray<double>& et, const std::string& msg = "",const PairType& type=UNKNOWN_PAIRTYPE) const;
134 
135  /// print_f12_energies with PairEnergies POD
136  void print_f12_energies(const PairEnergies& pe, const std::string& msg="")const{
138  }
139 
140  // compute the f12 energy of the MP2 equivalent of CIS(D) correction which is the S2b and S2c part
141  // we do not use hylleras type right now, but in analogy to 6D MRA just the f12Q12g12 part (this might not be completely correct)
142  // result: (2<xij| + <jxi)( f12Q12g12|x_i,j> + f12Q12g12|ix_j> - fQOxg|ij> - fOxQg|ij>
144  PairEnergies result(npairs());
145  double f12_energy=0.0;
146  for(ElectronPairIterator it=pit();it;++it){
147  const real_function_3d& moi=acmos[it.i()];
148  const real_function_3d& moj=acmos[it.j()];
149  const real_function_3d& xi=xcis[it.i()];
150  const real_function_3d& xj=xcis[it.j()];
151 
152 
153  // part 1. S2b part
154  double part1=0.0;
155  if(it.diagonal()){
156  part1 = 2.0*(compute_fQg_integral(xi,moj,xi,moj)+ compute_fQg_integral(xi,moj,moi,xj)); // this is the |xi,j> + |i,xj> part
157  // now the Ox part: -(O1x+O2x)|ij>
159  p1 = apply(world,*fop,acmos*moj)*moi;
160  p1=append(p1,xcis);
161  p2 = xcis;
162  p2=append(p2,apply(world,*fop,acmos*moi)*moj);
163  part1 -= 2.0*(madness::inner(world,xi*p1,apply(world,*coulombop,p2*moj)).sum());
164  }
165  else{
166  MADNESS_EXCEPTION("Still wrong ... also part2 ",1);
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)) ;
168  }
169 
170  // part2: S2c part
171  double part2=0.0;
172  if(it.diagonal()){
173 
174  const vector_real_function_3d p1=xcis;
175  const vector_real_function_3d p2=Q(apply(world,*coulombop,moi*acmos)*moj);
176  part2 = 2.0*( madness::inner(world,p1*xi,apply(world,*fop,p2*moj)).sum() + madness::inner(world,p1*moi,apply(world,*fop,p2*xj)).sum() ); // |xi,j> + |i,xj> part
177 
178  // now projector part
179  // transform mos: |ti> = sum_k |k> <x_k|x_i> = Ox^t|x>
180  Projector<double,3> Oxt(xcis,acmos);
181  // OQ part
182  vector_real_function_3d pp1=Oxt(p1);
184  // QO part
185  pp1=append(pp1,p1);
186  pp2=append(pp2,Oxt(p2));
187  part2 -= 2.0*( madness::inner(world,p1*moi,apply(world,*fop,p2*moj))).sum();
188  }else{
189  MADNESS_EXCEPTION("Still wrong ... also part1 ",1);
190  // use this intermediates and avoid calculating them twice
193  {
194  //const vector_real_function_3d& p1=acmos;
195  const vector_real_function_3d& p2=Q(apply(world,*coulombop,moi*acmos)*moj);
196  part2 += 2.0*madness::inner(world,fi,moj*p2).sum() - madness::inner(world,fj,moi*p2).sum();
197  }
198  {
199  const vector_real_function_3d& p1=Q(apply(world,*coulombop,moj*acmos)*moi);
200  // const vector_real_function_3d& p2=acmos;
201  part2 += 2.0*madness::inner(world,moi*p1,fj).sum() - madness::inner(world,moj*p1,fi).sum();
202  }
203  }
204  double factor=1.0;
205  if(it.diagonal()) factor=0.5; // cancels the factor 2 above ... probably stupid to implement that way
206  const double result_ij = factor*(part1 - part2);
207 
208  std::cout << "\npart1=" << part1 << "\npart2=" << part2 << "\n";
209 
210  f12_energy += result_ij;
211  }
212  result.energy_f12=f12_energy;
213  return result;
214  }
215 
216 
217  // efficient computation using Q12 = 1 - O1 - O2 + O12 = 1 - O1q2 - q1O2 and q1 = 1 - 0.5*O1
218  double compute_fQg_integral(const real_function_3d bra1,
219  const real_function_3d& bra2, const real_function_3d& ket1,
220  const real_function_3d& ket2, const bool& diagonal = false) const;
221 
222  // Call the correct functions depending which parameters are set
224  const std::valarray<vector_real_function_3d>& pnos) const;
226 
227  /// return 2.0 <ij|fQg|ij> - <ji|fQg|ij> as well as singlet and triplets
229 
230  std::vector<real_function_3d> read_cabs_from_file(const std::string& filename)const;
231 
233  const std::valarray<vector_real_function_3d>& pnos) const;
234 
235 
236  PairEnergies compute_f12_pair_energy(const std::valarray<vector_real_function_3d>& pnos, const std::valarray<vector_real_function_3d>& abs) const;
237 
238  /// Compute the f12 pair energy if Ansatz 2 is used
239  /// This means: Regularized MRA-PNO-MP2-F12 calculation
240  /// We use RI for the integrals with the exchange commutator
241  /// in two steps: 1. PNOs as approx for Q, 2. Correction with ABS set (either auto generated or from file)
242  /// EF12 =<ij|(fQg + fQU - fQ[f,K])(2|ij> - |ji>)
243  PairEnergies compute_f12_pair_energies(const std::valarray<vector_real_function_3d>& abs) const;
244 
245  /// Compute the f12 pair energy if Ansatz 1 is used
246  /// This means: Normal MRA-PNO-MP2 calculation + F12 Correction
247  /// Old Code
248  /// Currently: Neglect Commutator if no abs is given
249  /// if abs_u is true then fQU part is also neglected (RI with PNOs as virtuals: fQU ~= fVU => fQU - fVU ~= 0)
250  /// EF12 = <ij|(fQg-fVg + fUg - fVg)|2ij-ji>
252  const std::valarray<vector_real_function_3d>& pnos, const std::valarray<vector_real_function_3d>& abs) const;
253 
254  /// Compute the applied Ue potential
255  /// \f$ <bra|Ue|ket1,ket2>_1 = <bra|Ulocal|ket1,ket2> + <bra|Unlocal|ket1,ket2> \f$
257  const real_function_3d& ket1, const real_function_3d& ket2,
258  const bool symmetric = false) const;
260  const real_function_3d& ket1, const real_function_3d& ket2,
261  const bool symmetric = false) const;
262 
263  /// @return \f$ \int dr2 (1-e^{-gamma*r12})/r12 + gamma/2* e^{-\gamma*r12} *function(r2) \f$
264  /// we use: 1-e^{-gamma*r12})/r12 = 2*gamma*f12*g12
266  const real_function_3d& function) const{
267  vector_real_function_3d dummy(1,function);
268  return convolve_with_local_U(dummy).front();
269  }
270 
272 
273  /// @return convolution with the slater potential which is
274  /// \f$ V_{slater} = \exp{(-\gamma*r_{12})} \f$
275  /// @param[in] function -> operator is applied onto this funciton
276  /// if nemo-style orbitals are used the bra element has to be multiplied with R^2 beforehand
278  return apply(world,*slaterop,functions);
279  }
280 
281 
282  /// @return \f$ \int dx2 f12*g12*f(2) \f$
283  /// @param[in] function: function on which f*g operator is applied
284  /// right now we use: fg = 1/(2*gamma)*(g - 4*pi*G(gamma))
285  /// todo: implement fg operator directly (may be cheaper)
286  real_function_3d convolve_with_fg(const real_function_3d& function)const;
288 
289  /// @return \f$ -1.0/2.0*<bra(1)|e^{-gamma*r_{12}}/r_{12}* \vec{r_{12}}\cdot (\nabla_1 - \nabla_2)[axis]|ket1,ket2>_1 \f$
290  /// @param[in] bra: no derivatives (for nemo-style orbitals this should be multiplied with R^2 beforehand)
291  /// @param[in] ket1: this is the part (for electron 1) where the derivative operators will partially act on and over which the integration variable will run
292  /// @param[in] ket2: this is the part (for electron 2) where the derivative operators will partially act on, no integration over this variable
293  /// @param[in] symmetric: if ket1 and ket2 are the same functions (little speedup because the gradient has to be calculated only once)
294  /// @param[in] squared: factor for gamma: a*\gamma. Default is just 1.0. if true then a=2
295  /// We use the following relations:
296  /// 1.0/2.0*e^{-\gamma*r_{12}}*\vec{r_{12}}/r_{12}
297  ///= 1.0/(2.0*\gamma) \nabla_2(e^{-\gamma*r_{12}})
298  ///= -1.0/(2.0*\gamma) \nabla_1(e^{-\gamma*r_{12}})
299  ///= -1.0/(2.0*\gamma) \nabla_{12}(e^{-\gamma*r_{12}} )
300  /// so we can use the gradient of the SlaterOperator Grad(e^{-\gamma*r}
301  /// with this we have
302  /// \f$ -1.0/2.0*<bra|e^{-gamma*r12}/r12* \vec{r12}\cdot (\nabla_1 - \nabla_2)[axis]|ket>
303  /// = 1.0/(2.0*\gamma)*<bra|Grad(e^{-\gamma*r_{12}})\cdot (\nabla_1 - \nabla_2)[axis]|ket1,ket2>_{particle} \f$
304  /// todo: Partial integration may lead to more efficient scheme without the Gradient of the SlaterOperator
305  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;
306  vector_real_function_3d convolve_with_nonlocal_U(const vector_real_function_3d& bra, const real_function_3d& ket1,const real_function_3d& ket2, const bool symmetric=false, const bool& squared=false)const;
307 
308  /// Convolution with f*U
309  /// This breaks apart into the convolution with:
310  /// \f$ f*U = 1/(2\gamma)*(U - e^{-\gamma*r_{12}} \f$
311  /// local part: (could be further simplified by combining the BSH Operators of Ulocal the expression below)
312  /// \f$ f*U^{\mbox{loc}} = 1/(2\gamma)*(U^{\mbox{loc}} - 4\pi*G(\gamma) + 4\pi*G(2\gamma) - \gamma/2 (e^{-2\gamma*r_{12}} )
313  /// nonlocal part:
314  /// \f$ f*U^{\mbox{nloc}} = 1/(2\gamma)*(U^{\mbox{nloc}}(\gamma) - U^{\mbox{nloc}}(2\gamma))
316  const real_function_3d& ket2, const bool symmetric = false) const;
318  const real_function_3d& ket2, const bool symmetric = false) const{
319  vector_real_function_3d dummy(1,bra);
320  return convolve_with_fU(dummy,ket1,ket2,symmetric).front();
321  }
322 
323  /// convolve with the gradient of the slater potential or the squared slater potential
324  vector_real_function_3d convolve_with_gradslater(const vector_real_function_3d functions, const size_t axis, const bool& squared=false)const{
325  if(squared){
326  return apply(world,*slatergradop_sq[axis],functions);
327  }else{
328  return apply(world,*slatergradop[axis],functions);
329  }
330 
331  }
332 
333  /// Inner product for X_ab Tensors. Convenience
334  double inner(const Tensor<double>&A, const Tensor<double>&B)const{
335  return A.trace(B);
336  }
337 
338 
339 };
340 
341 } /* namespace madness */
342 
343 #endif /* F12POTENTIALS_H_ */
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