33 #ifndef MADNESS_CHEM_POTENTIALMANAGER_H__INCLUDED
34 #define MADNESS_CHEM_POTENTIALMANAGER_H__INCLUDED
59 : molecule(molecule) {}
73 : molecule(molecule) {}
85 const unsigned int core;
89 : molecule(molecule), atom(atom), core(core), m(m) {};
91 return molecule.
core_eval(atom, core, m, r[0], r[1], r[2]);
98 const unsigned int core;
102 : molecule(molecule), atom(atom), axis(axis), core(core), m(m) {};
104 return molecule.
core_derivative(atom, axis, core, m, r[0], r[1], r[2]);
117 : molecule(molecule), core_type(core_type) {}
125 int npsi = psi.size();
126 if (npsi == 0)
return psi;
127 int natom = molecule.
natom();
131 for (
int i=0; i<natom; ++i) {
134 unsigned int nshell = molecule.
n_core_orb(atn);
135 if (nshell == 0)
continue;
136 for (
unsigned int c=0;
c<nshell; ++
c) {
138 int max_m = (l+1)*(l+2)/2;
140 for (
int m=0;
m<max_m; ++
m) {
143 overlap_sum += overlap;
144 for (
int j=0; j<npsi; ++j) {
145 if (include_Bc) overlap[j] *= molecule.
get_core_bc(atn,
c);
146 proj[j] += core.
scale(overlap[j]);
152 if (world.rank() == 0)
print(
"sum_k <core_k|psi_i>:", overlap_sum);
159 std::vector<double> bc;
161 unsigned int ncore = molecule.
n_core_orb(atn);
164 for (
unsigned int c=0;
c<ncore; ++
c) {
166 int max_m = (l+1)*(l+2)/2;
167 for (
int m=0;
m<max_m; ++
m) {
178 for (
unsigned int c=0;
c<cores.size(); ++
c) {
182 for (
unsigned int i=0; i<mo.size(); ++i) {
183 rcore += rdcores[i] * rcores[i] * occ[i];
185 r += 2.0 * bc[
c] * rcore;
192 if (core_type.substr(0,3) ==
"mcp") {
205 if (core_type !=
"") {
double core_eval(int atom, unsigned int core, int m, double x, double y, double z) const
Definition: chem/molecule.cc:648
unsigned int n_core_orb(unsigned int atn) const
Definition: chem/molecule.h:123
Definition: shared_ptr_bits.h:38
Definition: potentialmanager.h:68
std::complex< double > func(int n, int t1, int t2, int t3, double xx, double yy, double zz)
Definition: wannier.cc:98
MolecularPotentialFunctor(const Molecule &molecule)
Definition: potentialmanager.h:58
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:577
Header to declare stuff which has not yet found a home.
FunctionDefaults holds default paramaters as static class members.
Definition: funcdefaults.h:175
void gaxpy(World &world, Q alpha, std::vector< Function< T, NDIM > > &a, Q beta, const std::vector< Function< R, NDIM > > &b, bool fence=true)
Generalized A*X+Y for vectors of functions -— a[i] = alpha*a[i] + beta*b[i].
Definition: vmra.h:680
MolecularCorePotentialFunctor(const Molecule &molecule)
Definition: potentialmanager.h:72
CoreOrbitalDerivativeFunctor(Molecule &molecule, int atom, int axis, unsigned int core, int m)
Definition: potentialmanager.h:101
std::vector< madness::Vector< double, 3 > > get_all_coords_vec() const
Definition: chem/molecule.cc:188
double operator()(const coord_3d &x) const
Definition: potentialmanager.h:75
void make_nuclear_potential(World &world)
Definition: potentialmanager.h:199
::std::string string
Definition: gtest-port.h:872
std::vector< coord_3d > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: potentialmanager.h:79
double nuclear_attraction_potential(double x, double y, double z) const
Definition: chem/molecule.cc:579
double get_core_bc(unsigned int atn, unsigned int c) const
Definition: chem/molecule.h:134
std::vector< coord_3d > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: potentialmanager.h:65
double core_derivative(int atom, int axis, unsigned int core, int m, double x, double y, double z) const
Definition: chem/molecule.cc:657
static const double & get_thresh()
Returns the default threshold.
Definition: funcdefaults.h:225
void set_thresh(double value, bool fence=true)
Sets the vaule of the truncation threshold. Optional global fence.
Definition: mra.h:552
std::vector< real_function_3d > vector_real_function_3d
Definition: functypedefs.h:79
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:896
T inner(const vecfunc< T, NDIM > &a, const vecfunc< T, NDIM > &b)
the non-linear solver requires an inner product
Definition: nemo.h:112
Definition: potentialmanager.h:54
Function< double, 3 > real_function_3d
Definition: functypedefs.h:65
Defines and implements most of Tensor.
Definition: potentialmanager.h:95
int natom() const
Definition: chem/molecule.h:148
void reconstruct(bool fence=true) const
Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm...
Definition: mra.h:737
CoreOrbitalFunctor(Molecule &molecule, int atom, unsigned int core, int m)
Definition: potentialmanager.h:88
vector_real_function_3d core_projection(World &world, const vector_real_function_3d &psi, const bool include_Bc=true)
Definition: potentialmanager.h:123
double psi(const Vector< double, 3 > &r)
Definition: apps/ii/hatom_energy.cc:42
unsigned int atomic_number
Atomic number.
Definition: chem/molecule.h:58
unsigned int get_core_l(unsigned int atn, unsigned int c) const
Definition: chem/molecule.h:130
void apply_nonlocal_potential(World &world, const vector_real_function_3d &amo, vector_real_function_3d Vpsi)
Definition: potentialmanager.h:191
double operator()(const coord_3d &r) const
Definition: potentialmanager.h:90
Tensor< double > real_tensor
Definition: functypedefs.h:40
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
std::shared_ptr< FunctionFunctorInterface< double, 3 > > real_functor_3d
Definition: functypedefs.h:107
double operator()(const coord_3d &x) const
Definition: potentialmanager.h:61
Definition: chem/molecule.h:55
Abstract base class interface required for functors used as input to Functions.
Definition: function_interface.h:58
PotentialManager(const Molecule &molecule, const std::string &core_type)
Definition: potentialmanager.h:116
const double m
Definition: gfit.cc:199
Definition: potentialmanager.h:82
Definition: chem/molecule.h:83
real_function_3d vnuclear()
Definition: potentialmanager.h:119
void print(const A &a)
Print a single item to std::cout terminating with new line.
Definition: print.h:122
FunctionFactory< double, 3 > real_factory_3d
Definition: functypedefs.h:93
Definition: potentialmanager.h:109
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
const double c
Definition: gfit.cc:200
double core_projector_derivative(World &world, const vector_real_function_3d &mo, const real_tensor &occ, int atom, int axis)
Definition: potentialmanager.h:156
const Atom & get_atom(unsigned int i) const
Definition: chem/molecule.cc:223
double molecular_core_potential(double x, double y, double z) const
Definition: chem/molecule.cc:670
double operator()(const coord_3d &r) const
Definition: potentialmanager.h:103