MADNESS 0.10.1
nemo.h
Go to the documentation of this file.
1/*
2 This file is part of MADNESS.
3
4 Copyright (C) 2007,2010 Oak Ridge National Laboratory
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20 For more information please contact:
21
22 Robert J. Harrison
23 Oak Ridge National Laboratory
24 One Bethel Valley Road
25 P.O. Box 2008, MS-6367
26
27 email: harrisonrj@ornl.gov
28 tel: 865-241-3937
29 fax: 865-572-0680
30 */
31
32/*!
33 \file examples/nemo.h
34 \brief solve the HF equations using numerical exponential MOs
35
36 The source is
37 <a href=http://code.google.com/p/m-a-d-n-e-s-s/source/browse/local
38 /trunk/src/apps/examples/nemo.h>here</a>.
39
40 */
41
42#ifndef NEMO_H_
43#define NEMO_H_
44
45#include <madness/mra/mra.h>
48#include <madness/mra/lbdeux.h>
49#include<madness/chem/SCF.h>
55#include <madness/mra/vmra.h>
56#include<madness/chem/pcm.h>
57#include<madness/chem/AC.h>
59#include "Results.h"
63
64namespace madness {
65
66class PNO;
67class OEP;
68
69
71
72public:
73
74 explicit NemoBase(World& w) : world(w) {}
75
76 virtual ~NemoBase() {}
77
78 virtual std::shared_ptr<Fock<double,3>> make_fock_operator() const {
79 MADNESS_EXCEPTION("implement make_fock operator for your derived NemoBase class",1);
80 return std::shared_ptr<Fock<double,3>>();
81 }
82
83 /// create an instance of the derived object based on the input parameters
84 std::shared_ptr<NuclearCorrelationFactor> get_ncf_ptr() const {
85 return ncf;
86 }
87
88 /// normalize the nemos
89 template<typename T, std::size_t NDIM>
90 void static normalize(std::vector<Function<T,NDIM> >& nemo,
92
93 if (nemo.size()==0) return;
94 World& world=nemo[0].world();
95 // compute the norm of the reconstructed orbitals, includes the factor
96 std::vector<Function<T,NDIM> > mos = (metric.is_initialized()) ? metric*nemo : nemo;
97 std::vector<double> norms = norm2s(world, mos);
98
99 // scale the nemos, excludes the nuclear correlation factor
100 std::vector<double> invnorm(norms.size());
101 for (std::size_t i = 0; i < norms.size(); ++i)
102 invnorm[i] = 1.0 / norms[i];
103 scale(world, nemo, invnorm);
104 }
105
106 /// reproject a set of nemos onto the current k and thresh
107
108 /// The counterpart of SCF::project (chem/SCF.cc) for regularized orbitals.
109 /// SCF::project must NOT be used here: it normalizes with the plain L2
110 /// metric, while nemos are normalized against R^2. Without this, a protocol
111 /// step that changes k leaves the nemos at the old polynomial order while
112 /// FunctionDefaults, R and the potentials have already moved to the new one.
113 template<typename T, std::size_t NDIM>
115 const Function<double,NDIM>& metric) const {
116
117 if (nemo.size()==0) return;
120 if (nemo.front().k()==k) { // nothing to do but retighten
122 return;
123 }
124
125 if (world.rank()==0) print("reprojecting nemos from k =",nemo.front().k(),"to k =",k);
127 for (std::size_t i=0; i<nemo.size(); ++i)
128 nemo[i]=madness::project(nemo[i],k,thresh,false);
129 world.gop.fence();
131 normalize(nemo,metric);
132 }
133
134 template<typename T>
135 static Tensor<T> Q2(const Tensor<T>& s) {
136 Tensor<T> Q = -0.5*s;
137 for (int i=0; i<s.dim(0); ++i) Q(i,i) += 1.5;
138 return Q;
139 }
140
141 /// orthonormalize the vectors
142 template<typename T, std::size_t NDIM>
145 const double trantol=FunctionDefaults<NDIM>::get_thresh()*0.01) const {
146
147 if (nemo.size()==0) return;
148 normalize(nemo,metric);
149 double maxq;
150 do {
151 std::vector<Function<T,NDIM> > Rnemo = (metric.is_initialized()) ? metric*nemo : nemo;
152 Tensor<T> Q = Q2(matrix_inner(world, Rnemo, Rnemo));
153 maxq=0.0;
154 for (int i=0; i<Q.dim(0); ++i)
155 for (int j=0; j<i; ++j)
156 maxq = std::max(maxq,std::abs(Q(i,j)));
157
158 Q.screen(trantol); // ???? Is this really needed?
159 nemo = transform(world, nemo, Q, trantol, true);
161// if (world.rank() == 0) print("ORTHOG2: maxq trantol", maxq, trantol);
162
163 } while (maxq>0.01);
164 normalize(nemo,metric);
165 }
166
167 template<typename T, std::size_t NDIM>
169 return sum(world,abssq(world,nemo)).truncate();
170 }
171
172 virtual bool need_recompute_factors_and_potentials(const double thresh) const {
173 bool need=false;
174 const int k=FunctionDefaults<3>::get_k();
175 if ((not R.is_initialized()) or (R.thresh()>thresh)) need=true;
176 if (not ncf) need=true;
177 if ((not R_square.is_initialized()) or (R_square.thresh()>thresh)) need=true;
178 // k must be checked independently of thresh: re-entering a protocol at
179 // the same threshold but a different k (a restart, or a user-pinned k)
180 // would otherwise reuse R and R_square at the old k and silently mix
181 // polynomial orders in every product with the nemos.
182 if (R.is_initialized() and R.k()!=k) need=true;
183 if (R_square.is_initialized() and R_square.k()!=k) need=true;
184 return need;
185 };
186
188 R.clear();
189 R_square.clear();
190 ncf.reset();
191 };
192
194 const std::shared_ptr<PotentialManager>& pm,
195 const std::pair<std::string,double>& ncf_parameter) {
196
197 // construct the nuclear correlation factor:
198 if (not ncf) {
200 }
201
202 // re-project the ncf
204 R = ncf->function();
206 R_square = ncf->square();
208 }
209
210 /// compute the nuclear gradients
212 const Molecule& molecule) const;
213
214 /// compute kinetic energy as square of the "analytical" expectation value
215
216 /// @param[in] the nemo orbitals F
217 /// @return T = 1/2 \sum_i \int R^2 U1.U1 F^2 + 2 R^2 U1.grad(F) + R^2 grad(F)^2
218 template<typename T, std::size_t NDIM>
219 double compute_kinetic_energy(const std::vector<Function<T,NDIM> >& nemo) const {
220
221 // T = 0.5\sum_i \int R^2 U1.U1 F^2 - 2 R^2 U1.grad(F) F + R^2 grad(F)^2
222 // = 0.5 (<U1.U1 | rho > + <R^2|grad(F)^2> - 2<R^2 | U1.grad(F) >)
223 // note: U1=-grad(R)/R
224 //auto id=nemo.front().world().id();
225 //auto id1=R_square.world().id();
226 //auto worldid=world.id();
227 world.gop.fence();
231 double ke1=inner(dens,U1dotU1);
232
233 double ke2=0.0;
234 double ke3=0.0;
235 //double ke3_real=0.0;
236 //double ke3_imag=0.0;
237
238 for (size_t axis = 0; axis < NDIM; axis++) {
239 real_derivative_3d D = free_space_derivative<double, NDIM>(world, axis);
240 const std::vector<Function<T,NDIM> > dnemo = apply(world, D, nemo);
241
242 real_function_3d term2=dot(world,dnemo,nemo)*ncf->U1(axis);
243 double tmp=-2.0*inner(R_square,term2);
244// ke3_real -=2.0*std::real(tmp);
245// ke3_imag -=2.0*std::imag(tmp);
246 ke3 +=tmp;
247
248 const real_function_3d term1=dot(world,dnemo,dnemo);
249 world.gop.fence();
250 ke2 += inner(term1,R_square);
251
252 }
253// if (ke3_imag>1.e-8) {
254// print("kinetic energy, imaginary part: ",ke3_imag);
255// MADNESS_EXCEPTION("imaginary kinetic energy",1);
256// }
257// double ke=2.0*(ke1+ke2+ke3_real); // closed shell
258 double ke=2.0*(ke1+ke2+ke3); // closed shell
259 return 0.5*ke;
260 }
261
262 /// compute kinetic energy as square of the "analytical" derivative of the orbitals
263
264 /// @param[in] the nemo orbitals F
265 /// @return T = 1/2 \sum_i || grad(R)*F_i + R*grad(F_i)||^2
266 template<typename T, std::size_t NDIM>
267 double compute_kinetic_energy1(const std::vector<Function<T,NDIM> >& nemo) const {
268 timer timer1(world);
269 double ke=0.0;
270 for (int i=0; i<nemo.size(); ++i) {
271 double fnorm2=norm2(world,-1.0*R*ncf->U1vec()*nemo[i] + R*grad(nemo[i]));
272 ke+=2.0*fnorm2*fnorm2;
273 }
274 timer1.end("compute_kinetic_energy1");
275 return 0.5*ke;
276 }
277
278
279 /// compute kinetic energy as square of the "analytical" derivative of the orbitals
280
281 /// @param[in] the nemo orbitals F
282 /// @return T = 1/2 \sum_i || grad(R)*F_i + R*grad(F_i)||^2
283 template<typename T, std::size_t NDIM>
284 double compute_kinetic_energy1a(const std::vector<Function<T,NDIM> >& nemo) const {
285 timer timer1(world);
286 double ke=0.0;
287 for (int i=0; i<NDIM; ++i) {
288 std::vector< std::shared_ptr< Derivative<T,NDIM> > > grad=
289 gradient_operator<T,NDIM>(world);
290 double fnorm2=norm2(world,R*(-1.0*ncf->U1(i)*nemo + apply(world,*(grad[i]),nemo)));
291 ke+=2.0*fnorm2*fnorm2;
292 }
293 timer1.end("compute_kinetic_energy1a");
294 return 0.5*ke;
295 }
296
297 /// compute kinetic energy as direct derivative of the orbitals (probably imprecise)
298
299 /// @param[in] the nemo orbitals F
300 /// @return T = 1/2 \sum_i || grad(R*F_i)||^2
301 template<typename T, std::size_t NDIM>
302 double compute_kinetic_energy2(const std::vector<Function<T,NDIM> >& nemo) const {
303
304 // it's ok to use phi here, no regularization necessary for this eigenvalue
305 double E_kin = 0.0;
306 for (int axis = 0; axis < 3; axis++) {
307 real_derivative_3d D = free_space_derivative<double, 3>(world, axis);
308 const vecfuncT dphi = apply(world, D,R*nemo);
309 E_kin += 0.5 * (inner(world, dphi, dphi)).sum();
310 // -1/2 sum <Psi|Nabla^2|Psi> = 1/2 sum <NablaPsi|NablaPsi> (integration by parts)
311 }
312 E_kin *= 2.0; // 2 because closed shell
313 return E_kin;
314 }
315
316
317 bool check_convergence(const std::vector<double> energies,
318 const std::vector<double> oldenergies, const double bsh_norm,
319 const double delta_density, const CalculationParameters& param,
320 const double econv, const double dconv) const {
321
322 double maxenergychange=fabs(energies.size()-oldenergies.size()); // >0 if oldenergyvec not initialized
323 for (auto iter1=energies.begin(), iter2=oldenergies.begin();
324 (iter1!=energies.end() and iter2!=oldenergies.end()); iter1++, iter2++) {
325 maxenergychange=std::max(maxenergychange,fabs(*iter1 - *iter2));
326 }
327 double delta_energy=fabs(energies[0]-oldenergies[0]);
328
329 bool bsh_conv=param.converge_bsh_residual() ? bsh_norm<dconv : true;
330 bool total_energy_conv=param.converge_total_energy() ? delta_energy<econv : true;
331 bool each_energy_conv=param.converge_each_energy() ? maxenergychange<econv*3.0 : true;
332 bool density_conv=param.converge_density() ? delta_density<dconv : true;
333
334 if (world.rank()==0 and param.print_level()>2) {
335 std::stringstream line;
336 line << "convergence: bshresidual, energy change, max energy change, density change "
337 << std::scientific << std::setprecision(1)
338 << bsh_norm << " " << delta_energy << " "
339 << maxenergychange << " " << delta_density;
340 print(line.str());
341 }
342
343 return (bsh_conv and density_conv and each_energy_conv and total_energy_conv);
344 }
345
347
348 /// the nuclear correlation factor
349 std::shared_ptr<NuclearCorrelationFactor> ncf;
350
351 /// the nuclear correlation factor
353
354 /// the square of the nuclear correlation factor
356
357
358};
359
360
361/// The Nemo class
362class Nemo: public NemoBase, public QCPropertyInterface {
363 typedef std::shared_ptr<real_convolution_3d> poperatorT;
364 friend class PNO;
365 friend class TDHF;
366
367public:
368 /// class holding parameters for a nemo calculation beyond the standard dft parameters from moldft
370 static constexpr char const* tag = "nemo";
371
376
380
381 std::string get_tag() const override {
382 return std::string("dft");
383 }
384
386 // check if parameters are initialized for a nemo calculation already
387 if (parameter_exists("ncf")) return;
388 initialize<std::pair<std::string,double> > ("ncf",{"slater",2.0},"nuclear correlation factor");
389 initialize<bool> ("hessian",false,"compute the hessian matrix");
390 initialize<bool> ("read_cphf",false,"read the converged orbital response for nuclear displacements from file");
391 initialize<bool> ("restart_cphf",false,"read the guess orbital response for nuclear displacements from file");
392 initialize<bool> ("purify_hessian",false,"symmetrize the hessian matrix based on atomic charges");
393 }
394
395 std::pair<std::string,double> ncf() const {return get<std::pair<std::string,double> >("ncf");}
396 bool hessian() const {return get<bool>("hessian");}
397
398 };
399
400
401public:
402 std::filesystem::path work_dir;
403
404 /// ctor
405
406 /// @param[in] world1 the world
407 /// @param[in] calc the SCF
408// Nemo(World& world1, std::shared_ptr<SCF> calc, const std::string inputfile);
409
410 Nemo(World& world, const commandlineparser& parser);
411
412 /// \p pcm_param defaults to the bare `pcm` group; the solvent still arrives from
413 /// param.pcm_data() via PCMParameters::set_derived_values, so a caller that never
414 /// parsed a deck keeps working.
416 const Molecule& molecule, const PCMParameters& pcm_param = PCMParameters());
417
418 std::string name() const {return "nemo";}
419 bool selftest() {return false;}
420
421 static void help() {
422 print_header2("help page for NEMO");
423 print("The nemo code computes Hartree-Fock and DFT energies, gradients and hessians using a nuclear correlation factor");
424 print("that regularizes the singular nuclear potential. SCF orbitals for the basis for post-SCF calculations like");
425 print("excitation energies (cis), correlation energies (cc2), local potentials (oep), etc\n");
426 print("A nemo calculation input is mostly identical to a moldft calculation input, but it uses the additional input");
427 print("parameter ncf (nuclear correlation factor)\n");
428 print("You can print all available calculation parameters by running\n");
429 print("nemo --print_parameters\n");
430 print("You can perform a simple calculation by running\n");
431 print("nemo --geometry=h2o.xyz\n");
432 print("provided you have an xyz file in your directory.\n\n");
433 print("To see what a restart archive holds -- geometry, k, the precision it");
434 print("converged to, whether it is moldft or nemo orbitals -- without starting");
435 print("a calculation:\n");
436 print("nemo --restart_info=<prefix>\n");
437
438 }
439
440 static void print_parameters() {
442 print("default parameters for the nemo program are");
443 param.print("nemo","end");
444 print("\n\nthe molecular geometry must be specified in a separate block:");
446 }
447
448
449 bool check_converged(const Tensor<double>& x) const {
450 double xsq = x.sumsq();
451 return (xsq == coords_sum);
452 }
453
454 virtual double value() {return value(calc->molecule.get_all_coords());}
455
456 virtual double value(const Tensor<double>& x);
457
458 void load_mos(World& w) {
459 calc->load_mos(w);
460 }
461
462 /// compute dipole moment and gradient at the current geometry
463 virtual nlohmann::json analyze() const;
464
465 /// compute the nuclear gradients
467
468 bool provides_gradient() const {return true;}
469
470 /// returns the molecular hessian matrix at structure x
472
473 /// construct the fock operator based on the calculation parameters (K or XC?)
474 virtual std::shared_ptr<Fock<double,3>> make_fock_operator() const;
475
476 /// purify and symmetrize the hessian
477
478 /// The hessian should be symmetric, but it is not, because
479 /// \f[
480 /// \langle i^{Y_B}|H^{X_A}|i\rangle \neq \langle i|H^{X_A}|i^{Y_B}\rangle
481 /// \f]
482 /// does holds analytically, but not numerically. If the two numbers
483 /// differ, pick the more trustworthy, which is the one with a heavy
484 /// atom causing the perturbed density and the light atom being the
485 /// nuclear singularity.
486 /// @param[in] hessian the raw hessian
487 /// @return a symmetrized hessian
489
490
491 /// solve the CPHF equations for the nuclear displacements
492
493 /// this function computes that part of the orbital response that is
494 /// orthogonal to the occupied space. If no NCF's are used this
495 /// corresponds to the normal response. If NCF's are used the part
496 /// parallel to the occupied space must be added!
497 /// \f[
498 /// F^X = F^\perp + F^\parallel
499 /// \f]
500 /// cf parallel_CPHF()
501 /// @param[in] iatom the atom A to be moved
502 /// @param[in] iaxis the coordinate X of iatom to be moved
503 /// @return \ket{i^X} or \ket{F^\perp}
504 vecfuncT solve_cphf(const size_t iatom, const int iaxis, const Tensor<double>& fock,
505 const vecfuncT& guess, const vecfuncT& rhsconst,
506 const Tensor<double>& incomplete_hessian, const vecfuncT& parallel,
507 const SCFProtocol& p, const std::string& xc_data) const;
508
509 /// solve the CPHF equation for all displacements
510
511 /// this function computes the nemo response F^X
512 /// \f[
513 /// F^X = F^\perp + F^\parallel
514 /// \f]
515 /// To reconstruct the unregularized orbital response (not recommended):
516 /// \f[
517 /// i^X = R^X F + R F^X
518 /// \f]
519 /// The orbital response i^X constructed in this way is automatically
520 /// orthogonal to the occupied space because of the parallel term F^\parallel
521 /// @return a vector of the nemo response F^X for all displacements
522 std::vector<vecfuncT> compute_all_cphf();
523
524 /// this function computes that part of the orbital response that is
525 /// parallel to the occupied space.
526 /// \f[
527 /// F^X = F^\perp + F^\parallel
528 /// \f]
529 /// If no NCF's are used F^\parallel vanishes.
530 /// If NCF's are used this term does not vanish because the derivatives of
531 /// the NCF does not vanish, and it is given by
532 /// \f[
533 /// F_i^\parallel = -\frac{1}{2}\sum_k|F_k ><F_k | (R^2)^X | F_i>
534 /// \f]
535 vecfuncT compute_cphf_parallel_term(const size_t iatom, const int iaxis) const;
536
537 /// compute the IR intensities in the double harmonic approximation
538
539 /// use the projected normal modes; units are km/mol
540 /// @param[in] normalmodes the normal modes
541 /// @param[in] dens_pt the perturbed densities for each nuclear displacement
543 const vecfuncT& dens_pt) const;
544
545 std::shared_ptr<SCF> get_calc() const {return calc;}
546
548 const CalculationParameters& get_calc_param() const {return calc->param;}
549
550 PCM get_pcm()const{return pcm;}
551
552 /// compute the Fock matrix from scratch
553 tensorT compute_fock_matrix(const vecfuncT& nemo, const tensorT& occ) const;
554
555 /// return a reference to the molecule
556 Molecule& molecule() {return calc->molecule;}
557
558 /// return a reference to the molecule
560 return calc->molecule;
561 }
562
563 /// make the density (alpha or beta)
565 const vecfuncT& nemo) const;
566
567 /// make the density using different bra and ket vectors
568
569 /// e.g. for computing the perturbed density \sum_i \phi_i \phi_i^X
570 /// or when using nemos: \sum_i R2nemo_i nemo_i
572 const vecfuncT& bra, const vecfuncT& ket, const bool refine=false) const;
573
574 /// make the derivative of the density
575
576 /// \f$ \nabla\rho = 2R^X R \rho_R + R^2\nabla \rho_R \f$
577 /// @param[in] rhonemo the regularized density
578 /// @param[in] axis the component of the nabla operator
579 /// @return the gradient of the *reconstructed* density
581 const int axis) const;
582
583 /// compute the reduced densities sigma (gamma) for GGA functionals
585 const real_function_3d& rho2) const;
586
587
588 /// the Laplacian of the density
589
590
591 /// compute the kinetic energy potential using Eq. (16) of
592 /// R. A. King and N. C. Handy, “Kinetic energy functionals from the Kohn–Sham potential,”
593 /// Phys. Chem. Chem. Phys., vol. 2, no. 22, pp. 5049–5056, 2000.
595
596
597 /// smooth a function by projecting it onto k-1 and then average with k
598
599 /// kept it here for further testing
601 int k=f.get_impl()->get_k();
602 real_function_3d fproj=project(f,k-1);
603 real_function_3d freproj=project(fproj,k);
604 f=0.5*(f+freproj);
605 }
606
607protected:
608
609 std::shared_ptr<SCF> calc;
610
611public:
613
614protected:
616
617public:
618
619 /// return the symmetry_projector
623
624private:
625
626 /// sum of square of coords at last solved geometry
627 mutable double coords_sum;
628
629protected:
630 /// a poisson solver
631 std::shared_ptr<real_convolution_3d> poisson;
632
633 /// asymptotic correction for DFT
635
636// /// apply the AC scheme of Tozer/Handy with the multipole approximation
637// Function<double,3> apply_ac(const Function<double,3>& vxc)const{
638// return ac.apply(vxc);
639// }
640//
641// /// apply the AC scheme of Tozer/Handy using the hartree potential
642// Function<double,3> apply_ac(const Function<double,3>& vxc, const Function<double,3>& vhartree)const{
643// return ac.apply(vxc,vhartree);
644// }
645//
646// /// apply the AC scheme of Tozer/Handy
647// Function<double,3> apply_ac_excited(Function<double,3>& vxc, const Function<double,3>& vhartree)const{
648// return ac.apply_potential(vxc,vhartree);
649// }
650
651private:
652 /// polarizable continuum model
654// AC<3> ac;
655
656protected:
657 /// adapt the thresholds consistently to a common value
658 void set_protocol(const double thresh) {
659
660 // sets FunctionDefaults, including k -- which SCF::set_protocol derives
661 // from thresh unless the user pinned it
662 calc->set_protocol<3>(world,thresh);
663
665 timer timer1(world,get_calc_param().print_level()>2);
666 get_calc()->make_nuclear_potential(world);
667 construct_nuclear_correlation_factor(calc->molecule, calc->potentialmanager, get_nemo_param().ncf());
668 timer1.end("reproject ncf");
669 }
670
671 // (re) construct the Poisson solver
672 poisson = std::shared_ptr<real_convolution_3d>(
674
675 // Bring the MOs to the new k and thresh. This must come AFTER the ncf
676 // has been rebuilt, because the normalization inside reproject_mos uses
677 // R as the metric and would otherwise mix polynomial orders itself.
678 reproject_mos(calc->amo,R);
679 reproject_mos(calc->bmo,R);
680
681 // The AO basis has to follow k as well. moldft reprojects it inside its
682 // protocol loop (SCF.h, MolecularEnergy::value); nemo projected it once
683 // outside the ladder, so a k change left it behind -- and Nemo::localize
684 // hands it to the Localizer next to the freshly reprojected nemos.
685 const int k=FunctionDefaults<3>::get_k();
686 if (calc->ao.size()>0 and calc->ao.front().k()!=k) {
687 if (world.rank()==0 and get_calc_param().print_level()>2)
688 print("reprojecting the AO basis from k =",calc->ao.front().k(),"to k =",k);
689 calc->ao.clear();
690 world.gop.fence();
691 calc->ao=calc->project_ao_basis(world,calc->aobasis);
692 }
693
694 }
695
696 /// solve the HF equations
697 double solve(const SCFProtocol& proto);
698
699 /// given nemos, compute the HF energy using the regularized expressions for T and V
700 std::vector<double> compute_energy_regularized(const vecfuncT& nemo, const vecfuncT& Jnemo,
701 const vecfuncT& Knemo, const vecfuncT& Unemo) const;
702
703 /// compute the reconstructed orbitals, and all potentials applied on nemo
704
705 /// to use these potentials in the fock matrix computation they must
706 /// be multiplied by the nuclear correlation factor
707 /// @param[in] nemo the nemo orbitals
708 /// @param[out] Jnemo Coulomb operator applied on the nemos
709 /// @param[out] Knemo exchange operator applied on the nemos
710 /// @param[out] pcmnemo PCM (solvent) potential applied on the nemos
711 /// @param[out] Unemo regularized nuclear potential applied on the nemos
712 /// @param[out] xcflux the vector field Y_i that the orbital update pushes
713 /// through the Green's function, see
714 /// XCOperator::weak_xc_terms. Assigned in the weak form
715 /// only and left EMPTY otherwise, which is how the caller
716 /// tells the two forms apart.
717 /// @param[out] fock_xc the xc block of the Fock matrix. In the weak form it
718 /// cannot be recovered from xcnemo any more, because what
719 /// is missing from xcnemo is exactly the term that has no
720 /// multiplicative representation. Assigned in the weak
721 /// form only and left untouched otherwise.
723 vecfuncT& Jnemo, vecfuncT& Knemo, vecfuncT& xcnemo, vecfuncT& pcmnemo,
724 vecfuncT& Unemo, std::vector<vecfuncT>& xcflux, tensorT& fock_xc) const {
725 compute_nemo_potentials_impl(nemo, Jnemo, Knemo, xcnemo, pcmnemo, Unemo,
726 xcflux, fock_xc, true);
727 }
728
729 /// compute all potentials applied on nemo, without the weak-form split
730
731 /// The pre-weak-form signature, kept for callers that have no use for the
732 /// flux. It never opts in to the weak form, whatever `xc_weak_gga` says, so
733 /// xcnemo always carries the complete multiplicative xc potential and the
734 /// xc block of the Fock matrix can be read off it as before. Silently
735 /// discarding xcflux instead would drop the semilocal term.
737 vecfuncT& Jnemo, vecfuncT& Knemo, vecfuncT& xcnemo, vecfuncT& pcmnemo,
738 vecfuncT& Unemo) const {
739 std::vector<vecfuncT> xcflux;
740 tensorT fock_xc;
741 compute_nemo_potentials_impl(nemo, Jnemo, Knemo, xcnemo, pcmnemo, Unemo,
742 xcflux, fock_xc, false);
743 }
744
745 /// implementation of both compute_nemo_potentials forms
746
747 /// @param[in] allow_weak opt in to the weak form; it is then used iff
748 /// the `xc_weak_gga` parameter asks for it
750 vecfuncT& Jnemo, vecfuncT& Knemo, vecfuncT& xcnemo, vecfuncT& pcmnemo,
751 vecfuncT& Unemo, std::vector<vecfuncT>& xcflux, tensorT& fock_xc,
752 const bool allow_weak) const;
753
754 /// return the Coulomb potential
756
757 /// compute the incomplete hessian
758
759 /// incomplete hessian is the nuclear-nuclear contribution, and the
760 /// contribution from the second derivative of the nuclear potential,
761 /// and also the derivative of the nuclear correlation factor.
762 /// i.e. all contributions that *do not* contain the regularized perturbed
763 /// density, but it will contain parts of the perturbed density
765
766 /// compute the complementary incomplete hessian
767
768 /// @param[in] xi the response functions including the parallel part
770 const std::vector<vecfuncT>& xi) const;
771
772 /// compute the constant term for the CPHF equations
773
774 /// mainly all terms with the nuclear correlation factor's derivatives
775 vecfuncT make_cphf_constant_term(const size_t iatom, const int iaxis,
776 const vecfuncT& R2nemo, const real_function_3d& rhonemo) const;
777
778public:
779
780 bool is_dft() const {return calc->xc.is_dft();}
781
782 bool do_pcm() const {return get_calc_param().pcm_data() != "none";}
783
784 /// the asymptotic correction is defunct: its `ac_data` parameter was removed,
785 /// and the code paths guarded by do_ac() are kept but never taken. It was
786 /// never reconciled with the weak xc form, whose Fock block is built from the
787 /// uncorrected potential.
788 bool do_ac() const {return false;}
789
790 AC<3> get_ac() const {return ac;}
791
792 bool do_symmetry() const {return (symmetry_projector.get_pointgroup()!="C1");}
793
794protected:
795
796 /// localize the nemo orbitals
797 vecfuncT localize(const vecfuncT& nemo, const double dconv, const bool randomize) const;
798protected:
799 /// return the threshold for vanishing elements in orbital rotations
800 double trantol() const {
801 return calc->vtol / std::min(30.0, double(get_calc()->amo.size()));
802 }
803
804 void make_plots(const real_function_3d &f,const std::string &name="function")const{
805 double width = FunctionDefaults<3>::get_cell_min_width()/2.0 - 1.e-3;
807 coord_3d start(0.0); start[0]=-width;
808 coord_3d end(0.0); end[0]=width;
809 plot_line(("line_"+name).c_str(),1000,start,end,f);
810 }
811
812 /// save a function
813 template<typename T, size_t NDIM>
814 void save_function(const std::vector<Function<T,NDIM> >& f, const std::string name) const;
815
816 /// load a function
817 template<typename T, size_t NDIM>
818 void load_function(std::vector<Function<T,NDIM> >& f, const std::string name) const;
819
820};
821
822/// save a function
823template<typename T, size_t NDIM>
824void Nemo::save_function(const std::vector<Function<T,NDIM> >& f, const std::string name) const {
825 if (world.rank()==0) print("saving vector of functions",name);
827 ar & f.size();
828 for (const Function<T,NDIM>& ff:f) ar & ff;
829}
830
831/// load a function
832template<typename T, size_t NDIM>
833void Nemo::load_function(std::vector<Function<T,NDIM> >& f, const std::string name) const {
834 if (world.rank()==0) print("loading vector of functions",name);
836 std::size_t fsize=0;
837 ar & fsize;
838 f.resize(fsize);
839 for (std::size_t i=0; i<fsize; ++i) ar & f[i];
840}
841
842}
843
844#endif /* NEMO_H_ */
845
double w(double t, double eps)
Definition DKops.h:22
solution protocol for SCF calculations
Definition AC.h:431
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:101
static int get_k()
Returns the default wavelet order.
Definition funcdefaults.h:170
static const double & get_thresh()
Returns the default threshold.
Definition funcdefaults.h:183
static double get_cell_min_width()
Returns the minimum width of any user cell dimension.
Definition funcdefaults.h:405
A multiresolution adaptive numerical function.
Definition mra.h:144
int k() const
Returns the number of multiwavelets (k). No communication.
Definition mra.h:696
double thresh() const
Returns value of truncation threshold. No communication.
Definition mra.h:677
void set_thresh(double value, bool fence=true)
Sets the value of the truncation threshold. Optional global fence.
Definition mra.h:687
void clear(bool fence=true)
Clears the function as if constructed uninitialized. Optional fence.
Definition mra.h:1020
bool is_initialized() const
Returns true if the function is initialized.
Definition mra.h:172
Definition molecule.h:129
static void print_parameters()
Definition molecule.cc:120
Definition nemo.h:70
std::shared_ptr< NuclearCorrelationFactor > ncf
the nuclear correlation factor
Definition nemo.h:349
double compute_kinetic_energy1a(const std::vector< Function< T, NDIM > > &nemo) const
compute kinetic energy as square of the "analytical" derivative of the orbitals
Definition nemo.h:284
double compute_kinetic_energy1(const std::vector< Function< T, NDIM > > &nemo) const
compute kinetic energy as square of the "analytical" derivative of the orbitals
Definition nemo.h:267
std::shared_ptr< NuclearCorrelationFactor > get_ncf_ptr() const
create an instance of the derived object based on the input parameters
Definition nemo.h:84
virtual void invalidate_factors_and_potentials()
Definition nemo.h:187
static void normalize(std::vector< Function< T, NDIM > > &nemo, const Function< double, NDIM > metric=Function< double, NDIM >())
normalize the nemos
Definition nemo.h:90
void reproject_mos(std::vector< Function< T, NDIM > > &nemo, const Function< double, NDIM > &metric) const
reproject a set of nemos onto the current k and thresh
Definition nemo.h:114
NemoBase(World &w)
Definition nemo.h:74
real_function_3d R
the nuclear correlation factor
Definition nemo.h:352
Function< typename Tensor< T >::scalar_type, NDIM > compute_density(const std::vector< Function< T, NDIM > > nemo) const
Definition nemo.h:168
virtual std::shared_ptr< Fock< double, 3 > > make_fock_operator() const
Definition nemo.h:78
virtual bool need_recompute_factors_and_potentials(const double thresh) const
Definition nemo.h:172
real_function_3d R_square
the square of the nuclear correlation factor
Definition nemo.h:355
Tensor< double > compute_gradient(const real_function_3d &rhonemo, const Molecule &molecule) const
compute the nuclear gradients
Definition madness/chem/nemo.cc:106
double compute_kinetic_energy(const std::vector< Function< T, NDIM > > &nemo) const
compute kinetic energy as square of the "analytical" expectation value
Definition nemo.h:219
static Tensor< T > Q2(const Tensor< T > &s)
Definition nemo.h:135
void construct_nuclear_correlation_factor(const Molecule &molecule, const std::shared_ptr< PotentialManager > &pm, const std::pair< std::string, double > &ncf_parameter)
Definition nemo.h:193
double compute_kinetic_energy2(const std::vector< Function< T, NDIM > > &nemo) const
compute kinetic energy as direct derivative of the orbitals (probably imprecise)
Definition nemo.h:302
World & world
Definition nemo.h:346
void orthonormalize(std::vector< Function< T, NDIM > > &nemo, const Function< double, NDIM > metric=Function< double, NDIM >(), const double trantol=FunctionDefaults< NDIM >::get_thresh() *0.01) const
orthonormalize the vectors
Definition nemo.h:143
virtual ~NemoBase()
Definition nemo.h:76
bool check_convergence(const std::vector< double > energies, const std::vector< double > oldenergies, const double bsh_norm, const double delta_density, const CalculationParameters &param, const double econv, const double dconv) const
Definition nemo.h:317
The Nemo class.
Definition nemo.h:362
void set_protocol(const double thresh)
adapt the thresholds consistently to a common value
Definition nemo.h:658
bool do_symmetry() const
Definition nemo.h:792
virtual double value()
Definition nemo.h:454
projector_irrep get_symmetry_projector() const
return the symmetry_projector
Definition nemo.h:620
tensorT compute_fock_matrix(const vecfuncT &nemo, const tensorT &occ) const
compute the Fock matrix from scratch
Definition madness/chem/nemo.cc:443
double trantol() const
return the threshold for vanishing elements in orbital rotations
Definition nemo.h:800
const NemoCalculationParameters & get_nemo_param() const
Definition nemo.h:547
std::filesystem::path work_dir
Definition nemo.h:402
Molecule & molecule() const
return a reference to the molecule
Definition nemo.h:559
void compute_nemo_potentials(const vecfuncT &nemo, vecfuncT &Jnemo, vecfuncT &Knemo, vecfuncT &xcnemo, vecfuncT &pcmnemo, vecfuncT &Unemo, std::vector< vecfuncT > &xcflux, tensorT &fock_xc) const
compute the reconstructed orbitals, and all potentials applied on nemo
Definition nemo.h:722
vecfuncT compute_cphf_parallel_term(const size_t iatom, const int iaxis) const
Definition madness/chem/nemo.cc:1837
void load_function(std::vector< Function< T, NDIM > > &f, const std::string name) const
load a function
Definition nemo.h:833
std::shared_ptr< SCF > get_calc() const
Definition nemo.h:545
Tensor< double > purify_hessian(const Tensor< double > &hessian) const
purify and symmetrize the hessian
Definition madness/chem/nemo.cc:1304
std::shared_ptr< real_convolution_3d > poperatorT
Definition nemo.h:363
real_function_3d get_coulomb_potential(const vecfuncT &psi) const
return the Coulomb potential
Definition madness/chem/nemo.cc:929
std::vector< double > compute_energy_regularized(const vecfuncT &nemo, const vecfuncT &Jnemo, const vecfuncT &Knemo, const vecfuncT &Unemo) const
given nemos, compute the HF energy using the regularized expressions for T and V
Definition madness/chem/nemo.cc:719
Tensor< double > gradient(const Tensor< double > &x)
compute the nuclear gradients
Definition madness/chem/nemo.cc:1079
virtual nlohmann::json analyze() const
compute dipole moment and gradient at the current geometry
Definition madness/chem/nemo.cc:335
const CalculationParameters & get_calc_param() const
Definition nemo.h:548
double solve(const SCFProtocol &proto)
solve the HF equations
Definition madness/chem/nemo.cc:525
vecfuncT solve_cphf(const size_t iatom, const int iaxis, const Tensor< double > &fock, const vecfuncT &guess, const vecfuncT &rhsconst, const Tensor< double > &incomplete_hessian, const vecfuncT &parallel, const SCFProtocol &p, const std::string &xc_data) const
solve the CPHF equations for the nuclear displacements
Definition madness/chem/nemo.cc:1488
Tensor< double > make_incomplete_hessian() const
compute the incomplete hessian
Definition madness/chem/nemo.cc:1349
std::vector< vecfuncT > compute_all_cphf()
solve the CPHF equation for all displacements
Definition madness/chem/nemo.cc:1657
Tensor< double > make_incomplete_hessian_response_part(const std::vector< vecfuncT > &xi) const
compute the complementary incomplete hessian
Definition madness/chem/nemo.cc:1407
real_function_3d make_density(const Tensor< double > &occ, const vecfuncT &nemo) const
make the density (alpha or beta)
Definition madness/chem/nemo.cc:935
const NemoCalculationParameters nemo_param
Definition nemo.h:612
static void smoothen(real_function_3d &f)
smooth a function by projecting it onto k-1 and then average with k
Definition nemo.h:600
PCM get_pcm() const
Definition nemo.h:550
Tensor< double > compute_IR_intensities(const Tensor< double > &normalmodes, const vecfuncT &dens_pt) const
compute the IR intensities in the double harmonic approximation
Definition madness/chem/nemo.cc:1856
virtual std::shared_ptr< Fock< double, 3 > > make_fock_operator() const
construct the fock operator based on the calculation parameters (K or XC?)
Definition madness/chem/nemo.cc:378
std::shared_ptr< SCF > calc
Definition nemo.h:609
void load_mos(World &w)
Definition nemo.h:458
static void print_parameters()
Definition nemo.h:440
bool check_converged(const Tensor< double > &x) const
Definition nemo.h:449
bool provides_gradient() const
Override this to return true if the derivative is implemented.
Definition nemo.h:468
real_function_3d kinetic_energy_potential(const vecfuncT &nemo) const
the Laplacian of the density
Definition madness/chem/nemo.cc:979
void compute_nemo_potentials(const vecfuncT &nemo, vecfuncT &Jnemo, vecfuncT &Knemo, vecfuncT &xcnemo, vecfuncT &pcmnemo, vecfuncT &Unemo) const
compute all potentials applied on nemo, without the weak-form split
Definition nemo.h:736
PCM pcm
polarizable continuum model
Definition nemo.h:653
VibrationalResults hessian(const Tensor< double > &x)
returns the molecular hessian matrix at structure x
Definition madness/chem/nemo.cc:1109
void save_function(const std::vector< Function< T, NDIM > > &f, const std::string name) const
save a function
Definition nemo.h:824
void make_plots(const real_function_3d &f, const std::string &name="function") const
Definition nemo.h:804
bool do_ac() const
Definition nemo.h:788
projector_irrep symmetry_projector
Definition nemo.h:615
double coords_sum
sum of square of coords at last solved geometry
Definition nemo.h:627
std::shared_ptr< real_convolution_3d > poisson
a poisson solver
Definition nemo.h:631
real_function_3d make_sigma(const real_function_3d &rho1, const real_function_3d &rho2) const
compute the reduced densities sigma (gamma) for GGA functionals
Definition madness/chem/nemo.cc:1052
real_function_3d make_ddensity(const real_function_3d &rhonemo, const int axis) const
make the derivative of the density
Definition madness/chem/nemo.cc:962
AC< 3 > ac
asymptotic correction for DFT
Definition nemo.h:634
vecfuncT localize(const vecfuncT &nemo, const double dconv, const bool randomize) const
localize the nemo orbitals
Definition madness/chem/nemo.cc:361
bool do_pcm() const
Definition nemo.h:782
bool selftest()
Definition nemo.h:419
AC< 3 > get_ac() const
Definition nemo.h:790
vecfuncT make_cphf_constant_term(const size_t iatom, const int iaxis, const vecfuncT &R2nemo, const real_function_3d &rhonemo) const
compute the constant term for the CPHF equations
Definition madness/chem/nemo.cc:1436
void compute_nemo_potentials_impl(const vecfuncT &nemo, vecfuncT &Jnemo, vecfuncT &Knemo, vecfuncT &xcnemo, vecfuncT &pcmnemo, vecfuncT &Unemo, std::vector< vecfuncT > &xcflux, tensorT &fock_xc, const bool allow_weak) const
implementation of both compute_nemo_potentials forms
Definition madness/chem/nemo.cc:808
Molecule & molecule()
return a reference to the molecule
Definition nemo.h:556
std::string name() const
Definition nemo.h:418
static void help()
Definition nemo.h:421
bool is_dft() const
Definition nemo.h:780
functor for a local U1 dot U1 potential
Definition correlationfactor.h:554
input parameters for the polarizable continuum model – the pcm data group
Definition pcm.h:69
interface class to the PCMSolver library
Definition pcm.h:132
Definition PNO.h:27
class for holding the parameters for calculation
Definition chem/QCCalculationParametersBase.h:296
void read_input_and_commandline_options(World &world, const commandlineparser &parser, const std::string tag)
Definition chem/QCCalculationParametersBase.h:332
bool parameter_exists(const std::string &key) const
Definition chem/QCCalculationParametersBase.h:591
class implementing properties of QC models
Definition QCPropertyInterface.h:11
struct for running a protocol of subsequently tightening precision
Definition SCFProtocol.h:54
Definition TDHF.h:219
A tensor is a multidimensional array.
Definition tensor.h:318
T sumsq() const
Returns the sum of the squares of the elements.
Definition tensor.h:1670
Definition Results.h:196
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition worldgop.cc:177
A parallel world class.
Definition world.h:134
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:344
WorldGopInterface & gop
Global operations.
Definition world.h:216
An archive for storing local or parallel data, wrapping a BinaryFstreamInputArchive.
Definition parallel_archive.h:366
An archive for storing local or parallel data wrapping a BinaryFstreamOutputArchive.
Definition parallel_archive.h:321
Definition pointgroupsymmetry.h:98
std::string get_pointgroup() const
get the point group name
Definition pointgroupsymmetry.h:170
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
static double lo
Definition dirac-hatom.cc:23
Defines/implements plotting interface for functions.
double psi(const Vector< double, 3 > &r)
Definition hatom_energy.cc:78
Implements (2nd generation) static load/data balancing for functions.
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
optimize the geometrical structure of a molecule
Main include file for MADNESS and defines Function interface.
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
std::shared_ptr< NuclearCorrelationFactor > create_nuclear_correlation_factor(World &world, const Molecule &molecule, const std::shared_ptr< PotentialManager > potentialmanager, const std::string inputline)
create and return a new nuclear correlation factor
Definition correlationfactor.cc:45
void print_header2(const std::string &s)
medium section heading
Definition print.cc:54
Function< double, NDIM > abssq(const Function< double_complex, NDIM > &z, bool fence=true)
Returns a new function that is the square of the absolute value of the input.
Definition mra.h:2965
std::vector< double > norm2s(World &world, const std::vector< Function< T, NDIM > > &v)
Computes the 2-norms of a vector of functions.
Definition vmra.h:927
Function< TENSOR_RESULT_TYPE(T, R), NDIM > dot(World &world, const std::vector< Function< T, NDIM > > &a, const std::vector< Function< R, NDIM > > &b, bool fence=true, bool do_make_redundant=true)
Multiplies and sums two vectors of functions r = \sum_i a[i] * b[i]; see dot_sparse for screening.
Definition vmra.h:1848
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > transform(World &world, const std::vector< Function< T, NDIM > > &v, const Tensor< R > &c, bool fence=true)
Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].
Definition vmra.h:758
void truncate(World &world, std::vector< Function< T, NDIM > > &v, double tol=0.0, bool fence=true)
Truncates a vector of functions.
Definition vmra.h:336
const std::vector< Function< T, NDIM > > & reconstruct(const std::vector< Function< T, NDIM > > &v)
reconstruct a vector of functions
Definition vmra.h:163
void set_thresh(World &world, std::vector< Function< T, NDIM > > &v, double thresh, bool fence=true)
Sets the threshold in a vector of functions.
Definition vmra.h:1457
double norm2(World &world, const std::vector< Function< T, NDIM > > &v)
Computes the 2-norm of a vector of functions.
Definition vmra.h:961
void plot_plane(World &world, const Function< double, NDIM > &function, const std::string name)
Definition funcplot.h:625
FunctionFactory< double, 3 > real_factory_3d
Definition functypedefs.h:108
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:227
void refine(World &world, const std::vector< Function< T, NDIM > > &vf, bool fence=true)
refine the functions according to the autorefine criteria
Definition vmra.h:197
NDIM & f
Definition mra.h:2668
static SeparatedConvolution< double, 3 > * CoulombOperatorPtr(World &world, double lo, double eps, const std::array< LatticeRange, 3 > &lattice_ranges=FunctionDefaults< 3 >::get_bc().lattice_range(), int k=FunctionDefaults< 3 >::get_k())
Factory function generating separated kernel for convolution with 1/r in 3D.
Definition operator.h:1766
vector< functionT > vecfuncT
Definition corepotential.cc:58
CCPairFunction< T, NDIM > apply(const SeparatedConvolution< T, NDIM/2 > &op, const CCPairFunction< T, NDIM > &arg)
apply the operator to the argument
Definition ccpairfunction.h:896
std::vector< Function< T, NDIM > > grad(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
shorthand gradient operator
Definition vmra.h:2316
Function< T, CCPairFunction< T, NDIM >::LDIM > inner(const CCPairFunction< T, NDIM > &c, const Function< T, CCPairFunction< T, NDIM >::LDIM > &f, const std::tuple< int, int, int > v1, const std::tuple< int, int, int > v2)
Definition ccpairfunction.h:993
void scale(World &world, std::vector< Function< T, NDIM > > &v, const std::vector< Q > &factors, bool fence=true)
Scales inplace a vector of functions by distinct values.
Definition vmra.h:874
void plot_line(World &world, const char *filename, int npt, const Vector< double, NDIM > &lo, const Vector< double, NDIM > &hi, const opT &op)
Generates ASCII file tabulating f(r) at npoints along line r=lo,...,hi.
Definition funcplot.h:442
Function< T, NDIM > project(const Function< T, NDIM > &other, int k=FunctionDefaults< NDIM >::get_k(), double thresh=FunctionDefaults< NDIM >::get_thresh(), bool fence=true)
Definition mra.h:2651
std::string name(const FuncType &type, const int ex=-1)
Definition ccpairfunction.h:28
Derivative< double, 3 > real_derivative_3d
Definition functypedefs.h:185
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
@ nemo
nemo's regularized orbitals F = psi/R
static long abs(long a)
Definition tensor.h:219
Implementation of Krylov-subspace nonlinear equation solver.
Implements most functionality of separated operators.
double Q(double a)
Definition relops.cc:20
static const double thresh
Definition rk.cc:45
static const long k
Definition rk.cc:44
const double xi
Exponent for delta function approx.
Definition siam_example.cc:60
Definition test_ar.cc:204
Definition CalculationParameters.h:51
std::string pcm_data() const
Definition CalculationParameters.h:237
Definition molecular_optimizer.h:46
virtual Molecule & molecule()
return the molecule of the target
Definition molecular_optimizer.h:49
class holding parameters for a nemo calculation beyond the standard dft parameters from moldft
Definition nemo.h:369
void initialize_nemo_parameters()
Definition nemo.h:385
std::pair< std::string, double > ncf() const
Definition nemo.h:395
bool hessian() const
Definition nemo.h:396
static constexpr char const * tag
Definition nemo.h:370
NemoCalculationParameters(World &world, const commandlineparser &parser)
Definition nemo.h:372
std::string get_tag() const override
Definition nemo.h:381
NemoCalculationParameters()
Definition nemo.h:377
very simple command line parser
Definition commandlineparser.h:28
Definition timing_utilities.h:9
double end(const std::string msg)
Definition timing_utilities.h:56
Definition dirac-hatom.cc:112
InputParameters param
Definition tdse.cc:203
static double guess(const coordT &r)
Definition tdse.confused.cc:345
AtomicInt sum
Definition test_atomicint.cc:46
constexpr std::size_t NDIM
Definition testgconv.cc:54
std::size_t axis
Definition testpdiff.cc:59
Defines operations on vectors of Functions.