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 = {});
148 // widths (bohr, one per point, or empty for all zero): a point with
149 // width R > 0 is a unit-charge Gaussian exp(-r^2/R^2)/(pi^(3/2) R^3)
150 // rather than a point, and F is minus the gradient of the Coulomb
151 // interaction (chi_Q | g_R) with respect to its centre -- a libint2
152 // two-centre Coulomb integral, same stencil. Outside the extent of the
153 // auxiliary functions a spherical charge acts as a point (Newton), so
154 // this changes F only where a site sits inside their tails -- which is
155 // exactly where point sites over-respond (see Check). R = 0 is the
156 // nuclear-attraction path above, unchanged.
157
176 static std::vector<double> SiteWidths(
177 const std::vector<PolarSegment>& segments, double site_width);
178
200 static Eigen::MatrixXd ReactionFieldKernel(
201 const Eigen::MatrixXd& F, const std::vector<PolarSegment>& segments,
202 double exp_damp);
203
222 static Eigen::MatrixXd ShellKernel(const Eigen::MatrixXd& F,
223 const std::vector<PolarSegment>& segments,
224 double epsilon);
225
236 static Eigen::MatrixXd SymmetrizedReactionField(const Eigen::MatrixXd& B,
237 const Eigen::MatrixXd& T);
238
246 static Eigen::MatrixXd DressingMatrix(const Eigen::MatrixXd& R);
247
253 static Eigen::MatrixXd Kernel(const AOBasis& auxbasis,
254 const ScreeningEnvironment& env);
255
262 static Eigen::MatrixXd Metric(const AOBasis& auxbasis);
263
283 static ScreeningCheck Check(const AOBasis& auxbasis, const QMMolecule& atoms,
284 const ScreeningEnvironment& env,
285 const Eigen::MatrixXd& T, Index n_modes = 3);
286};
287
288} // namespace xtp
289} // namespace votca
290
291#endif // VOTCA_XTP_ENVIRONMENTSCREENING_H
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
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 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 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.
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