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