Loading...
Searching...
No Matches
eonc::tunneling::QuadraticBath Class Reference

Exact Gaussian elimination of a stable physical mass-weighted harmonic bath. More...

#include <QuadraticBath.h>

Public Member Functions

 QuadraticBath (const Eigen::MatrixXd &hessian, const Eigen::MatrixXd &reactionBasis)
const Eigen::MatrixXd & reactionBasis () const
const Eigen::MatrixXd & bathBasis () const
const Eigen::MatrixXd & reactionCurvature () const
const Eigen::MatrixXd & coupling () const
const Eigen::VectorXd & bathCurvatures () const
Eigen::MatrixXd kernel (double nu) const
 Schur complement of H+nu^2 I, including reaction kinetic curvature.
Eigen::MatrixXd memory (double s) const
 Laplace transform of the physical harmonic memory kernel for s >= 0.
double logBathDeterminant (double nu) const
double logBathPartition (double betaHbar) const
 Normalized quantum partition of the uncoupled conditional harmonic bath.

Static Private Member Functions

static double squaredFrequency (double nu)

Private Attributes

Eigen::MatrixXd reaction_
Eigen::MatrixXd bath_
Eigen::MatrixXd a_
Eigen::MatrixXd c_
Eigen::VectorXd frequenciesSquared_

Detailed Description

Exact Gaussian elimination of a stable physical mass-weighted harmonic bath.

All nonpositive complementary curvatures are promoted to reaction coordinates. The measured Hessian defines a local quadratic model; this class does not assert that an anharmonic potential has a globally quadratic bath.

Definition at line 22 of file QuadraticBath.h.

Constructor & Destructor Documentation

◆ QuadraticBath()

eonc::tunneling::QuadraticBath::QuadraticBath ( const Eigen::MatrixXd & hessian,
const Eigen::MatrixXd & reactionBasis )
inline

Definition at line 24 of file QuadraticBath.h.

25 {
26 const Eigen::Index n = hessian.rows();
27 if (n < 1 || hessian.cols() != n || !hessian.allFinite() ||
28 !hessian.isApprox(hessian.transpose(),
29 32 * std::numeric_limits<double>::epsilon()) ||
30 reactionBasis.rows() != n || reactionBasis.cols() < 1 ||
31 reactionBasis.cols() > n || !reactionBasis.allFinite() ||
32 !(reactionBasis.transpose() * reactionBasis)
33 .isApprox(Eigen::MatrixXd::Identity(reactionBasis.cols(),
34 reactionBasis.cols()),
35 1e-12)) {
36 throw std::invalid_argument("quadratic bath requires symmetric finite H "
37 "and orthonormal reaction basis");
38 }
39 const Eigen::MatrixXd h = 0.5 * hessian + 0.5 * hessian.transpose();
40 Eigen::MatrixXd retained = reactionBasis;
41 for (;;) {
42 Eigen::HouseholderQR<Eigen::MatrixXd> qr(retained);
43 const Eigen::MatrixXd orthogonal =
44 qr.householderQ() * Eigen::MatrixXd::Identity(n, n);
45 reaction_ = orthogonal.leftCols(retained.cols());
46 bath_ = orthogonal.rightCols(n - retained.cols());
47 if (bath_.cols() == 0) {
48 frequenciesSquared_.resize(0);
49 break;
50 }
51 const Eigen::MatrixXd e = bath_.transpose() * h * bath_;
52 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> eig(e);
53 if (eig.info() != Eigen::Success || !eig.eigenvalues().allFinite()) {
54 throw std::runtime_error("quadratic bath eigensolver failed");
55 }
56 Eigen::Index promote = 0;
57 while (promote < eig.eigenvalues().size() &&
58 eig.eigenvalues()[promote] <= 0.0)
59 ++promote;
60 if (promote == 0) {
61 bath_ = bath_ * eig.eigenvectors();
62 frequenciesSquared_ = eig.eigenvalues();
63 break;
64 }
65 retained.resize(n, reaction_.cols() + promote);
66 retained.leftCols(reaction_.cols()) = reaction_;
67 retained.rightCols(promote) =
68 bath_ * eig.eigenvectors().leftCols(promote);
69 }
70 a_ = reaction_.transpose() * h * reaction_;
71 c_ = reaction_.transpose() * h * bath_;
72 }
const Eigen::MatrixXd & reactionBasis() const

Member Function Documentation

◆ bathBasis()

const Eigen::MatrixXd & eonc::tunneling::QuadraticBath::bathBasis ( ) const
inline

Definition at line 75 of file QuadraticBath.h.

75{ return bath_; }

◆ bathCurvatures()

const Eigen::VectorXd & eonc::tunneling::QuadraticBath::bathCurvatures ( ) const
inline

Definition at line 78 of file QuadraticBath.h.

78{ return frequenciesSquared_; }

◆ coupling()

const Eigen::MatrixXd & eonc::tunneling::QuadraticBath::coupling ( ) const
inline

Definition at line 77 of file QuadraticBath.h.

77{ return c_; }

◆ kernel()

Eigen::MatrixXd eonc::tunneling::QuadraticBath::kernel ( double nu) const
inline

Schur complement of H+nu^2 I, including reaction kinetic curvature.

Definition at line 81 of file QuadraticBath.h.

81 {
82 const double nu2 = squaredFrequency(nu);
83 Eigen::MatrixXd result = a_;
84 result.diagonal().array() += nu2;
85 for (Eigen::Index k = 0; k < frequenciesSquared_.size(); ++k)
86 result.noalias() -=
87 c_.col(k) * c_.col(k).transpose() / (frequenciesSquared_[k] + nu2);
88 return result;
89 }
static double squaredFrequency(double nu)

◆ logBathDeterminant()

double eonc::tunneling::QuadraticBath::logBathDeterminant ( double nu) const
inline

Definition at line 105 of file QuadraticBath.h.

105 {
106 const double nu2 = squaredFrequency(nu);
107 return (frequenciesSquared_.array() + nu2).log().sum();
108 }

◆ logBathPartition()

double eonc::tunneling::QuadraticBath::logBathPartition ( double betaHbar) const
inline

Normalized quantum partition of the uncoupled conditional harmonic bath.

Ratios cancel only for identical conditional baths and normalization.

Definition at line 112 of file QuadraticBath.h.

112 {
113 if (!(betaHbar > 0) || !std::isfinite(betaHbar))
114 throw std::invalid_argument("beta*hbar must be positive and finite");
115 double value = 0;
116 for (Eigen::Index k = 0; k < frequenciesSquared_.size(); ++k) {
117 const double z = betaHbar * std::sqrt(frequenciesSquared_[k]);
118 if (!(z > 0) || !std::isfinite(z))
119 throw std::invalid_argument(
120 "thermal bath frequency overflows or underflows");
121 value -= z / 2 + std::log(-std::expm1(-z));
122 }
123 return value;
124 }

◆ memory()

Eigen::MatrixXd eonc::tunneling::QuadraticBath::memory ( double s) const
inline

Laplace transform of the physical harmonic memory kernel for s >= 0.

Definition at line 92 of file QuadraticBath.h.

92 {
93 const double s2 = squaredFrequency(s);
94 if (s < 0)
95 throw std::invalid_argument("Laplace frequency must be nonnegative");
96 Eigen::MatrixXd result = Eigen::MatrixXd::Zero(a_.rows(), a_.cols());
97 for (Eigen::Index k = 0; k < frequenciesSquared_.size(); ++k) {
98 const double e = frequenciesSquared_[k];
99 result.noalias() +=
100 (s / e / (e + s2)) * c_.col(k) * c_.col(k).transpose();
101 }
102 return result;
103 }

◆ reactionBasis()

const Eigen::MatrixXd & eonc::tunneling::QuadraticBath::reactionBasis ( ) const
inline

Definition at line 74 of file QuadraticBath.h.

74{ return reaction_; }

◆ reactionCurvature()

const Eigen::MatrixXd & eonc::tunneling::QuadraticBath::reactionCurvature ( ) const
inline

Definition at line 76 of file QuadraticBath.h.

76{ return a_; }

◆ squaredFrequency()

double eonc::tunneling::QuadraticBath::squaredFrequency ( double nu)
inlinestaticprivate

Definition at line 127 of file QuadraticBath.h.

127 {
128 if (!std::isfinite(nu) || !std::isfinite(nu * nu))
129 throw std::invalid_argument("frequency must have a finite square");
130 return nu * nu;
131 }

Member Data Documentation

◆ a_

Eigen::MatrixXd eonc::tunneling::QuadraticBath::a_
private

Definition at line 132 of file QuadraticBath.h.

◆ bath_

Eigen::MatrixXd eonc::tunneling::QuadraticBath::bath_
private

Definition at line 132 of file QuadraticBath.h.

◆ c_

Eigen::MatrixXd eonc::tunneling::QuadraticBath::c_
private

Definition at line 132 of file QuadraticBath.h.

◆ frequenciesSquared_

Eigen::VectorXd eonc::tunneling::QuadraticBath::frequenciesSquared_
private

Definition at line 133 of file QuadraticBath.h.

◆ reaction_

Eigen::MatrixXd eonc::tunneling::QuadraticBath::reaction_
private

Definition at line 132 of file QuadraticBath.h.


The documentation for this class was generated from the following file: