votca 2026-dev
Loading...
Searching...
No Matches
environmentscreening.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2026 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_ENVIRONMENTSCREENING_H
22#define VOTCA_XTP_ENVIRONMENTSCREENING_H
23
24// Standard includes
25#include <string>
26#include <vector>
27
28// Local VOTCA includes
29#include "aobasis.h"
30#include "classicalsegment.h"
31#include "eigen.h"
32#include "qmmolecule.h"
33
74
75namespace votca {
76namespace xtp {
77
89 std::vector<PolarSegment> explicit_segments;
90 double exp_damp = 0.39;
91 std::vector<PolarSegment> shell_segments;
92 double shell_dielectric = 4.0;
93 bool include_kreac = true;
94 // Width of the polar sites as seen by the QM charge density, in units of
95 // alpha^(1/3): each site responds to the QM field averaged over a
96 // unit-charge Gaussian exp(-r^2/R^2)/(pi^(3/2) R^3), R = site_width *
97 // alpha_iso^(1/3). 0 gives point sites. See SiteWidths.
98 double site_width = 0.5;
99
100 bool empty() const {
101 return explicit_segments.empty() && shell_segments.empty();
102 }
103};
104
110 // Lowest eigenvalue of R = T^T B T. Must be > -1.
111 double lowest = 0.0;
112 // Number of eigenvalues at or below -1.
114 bool ok() const { return lowest > -1.0; }
115 // Multi-line report: spectrum, the geometry of the closest contacts, and
116 // for the lowest modes where their charge sits on the QM side and which
117 // polar sites carry their reaction. Always filled.
118 std::string report;
119};
120
122 public:
145 static Eigen::MatrixXd AuxFieldAtPoints(
146 const AOBasis& auxbasis, const std::vector<Eigen::Vector3d>& points,
147 const std::vector<double>& widths = {});
155 static Eigen::MatrixXd AuxPotentialAtPoints(
156 const AOBasis& auxbasis, const std::vector<Eigen::Vector3d>& points,
157 const std::vector<double>& widths);
158 // widths (bohr, one per point, or empty for all zero): a point with
159 // width R > 0 is a unit-charge Gaussian exp(-r^2/R^2)/(pi^(3/2) R^3)
160 // rather than a point, and F is minus the gradient of the Coulomb
161 // interaction (chi_Q | g_R) with respect to its centre -- a libint2
162 // two-centre Coulomb integral, same stencil. Outside the extent of the
163 // auxiliary functions a spherical charge acts as a point (Newton), so
164 // this changes F only where a site sits inside their tails -- which is
165 // exactly where point sites over-respond (see Check). R = 0 is the
166 // nuclear-attraction path above, unchanged.
167
187 static std::vector<double> SiteWidths(
188 const std::vector<PolarSegment>& segments, double site_width);
189
211 static Eigen::MatrixXd ReactionFieldKernel(
212 const Eigen::MatrixXd& F, const std::vector<PolarSegment>& segments,
213 double exp_damp);
227 static Eigen::MatrixXd ChargeResponseKernel(
228 const Eigen::MatrixXd& F, const Eigen::MatrixXd& Phi,
229 const std::vector<PolarSegment>& segments, double exp_damp);
230
249 static Eigen::MatrixXd ShellKernel(const Eigen::MatrixXd& F,
250 const std::vector<PolarSegment>& segments,
251 double epsilon);
252
263 static Eigen::MatrixXd SymmetrizedReactionField(const Eigen::MatrixXd& B,
264 const Eigen::MatrixXd& T);
265
273 static Eigen::MatrixXd DressingMatrix(const Eigen::MatrixXd& R);
274
280 static Eigen::MatrixXd Kernel(const AOBasis& auxbasis,
281 const ScreeningEnvironment& env);
282
289 static Eigen::MatrixXd Metric(const AOBasis& auxbasis);
290
310 static ScreeningCheck Check(const AOBasis& auxbasis, const QMMolecule& atoms,
311 const ScreeningEnvironment& env,
312 const Eigen::MatrixXd& T, Index n_modes = 3);
313
314 private:
315 // Net charge of every auxiliary function, integral chi_Q d^3r, in the
316 // order and normalization of the three-centre integrals. Defined, like
317 // AuxFieldAtPoints, in libint2_calls.cc, the translation unit that
318 // includes libint2.
319 static Eigen::VectorXd AuxCharges(const AOBasis& auxbasis);
320};
321
322} // namespace xtp
323} // namespace votca
324
325#endif // VOTCA_XTP_ENVIRONMENTSCREENING_H
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
static Eigen::VectorXd AuxCharges(const AOBasis &auxbasis)
static Eigen::MatrixXd ShellKernel(const Eigen::MatrixXd &F, const std::vector< PolarSegment > &segments, double epsilon)
The tail beyond the explicit region: legacy's radial_dielectric.
static Eigen::MatrixXd Metric(const AOBasis &auxbasis)
T for an auxiliary basis on its own: the metric TCMatrix_gwbse::Fill folds into the three-centre inte...
static Eigen::MatrixXd AuxPotentialAtPoints(const AOBasis &auxbasis, const std::vector< Eigen::Vector3d > &points, const std::vector< double > &widths)
The electrostatic potential of each auxiliary function (as a charge density) at each point,...
static Eigen::MatrixXd Kernel(const AOBasis &auxbasis, const ScreeningEnvironment &env)
B for a whole environment: ReactionFieldKernel of the explicit segments plus ShellKernel of the shell...
static Eigen::MatrixXd DressingMatrix(const Eigen::MatrixXd &R)
S = (1 + R)^(1/2), the dressing of the auxiliary index that turns the bare interaction into u = v + v...
static ScreeningCheck Check(const AOBasis &auxbasis, const QMMolecule &atoms, const ScreeningEnvironment &env, const Eigen::MatrixXd &T, Index n_modes=3)
Builds R for env and reports whether 1 + R is positive definite, and why not.
static Eigen::MatrixXd ReactionFieldKernel(const Eigen::MatrixXd &F, const std::vector< PolarSegment > &segments, double exp_damp)
B = -F A^-1 F^T for an explicit Thole region.
static Eigen::MatrixXd ChargeResponseKernel(const Eigen::MatrixXd &F, const Eigen::MatrixXd &Phi, const std::vector< PolarSegment > &segments, double exp_damp)
B for an explicit region with charge-response segments (Thole segments may be mixed in): the induced ...
static std::vector< double > SiteWidths(const std::vector< PolarSegment > &segments, double site_width)
R per site, in bohr: site_width * alpha_iso^(1/3), with alpha_iso = tr(alpha)/3; for a charge-respons...
static Eigen::MatrixXd AuxFieldAtPoints(const AOBasis &auxbasis, const std::vector< Eigen::Vector3d > &points, const std::vector< double > &widths={})
F: the electric field at each point produced by each auxiliary basis function, taken as a charge dens...
static Eigen::MatrixXd SymmetrizedReactionField(const Eigen::MatrixXd &B, const Eigen::MatrixXd &T)
R = T^T B T, the reaction field in the metric of the stored three-centre integrals,...
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26
Outcome of EnvironmentScreening::Check: whether 1 + R is positive definite, and a human-readable acco...
The polarizable environment a GW-BSE calculation is screened by: what a QM/MM job hands to GWBSE (GWB...
std::vector< PolarSegment > explicit_segments
std::vector< PolarSegment > shell_segments