MADNESS 0.10.1
potentialmanager.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 $Id$
32*/
33#ifndef MADNESS_CHEM_POTENTIALMANAGER_H__INCLUDED
34#define MADNESS_CHEM_POTENTIALMANAGER_H__INCLUDED
35
36/**
37 * @file potentialmanager.h
38 * @brief Declaration of molecule-related classes and functions.
39 */
40
45#include <vector>
46#include <string>
47#include <iostream>
48#include <fstream>
49#include <sstream>
50#include <algorithm>
51#include <ctype.h>
52#include <cmath>
54#include <madness/misc/misc.h>
56#include <madness/mra/mra.h>
57
58namespace madness {
59/**
60 * @class MolecularPotentialFunctor
61 * @brief Functor for evaluating the nuclear attraction potential of a molecule at a given point.
62 *
63 * This class implements the FunctionFunctorInterface for 3D coordinates and provides
64 * an interface to evaluate the nuclear attraction potential (smoothed Coulomb potential)
65 * of a molecule at a specified point in space. It also provides access to special points,
66 * the coordinates of all nuclei in the molecule.
67 *
68 */
70private:
72public:
74
77
78 double operator()(const coord_3d& r) const {
79 return molecule.nuclear_attraction_potential(r[0], r[1], r[2]);
80 }
81
82 std::vector<coord_3d> special_points() const {return molecule.get_all_coords_vec();}
83};
84
85/**
86 * @class MolecularCorePotentialFunctor
87 * @brief Functor for evaluating the molecular core potential at a given point in space.
88 *
89 * This class implements the FunctionFunctorInterface to provide a callable object
90 * that computes the molecular core potential for a given 3D coordinate using the
91 * associated Molecule instance.
92 *
93 */
95private:
97public:
99
102
103 double operator()(const coord_3d& r) const {
104 return molecule.molecular_core_potential(r[0], r[1], r[2]);
105 }
106
107 std::vector<coord_3d> special_points() const {return molecule.get_all_coords_vec();}
108};
109
110/**
111 * @class CoreOrbitalFunctor
112 * @brief Functor for evaluating a core orbital of a specific atom in a molecule.
113 *
114 * This class implements the FunctionFunctorInterface for evaluating the value of a core orbital
115 * at a given 3D coordinate. It holds references to a molecule, the atom index, the core orbital index,
116 * and the magnetic quantum number m.
117 *
118 */
121 const int atom;
122 const unsigned int core;
123 const int m;
124public:
126
127 CoreOrbitalFunctor(Molecule& molecule, int atom, unsigned int core, int m)
128 : molecule(molecule), atom(atom), core(core), m(m) {};
129 double operator()(const coord_3d& r) const {
130 return molecule.core_eval(atom, core, m, r[0], r[1], r[2]);
131 };
132};
133
134/**
135 * @class CoreOrbitalDerivativeFunctor
136 * @brief Functor for evaluating the derivative of a core orbital for a given atom in a molecule.
137 *
138 * It encapsulates the logic to compute the derivative of a specified core orbital with respect to a given axis
139 * for a particular atom in a molecule. It holds references to a molecule, the atom index, the axis index,
140 * the core orbital index, and the magnetic quantum number m.
141 *
142 */
145 const int atom, axis;
146 const unsigned int core;
147 const int m;
148public:
150
153 double operator()(const coord_3d& r) const {
154 return molecule.core_derivative(atom, axis, core, m, r[0], r[1], r[2]);
155 };
156};
157
158/**
159 * @class NuclearDensityFunctor
160 * @brief Default functor for evaluating nuclear density at a given point in space.
161 *
162 * This class implements a functor that computes the nuclear density for a given molecule,
163 * supporting both open and periodic boundary conditions. It can be used to evaluate the
164 * nuclear density at any point in 3D space, and provides special points and refinement
165 * level information for adaptive algorithms.
166 *
167 */
169private:
173 std::vector<coord_3d> special_points_;
174 int maxR;
176 double rscale = 1.0;
177public:
179
180 /**
181 * @brief Constructs a NuclearDensityFunctor for evaluating nuclear densities.
182 *
183 * This constructor can handle both open and periodic boundary conditions.
184 *
185 * @param atoms Reference to the molecule containing the atoms.
186 * @param bc Boundary conditions for the simulation (default: open boundaries).
187 * @param cell Simulation cell tensor (unit cell, if periodic; default: identity).
188 * @param special_level The initial refinement level for special points (default: 15).
189 * @param rscale Scaling factor for the nuclear radius. Setting rscale > 1 increases the effective size of a nucleus by this factor (i.e., rcut is divided by rscale).
190 */
194 int special_level = 15,
195 double rscale = 1.0);
196
197 double operator()(const coord_3d& x) const final;
198
199 std::vector<coord_3d> special_points() const final;
200
201 Level special_level() const final;
202
204
205};
206
207/**
208 * @class GaussianNuclearDensityPotentialFunctor
209 * @brief Functor for evaluating the Coulomb potential of all nuclei of a molecule; nuclei are represented by primitive spherical (l=0) Gaussians.
210 *
211 * It computes the Gaussian potential generated by a given molecule at a specified position.
212 *
213 * @note DOI 10.1006/adnd.1997.0751
214 */
216 private:
219
220 public:
222
225
226 double operator()(const madness::coord_3d& R) const final;
227
229
230 std::vector<coord_3d> special_points() const { return molecule.get_all_coords_vec(); }
231};
232
233/**
234 * @class FermiNuclearDensityFunctor
235 * @brief Functor representing the Fermi nuclear density distribution for a given atom.
236 *
237 * This class implements a functor that evaluates the two-parameter charge distribution for
238 * the nuclear density at a given 3D coordinate. The density is significant only in a small
239 * region around the atomic center.
240 *
241 * @note DOI 10.1006/adnd.1997.0751
242 */
244 private:
245 const Atom& atom;
246 int special_level_ = 18;
247
248 public:
249 using FunctionFunctorInterface<double,3>::operator();
250
251 FermiNuclearDensityFunctor(const Atom& atom, int special_level = 18)
252 : atom(atom), special_level_(special_level) {}
253
254 double operator()(const madness::coord_3d& R) const final;
255
256 madness::Level special_level() const final { return special_level_; };
257
258 std::vector<coord_3d> special_points() const final { return {atom.get_coords()}; }
259};
260
261/**
262 * @class WignerSeitzPotentialFunctor
263 * @brief Functor for evaluating the Wigner-Seitz potential in a simulation cell.
264 *
265 * This class implements a functor that evaluates the electrostatic potential
266 * in a simulation cell due to a set of point charges, with optional periodic
267 * boundary conditions and configurable lattice summation range.
268 *
269 * The potential is computed by summing contributions from point charges
270 * in the simulation cell and their periodic images, as determined by the
271 * specified boundary conditions and kernel range.
272 *
273 * @note The lattice summation range can be overridden by the user, or
274 * determined automatically based on the boundary conditions and kernel range.
275 */
277public:
278 using FunctionFunctorInterface<double,3>::operator();
279
280 /**
281 * @brief Constructs a WignerSeitzPotentialFunctor evaluating the potential
282 * in a simulation cell due to point charges, optionally with periodic
283 * boundary conditions and a specified lattice summation range.
284 *
285 * @tparam Int Integer type for the lattice summation range.
286 * @param atoms List of point charges in the simulation cell.
287 * @param c The simulation cell dimensions.
288 * @param b The boundary conditions.
289 * @param r The kernel range along each Cartesian direction.
290 * @param lattice_sum_range Overrides the default lattice summation range along each axis.
291 * By default, this is determined by the number of cells in each direction with
292 * nonzero contributions to the simulation cell.
293 */
294 template <typename Int>
296 BoundaryConditions<3> b, std::array<KernelRange, 3> r,
297 std::array<Int, 3> lattice_sum_range)
298 : atoms(atoms), cell(std::move(c)), bc(std::move(b)), range(std::move(r)),
299 cell_width{cell(0, 1) - cell(0, 0), cell(1, 1) - cell(1, 0),
300 cell(2, 1) - cell(2, 0)},
301 rcell_width{1. / cell_width[0], 1. / cell_width[1],
303 for (int d = 0; d != 3; ++d)
305 }
306
307 /**
308 * @brief Constructs a WignerSeitzPotentialFunctor with default lattice sum range.
309 *
310 * This constructor initializes the WignerSeitzPotentialFunctor using the provided molecule,
311 * coefficients tensor, boundary conditions, and kernel ranges. It automatically computes
312 * the default lattice sum range using the given boundary conditions and kernel ranges.
313 *
314 * @param atoms The molecule containing the atomic positions and properties.
315 * @param c The tensor of coefficients for the potential calculation.
316 * @param b The boundary conditions for the simulation cell.
317 * @param r The kernel ranges for each spatial dimension.
318 *
319 * @note This constructor delegates to the main constructor, passing the default lattice sum range.
320 * In this case, the move is a cast, and calling make_default_lattice_sum_range like this is OK.
321 */
323 BoundaryConditions<3> b, std::array<KernelRange, 3> r) :
324 WignerSeitzPotentialFunctor(atoms, std::move(c), std::move(b), std::move(r), make_default_lattice_sum_range(b,r)) {}
325
326 double operator()(const coord_3d &x) const final;
327
328 std::vector<coord_3d> special_points() const final;
329
330 static std::array<std::int64_t, 3> make_default_lattice_sum_range(const BoundaryConditions<3>& bc, const std::array<KernelRange, 3>& range) {
331 std::array<std::int64_t, 3> result;
332 for (int d = 0; d != 3; ++d) {
333 result[d] = bc.is_periodic()[d] ? (range[d].iextent_x2() + 1) / 2 : 0;
334 }
335 return result;
336 }
337
338private:
342 const std::array<KernelRange, 3> range;
343 const std::array<double, 3> cell_width;
344 const std::array<double, 3> rcell_width;
345 const std::array<std::int64_t, 3> lattice_sum_range;
346};
347
348/**
349 * @class SAPFunctor
350 * @brief Functor for evaluating a smoothed atomic potential, supporting open and periodic boundary conditions.
351 *
352 * This class implements the FunctionFunctorInterface for a 3D double-valued function,
353 * representing a smoothed interpolated atomic potential centered on a given atom. It supports
354 * both open and periodic boundary conditions, and allows customization of the smoothing
355 * parameter, simulation cell, and initial refinement level.
356 *
357 */
358class SAPFunctor : public FunctionFunctorInterface<double,3> {
359 private:
360 const Atom& atom;
365 public:
366 using FunctionFunctorInterface<double,3>::operator();
367
368 /**
369 * @brief Constructs a SAPFunctor for evaluating a smoothed 1/r potential.
370 *
371 * This constructor initializes the SAPFunctor with a given atom, smoothing parameter,
372 * boundary conditions, simulation cell, and an initial refinement level. It supports
373 * both open and periodic boundary conditions.
374 *
375 * @param atom The atom for which the potential is evaluated.
376 * @param smoothing_param Controls the smoothness of the 1/r potential.
377 * @param bc Boundary conditions for the simulation (default: open or as specified by FunctionDefaults).
378 * @param cell The simulation cell tensor (default: as specified by FunctionDefaults).
379 * @param special_level The initial refinement level (default: 15).
380 */
381 SAPFunctor(const Atom& atom,
382 double smoothing_param,
385 int special_level = 15);
386
387 double operator()(const coord_3d& x) const final;
388
389 Level special_level() const final;
390
391 std::vector<coord_3d> special_points() const final;
392};
393
394/**
395 * @class PotentialManager
396 * @brief Manages molecular potentials and core projections for quantum chemistry calculations.
397 *
398 * This class encapsulates the management of nuclear and core potentials for a given molecule,
399 * including the construction of nuclear potentials, application of nonlocal core projectors,
400 * and calculation of core projector derivatives. It provides interfaces to access the molecule,
401 * core type, and nuclear potential, as well as to perform core projections and apply nonlocal potentials.
402 *
403 */
405private:
408std::string core_type_;
409
410public:
411 PotentialManager(const Molecule& molecule, const std::string& core_type)
412 : mol(molecule), core_type_(core_type) {}
413
414 const Molecule& molecule() const {
415 return this->mol;
416 }
417
418 const std::string& core_type() const {
419 return this->core_type_;
420 }
421
423 return vnuc;
424 }
425
426 /**
427 * @brief Projects the input wavefunctions onto the atomic core orbitals.
428 *
429 * This function computes the projection of the given set of wavefunctions (`psi`)
430 * onto the core orbitals of each atom in the molecule. The projection is performed
431 * for each atom and each of its core orbitals, accumulating the result in the
432 * returned vector of functions. Optionally, the projection can include the core
433 * boundary condition factor (`Bc`).
434 *
435 * @param world The MADNESS World object for parallel execution and data management.
436 * @param psi The input vector of real 3D functions (wavefunctions) to be projected.
437 * @param include_Bc If true, includes the core boundary condition factor in the projection (default: true).
438 * @return A vector of real 3D functions representing the projection of `psi` onto the core orbitals.
439 *
440 */
441 vector_real_function_3d core_projection(World & world, const vector_real_function_3d& psi, const bool include_Bc = true)
442 {
443 int npsi = psi.size();
444 if (npsi == 0) return psi;
445 int natom = mol.natom();
446 vector_real_function_3d proj = zero_functions_compressed<double,3>(world, npsi);
447 real_tensor overlap_sum(static_cast<long>(npsi));
448
449 for (int i=0; i<natom; ++i) {
450 Atom at = mol.get_atom(i);
451 unsigned int atn = at.atomic_number;
452 unsigned int nshell = mol.n_core_orb(atn);
453 if (nshell == 0) continue;
454 for (unsigned int c=0; c<nshell; ++c) {
455 unsigned int l = mol.get_core_l(atn, c);
456 int max_m = (l+1)*(l+2)/2;
457 nshell -= max_m - 1;
458 for (int m=0; m<max_m; ++m) {
460 real_tensor overlap = inner(world, core, psi);
461 overlap_sum += overlap;
462 for (int j=0; j<npsi; ++j) {
463 if (include_Bc) overlap[j] *= mol.get_core_bc(atn, c);
464 proj[j] += core.scale(overlap[j]);
465 }
466 }
467 }
468 world.gop.fence();
469 }
470 if (world.rank() == 0) print("sum_k <core_k|psi_i>:", overlap_sum);
471 return proj;
472 }
473
474 /**
475 * @brief Computes the derivative of the core projector operator with respect to a given axis for a specified atom.
476 *
477 * This function projects the core orbitals and their derivatives onto the molecular orbitals,
478 * then evaluates the sum:
479 * \f[
480 * \sum_i \mathrm{occ}_i \langle \psi_i | \left( \sum_c B_c \frac{d}{dx} | \mathrm{core} \rangle \langle \mathrm{core} | \right) | \psi_i \rangle
481 * \f]
482 * where \f$ \psi_i \f$ are molecular orbitals, \f$ \mathrm{occ}_i \f$ are their occupations,
483 * and the sum over \f$ c \f$ runs over the core orbitals of the specified atom.
484 *
485 * @param world The MADNESS World object for parallel computation.
486 * @param mo The vector of molecular orbitals as real-valued 3D functions.
487 * @param occ The occupation numbers for each molecular orbital.
488 * @param atom The index of the atom for which the core projector derivative is computed.
489 * @param axis The spatial axis (0=x, 1=y, 2=z) along which the derivative is taken.
490 * @return The computed derivative value as a double.
491 */
492 double core_projector_derivative(World & world, const vector_real_function_3d& mo, const real_tensor& occ, int atom, int axis)
493 {
494 vector_real_function_3d cores, dcores;
495 std::vector<double> bc;
496 unsigned int atn = mol.get_atom(atom).atomic_number;
497 unsigned int ncore = mol.n_core_orb(atn);
498
499 // projecting core & d/dx core
500 for (unsigned int c=0; c<ncore; ++c) {
501 unsigned int l = mol.get_core_l(atn, c);
502 int max_m = (l+1)*(l+2)/2;
503 for (int m=0; m<max_m; ++m) {
505 cores.push_back(real_function_3d(real_factory_3d(world).functor(func).truncate_on_project()));
507 dcores.push_back(real_function_3d(real_factory_3d(world).functor(func).truncate_on_project()));
508 bc.push_back(mol.get_core_bc(atn, c));
509 }
510 }
511
512 // calc \sum_i occ_i <psi_i|(\sum_c Bc d/dx |core><core|)|psi_i>
513 double r = 0.0;
514 for (unsigned int c=0; c<cores.size(); ++c) {
515 double rcore= 0.0;
516 real_tensor rcores = inner(world, cores[c], mo);
517 real_tensor rdcores = inner(world, dcores[c], mo);
518 for (unsigned int i=0; i<mo.size(); ++i) {
519 rcore += rdcores[i] * rcores[i] * occ[i];
520 }
521 r += 2.0 * bc[c] * rcore;
522 }
523
524 return r;
525 }
526
528 if (core_type_.substr(0,3) == "mcp") {
529 // START_TIMER(world);
530 gaxpy(world, 1.0, Vpsi, 1.0, core_projection(world, amo));
531 // END_TIMER(world, "MCP Core Projector");
532 }
533 }
534
536 double safety = 0.1;
537 double vtol = FunctionDefaults<3>::get_thresh() * safety;
540 vnuc.reconstruct();
541 // "" is legacy core_type value for all-electron (also be used by CorePotentialManager)
542 // "none" is current core_type value for all-electron
543 if (core_type_ != "" && core_type_ != "none") {
546 c_pot.reconstruct();
547 vnuc += c_pot;
548 vnuc.truncate();
549 }
550 }
551};
552}
553
554#endif
Declaration of utility class and functions for atom.
Definition molecule.h:60
unsigned int atomic_number
Atomic number.
Definition molecule.h:63
madness::Vector< double, 3 > get_coords() const
Definition molecule.h:106
This class is used to specify boundary conditions for all operators.
Definition bc.h:72
Functor for evaluating the derivative of a core orbital for a given atom in a molecule.
Definition potentialmanager.h:143
double operator()(const coord_3d &r) const
Definition potentialmanager.h:153
CoreOrbitalDerivativeFunctor(Molecule &molecule, int atom, int axis, unsigned int core, int m)
Definition potentialmanager.h:151
const Molecule molecule
Definition potentialmanager.h:144
const int axis
Definition potentialmanager.h:145
const int atom
Definition potentialmanager.h:145
const unsigned int core
Definition potentialmanager.h:146
const int m
Definition potentialmanager.h:147
Functor for evaluating a core orbital of a specific atom in a molecule.
Definition potentialmanager.h:119
CoreOrbitalFunctor(Molecule &molecule, int atom, unsigned int core, int m)
Definition potentialmanager.h:127
double operator()(const coord_3d &r) const
Definition potentialmanager.h:129
const int m
Definition potentialmanager.h:123
const unsigned int core
Definition potentialmanager.h:122
const int atom
Definition potentialmanager.h:121
const Molecule molecule
Definition potentialmanager.h:120
Functor representing the Fermi nuclear density distribution for a given atom.
Definition potentialmanager.h:243
const Atom & atom
Definition potentialmanager.h:245
FermiNuclearDensityFunctor(const Atom &atom, int special_level=18)
Definition potentialmanager.h:251
madness::Level special_level() const final
Override this to change the minimum level of refinement at special points (default is 6)
Definition potentialmanager.h:256
std::vector< coord_3d > special_points() const final
Override this to return list of special points to be refined more deeply.
Definition potentialmanager.h:258
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:101
FunctionFactory implements the named-parameter idiom for Function.
Definition function_factory.h:86
virtual FunctionFactory & thresh(double thresh)
Definition function_factory.h:198
FunctionFactory & functor(const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > &f)
Definition function_factory.h:141
FunctionFactory & truncate_on_project()
Definition function_factory.h:264
FunctionFactory & initial_level(int initial_level)
Definition function_factory.h:204
Abstract base class interface required for functors used as input to Functions.
Definition function_interface.h:68
Function< T, NDIM > & scale(const Q q, bool fence=true)
Inplace, scale the function by a constant. No communication except for optional fence.
Definition mra.h:1126
void set_thresh(double value, bool fence=true)
Sets the value of the truncation threshold. Optional global fence.
Definition mra.h:687
Function< T, NDIM > & truncate(double tol=0.0, bool fence=true)
Truncate the function with optional fence. Compresses with fence if not compressed.
Definition mra.h:712
const Function< T, NDIM > & reconstruct(bool fence=true) const
Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm.
Definition mra.h:944
Functor for evaluating the Coulomb potential of all nuclei of a molecule; nuclei are represented by p...
Definition potentialmanager.h:215
madness::Level special_level() const final
Override this to change the minimum level of refinement at special points (default is 6)
Definition potentialmanager.h:228
std::vector< coord_3d > special_points() const
Override this to return list of special points to be refined more deeply.
Definition potentialmanager.h:230
GaussianNuclearDensityPotentialFunctor(const madness::Molecule &molecule, int special_level=15)
Definition potentialmanager.h:223
const Molecule & molecule
Definition potentialmanager.h:217
Definition kernelrange.h:60
Functor for evaluating the molecular core potential at a given point in space.
Definition potentialmanager.h:94
double operator()(const coord_3d &r) const
Definition potentialmanager.h:103
std::vector< coord_3d > special_points() const
Override this to return list of special points to be refined more deeply.
Definition potentialmanager.h:107
MolecularCorePotentialFunctor(const Molecule &molecule)
Definition potentialmanager.h:100
const Molecule & molecule
Definition potentialmanager.h:96
Functor for evaluating the nuclear attraction potential of a molecule at a given point.
Definition potentialmanager.h:69
MolecularPotentialFunctor(const Molecule &molecule)
Definition potentialmanager.h:75
const Molecule & molecule
Definition potentialmanager.h:71
double operator()(const coord_3d &r) const
Definition potentialmanager.h:78
std::vector< coord_3d > special_points() const
Override this to return list of special points to be refined more deeply.
Definition potentialmanager.h:82
Definition molecule.h:129
std::vector< madness::Vector< double, 3 > > get_all_coords_vec() const
Definition molecule.cc:463
double get_core_bc(unsigned int atn, unsigned int c) const
Definition molecule.h:449
const Atom & get_atom(unsigned int i) const
Definition molecule.cc:502
double core_derivative(int atom, int axis, unsigned int core, int m, double x, double y, double z) const
Definition molecule.cc:1222
double molecular_core_potential(double x, double y, double z) const
Definition molecule.cc:1235
double nuclear_attraction_potential(double x, double y, double z) const
nuclear attraction potential for the whole molecule
Definition molecule.cc:1088
size_t natom() const
Definition molecule.h:463
double core_eval(int atom, unsigned int core, int m, double x, double y, double z) const
Definition molecule.cc:1213
unsigned int get_core_l(unsigned int atn, unsigned int c) const
Definition molecule.h:447
unsigned int n_core_orb(unsigned int atn) const
Definition molecule.h:440
Default functor for evaluating nuclear density at a given point in space.
Definition potentialmanager.h:168
BoundaryConditions< 3 > bc_
Definition potentialmanager.h:171
Level special_level() const final
Override this to change the minimum level of refinement at special points (default is 6)
Definition potentialmanager.cc:100
Tensor< double > cell
Definition potentialmanager.h:172
const Molecule & atoms
Definition potentialmanager.h:170
NuclearDensityFunctor & set_rscale(double rscale)
Definition potentialmanager.cc:104
double rscale
Definition potentialmanager.h:176
double operator()(const coord_3d &x) const final
Definition potentialmanager.cc:72
std::vector< coord_3d > special_points_
Definition potentialmanager.h:173
int maxR
Definition potentialmanager.h:174
std::vector< coord_3d > special_points() const final
Override this to return list of special points to be refined more deeply.
Definition potentialmanager.cc:98
int special_level_
Definition potentialmanager.h:175
Manages molecular potentials and core projections for quantum chemistry calculations.
Definition potentialmanager.h:404
Molecule mol
Definition potentialmanager.h:406
void apply_nonlocal_potential(World &world, const vector_real_function_3d &amo, vector_real_function_3d Vpsi)
Definition potentialmanager.h:527
const Molecule & molecule() const
Definition potentialmanager.h:414
const real_function_3d & vnuclear()
Definition potentialmanager.h:422
PotentialManager(const Molecule &molecule, const std::string &core_type)
Definition potentialmanager.h:411
const std::string & core_type() const
Definition potentialmanager.h:418
real_function_3d vnuc
Definition potentialmanager.h:407
vector_real_function_3d core_projection(World &world, const vector_real_function_3d &psi, const bool include_Bc=true)
Projects the input wavefunctions onto the atomic core orbitals.
Definition potentialmanager.h:441
double core_projector_derivative(World &world, const vector_real_function_3d &mo, const real_tensor &occ, int atom, int axis)
Computes the derivative of the core projector operator with respect to a given axis for a specified a...
Definition potentialmanager.h:492
void make_nuclear_potential(World &world)
Definition potentialmanager.h:535
std::string core_type_
Definition potentialmanager.h:408
Functor for evaluating a smoothed atomic potential, supporting open and periodic boundary conditions.
Definition potentialmanager.h:358
const Atom & atom
Definition potentialmanager.h:360
Level special_level_
Definition potentialmanager.h:364
BoundaryConditions< 3 > bc_
Definition potentialmanager.h:362
Tensor< double > cell
Definition potentialmanager.h:363
double smoothing_param
Definition potentialmanager.h:361
A tensor is a multidimensional array.
Definition tensor.h:318
Functor for evaluating the Wigner-Seitz potential in a simulation cell.
Definition potentialmanager.h:276
const BoundaryConditions< 3 > bc
Definition potentialmanager.h:341
WignerSeitzPotentialFunctor(const Molecule &atoms, Tensor< double > c, BoundaryConditions< 3 > b, std::array< KernelRange, 3 > r)
Constructs a WignerSeitzPotentialFunctor with default lattice sum range.
Definition potentialmanager.h:322
const std::array< double, 3 > rcell_width
Definition potentialmanager.h:344
const std::array< double, 3 > cell_width
Definition potentialmanager.h:343
const std::array< std::int64_t, 3 > lattice_sum_range
Definition potentialmanager.h:345
WignerSeitzPotentialFunctor(const Molecule &atoms, Tensor< double > c, BoundaryConditions< 3 > b, std::array< KernelRange, 3 > r, std::array< Int, 3 > lattice_sum_range)
Constructs a WignerSeitzPotentialFunctor evaluating the potential in a simulation cell due to point c...
Definition potentialmanager.h:295
const std::array< KernelRange, 3 > range
Definition potentialmanager.h:342
const Tensor< double > cell
Definition potentialmanager.h:340
const Molecule & atoms
Definition potentialmanager.h:339
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
Declaration of core potential related class.
static const double R
Definition csqrt.cc:46
std::complex< double > inner(const Fcwf &psi, const Fcwf &phi)
Definition fcwf.cc:311
double psi(const Vector< double, 3 > &r)
Definition hatom_energy.cc:78
double func(double x)
A simple program for testing the CubicInterpolationTable class.
Definition interp3.cc:43
Provides 1D cubic interpolation class.
#define final(a, b, c)
Definition lookup3.c:153
#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
void print(const tensorT &t)
Definition mcpfit.cc:140
Header to declare stuff which has not yet found a home.
Main include file for MADNESS and defines Function interface.
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
std::shared_ptr< FunctionFunctorInterface< double, 3 > > real_functor_3d
Definition functypedefs.h:122
std::vector< real_function_3d > vector_real_function_3d
Definition functypedefs.h:94
int Level
Definition key.h:59
std::array< LatticeRange, NDIM > lattice_sum_range()
Definition bc.h:253
static XNonlinearSolver< std::vector< Function< T, NDIM > >, T, vector_function_allocator< T, NDIM > > nonlinear_vector_solver(World &world, const long nvec)
Definition nonlinsol.h:371
void gaxpy(const double a, ScalarResult< T > &left, const double b, const T &right, const bool fence=true)
the result type of a macrotask must implement gaxpy
Definition macrotaskq.h:244
@ mo
moldft orbitals psi
Definition mraimpl.h:53
static const double b
Definition nonlinschro.cc:119
static const double d
Definition nonlinschro.cc:121
static const double c
Definition relops.cc:10
static const double m
Definition relops.cc:9
Defines and implements most of Tensor.
std::size_t axis
Definition testpdiff.cc:59
static Molecule molecule
Definition testperiodicdft.cc:39
real_function_1d vnuc(World &world, double t)
Definition testspectralprop.cc:347