39inline constexpr double kHbar = 0.06465415129579072;
43inline constexpr double kBoltzmann = 8.617333262145177e-5;
58 Profile(std::vector<double>
s, std::vector<double>
v);
60 const std::vector<double> &
s()
const {
return s_; }
61 const std::vector<double> &
v()
const {
return v_; }
109 double referenceEnergy);
114 double referenceEnergy);
143Levels dvrLevels(
const std::function<
double(
double)> &v,
double sReactant,
144 double sProduct,
double sTop,
double hwReactant,
170 double referenceEnergy,
long points);
191std::vector<VectorXd>
ringFromPath(
const std::vector<VectorXd> &path,
192 const std::vector<double> &energies,
193 double betaHbar,
long beads,
239 std::function<void(
const std::vector<VectorXd> &q, std::vector<double> &v,
240 std::vector<VectorXd> &grad)>;
244 const std::vector<VectorXd> &q, std::vector<double> &v,
245 std::vector<VectorXd> &grad,
const std::vector<long> &owners)>;
273 const VectorXd &start,
const VectorXd &end);
279 double betaHbar, std::vector<VectorXd> guess,
311 double value(
const VectorXd &q)
const;
312 VectorXd
gradient(
const VectorXd &q)
const;
317 double xi(
const VectorXd &q)
const;
367 const MatrixXd &hessSaddle,
double beta,
368 double barrier,
long rigidModes);
381 const MatrixXd &hessSaddle,
double beta,
382 double barrier,
long rigidModes);
430 std::int64_t
newtonLimit = std::numeric_limits<std::int64_t>::max();
463 std::vector<VectorXd> &grad,
464 const std::vector<double> &eta);
471 const std::vector<double> &discretization = {});
491 const std::vector<VectorXd> &tau);
558 const MatrixXd &hessSaddle,
double beta,
559 std::vector<VectorXd> guess,
585 const VectorXd &saddle,
const VectorXd &mode);
599 std::array<bool, 3>
zero{{
false,
false,
false}};
613 long allowedNegatives);
672 const MatrixXd &hessReactant,
double vReactant,
674 double vSaddle = 0.0,
long rigidModes = 0,
675 long denseLimit = 4096,
688 const std::vector<MatrixXd> &diag,
689 const std::vector<VectorXd> &rhs);
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, eOnStorageOrder > MatrixXd
VectorXd gradient(const VectorXd &q) const
MatrixXd hessian(const VectorXd &q) const
EnergyBias(const VectorXd &start, const VectorXd &end, double delta)
double value(const VectorXd &q) const
double xi(const VectorXd &q) const
Energy along the path, interpolated as a monotone cubic (Fritsch and Carlson), flat at both ends beca...
Profile(std::vector< double > s, std::vector< double > v)
const std::vector< double > & v() const
double operator()(double x) const
const std::vector< double > & s() const
std::function< MatrixXd(long j, const VectorXd &q)> BeadHessian
The mass-weighted Hessian d2V/dq2 at interior bead j (1..P-1).
RingSpectrum ringSpectrum(const std::vector< MatrixXd > &beadHessians, double c, const std::vector< VectorXd > &tau)
The ring Hessian of bead Hessians beadHessians (d2V/dq2 at each of the N beads) and spring constant c...
constexpr double kDvrPadLengths
Oscillator lengths the grid reaches past each minimum.
double zeroPointDifference(const MatrixXd &hessStart, const MatrixXd &hessEnd, long rigidModes)
Harmonic zero-point energy of the end minimum minus that of the start, in eV: (hbar / 2) times the di...
constexpr long kDvrMaxPoints
Largest grid; a longer path takes a coarser spacing.
double cyclicRingLogAbsDet(double c, const std::vector< MatrixXd > &diag)
log|det| of the cyclic block-tridiagonal ring Hessian.
Splitting bandSplitting(const std::vector< std::shared_ptr< Matter > > &band, double referenceEnergy)
The splitting of a converged band, with the well frequencies from the band's curvature at each end.
void bofillKeepingInertia(MatrixXd &h, const VectorXd &dq, const VectorXd &dg, long allowedNegatives)
The Bofill update of a bead block (Powell symmetric Broyden and SR1 mixed by the angle between the se...
std::vector< VectorXd > cyclicRingSolve(double c, const std::vector< MatrixXd > &diag, const std::vector< VectorXd > &rhs)
Solves that same cyclic ring Hessian.
double closedRingPotential(const std::vector< VectorXd > &beads, double spring, const BatchPotential &potential, const std::vector< double > &discretization)
U_N of a closed ring.
constexpr long kDvrPointsPerLength
Grid points per oscillator length hbar / sqrt(hbar omega) of the stiffer well.
void instantonRate(RateInstanton &inst, const RingBeadHessian &hessian, const MatrixXd &hessReactant, double vReactant, const MatrixXd &hessSaddle, double vSaddle, long rigidModes, long denseLimit, const RingRigidBodies &rigidBodies)
Fills the rate from the bead Hessians, the reactant minimum's Hessian and energy, and optionally the ...
BandWalls bandWalls(const std::vector< std::shared_ptr< Matter > > &band, double referenceEnergy, long points)
The walls of both ends of a band, after Khomenko et al.
double wkbAction(const Profile &p, double energy, int points)
(1/hbar) integral sqrt(2 (V(s) - E)) ds over the path where V > E.
double parabolicFactor(double temperature, double crossover)
(pi T_c / T) / sin(pi T_c / T).
void instantonSplitting(Instanton &inst, const BeadHessian &hessian, const MatrixXd &hessStart, const MatrixXd &hessEnd)
Fills delta0, zeroMode and modeSeparation from the bead Hessians and the Hessians of the two minima.
constexpr double kTimeUnitSeconds
One unit of time, sqrt(amu Angstrom^2 / eV), in seconds.
double pathOmega(const MatrixXd &hessStart, const MatrixXd &hessEnd, const VectorXd &start, const VectorXd &end)
omega along the straight line between the minima from the curvature of each well there,...
std::function< MatrixXd(long j, const VectorXd &q)> RingBeadHessian
The mass-weighted Hessian d2V/dq2 at ring bead j (0..N-1).
constexpr double kRotationZeroFraction
Which rotations of a structure are zero modes of its mass-weighted Hessian.
double logRotationalRatio(const std::vector< VectorXd > &beads, const RingRigidBodies &bodies)
ln of the classical rotational partition function of beads over that of as many copies of the referen...
bool singleBarrier(const Profile &p)
Whether a profile is one double well: its images rise to exactly one maximum between the two ends.
RateInstanton optimizeRateInstanton(const VectorXd &saddle, const MatrixXd &hessSaddle, double beta, std::vector< VectorXd > guess, const BatchPotential &potential, const RateInstantonOptions &request)
Finds the rate instanton at inverse temperature beta (1 / eV).
RingChannel ringChannel(const std::vector< VectorXd > &beads, const VectorXd &saddle, const VectorXd &mode)
The channel test above for a ring of beads, a saddle and its unstable mode (normalised inside).
void addFrictionBath(const std::vector< VectorXd > &q, double &u, std::vector< VectorXd > &grad, const std::vector< double > &eta)
Position-independent (one eta) or bead-wise friction on a closed ring.
constexpr double kHbar
hbar in eV^0.5 amu^0.5 Angstrom, correctly rounded from the exact SI values (h = 6....
Splitting wkbSplitting(const Profile &p, double hwReactant, double hwProduct)
delta0 = (hbar omega / pi) exp(-S) with the Landau and Lifshitz prefactor.
double harmonicTstLogRate(const MatrixXd &hessReactant, const MatrixXd &hessSaddle, double beta, double barrier, long rigidModes)
ln(k) for classical harmonic transition-state theory, k in 1/time.
double wellCurvature(const Profile &p, bool leftEnd)
d2V/ds2 at one end of the path, in eV / (amu Angstrom^2), from a least squares fit of a s^2 + b s^3 t...
double massWeightedDistance(const Matter &a, const Matter &b)
sqrt(sum_i m_i |b_i - a_i|^2) under the minimum image of a's cell.
std::function< void(const std::vector< VectorXd > &q, std::vector< double > &v, std::vector< VectorXd > &grad)> BatchPotential
V (eV) and dV/dq (eV / (amu^0.5 Angstrom)) at every point of q, all in one call so a potential can sp...
double quantumHarmonicTstLogRate(const MatrixXd &hessReactant, const MatrixXd &hessSaddle, double beta, double barrier, long rigidModes)
ln(k) for quantum harmonic transition-state theory, k in 1/time: (1 / (2 pi beta hbar)) prod_r 2 sinh...
double crossoverTemperature(const MatrixXd &hessSaddle)
T_c = hbar omega_b / (2 pi kB) from the mass-weighted Hessian at the saddle, in K; throws when the He...
std::vector< VectorXd > ringFromPath(const std::vector< VectorXd > &path, const std::vector< double > &energies, double betaHbar, long beads, RingSeed *seed)
Levels dvrLevels(const std::function< double(double)> &v, double sReactant, double sProduct, double sTop, double hwReactant, double hwProduct)
The levels of -hbar^2/2 d2/ds2 + V(s) at unit mass on a mass-weighted path coordinate s,...
double wkbLogRateAlongPath(const Profile &profile, double beta, double hwReactant)
ln(k), k in 1/time, for the one-dimensional thermal rate along profile.
Levels bandLevels(const Profile &p, const BandWalls *walls)
dvrLevels on a band: the profile between the images, and past each end the well's fit a s^2 + b s^3 c...
std::array< double, 2 > wellFit(const Profile &p, bool leftEnd)
{a, b} of that fit, s measured inward from the end: wellCurvature is 2 a.
Profile bandProfile(const std::vector< std::shared_ptr< Matter > > &band, double referenceEnergy)
The energy of a band against its mass-weighted arc length, measured from referenceEnergy.
std::function< void( const std::vector< VectorXd > &q, std::vector< double > &v, std::vector< VectorXd > &grad, const std::vector< long > &owners)> OwnedBatchPotential
Explicit electronic-state owners for each evaluated geometry.
double hbarOmega(double curvature)
hbar omega in eV for a mass-weighted curvature.
RotationZeroModes rotationZeroModes(const MatrixXd &hess, const MatrixXd &generators, double fraction)
std::vector< double > massWeightedPath(const std::vector< std::shared_ptr< Matter > > &band)
Cumulative mass-weighted arc length at each image of a band.
Instanton optimizeInstanton(const VectorXd &start, const VectorXd &end, double betaHbar, std::vector< VectorXd > guess, const BatchPotential &potential, const InstantonOptions &options)
Minimises the action from guess (P + 1 beads, ends at the minima, or empty for a tanh kink along the ...
constexpr double kBoltzmann
Boltzmann constant in eV / K, correctly rounded from the exact 1.380649e-23 J / K.
One well's outer wall: increasing mass-weighted distances outward from the minimum along the reaction...
std::vector< double > distance
std::vector< double > energy
long maxIterations
L-BFGS iterations.
double forceTolerance
largest per-bead |dS/dq| / dtau, eV / (amu^0.5 Angstrom)
long beads
P: segments from one minimum to the other.
long memory
L-BFGS correction pairs.
double betaHbarOmega
beta hbar omega of the stiffer end along the path; sets the imaginary time
double asymmetry
V(end) - V(start), eV.
std::vector< double > energies
V at every bead, eV.
double zeroMode
the eigenvalue det' leaves out
double action
(S - S_well) / hbar
double s0
integral of |dq/dtau|^2 dtau
bool symmetricEnough
beta |asymmetry| < 0.1: the propagator ratio reads delta0 only when the wells lie within a small frac...
double modeSeparation
The second smallest eigenvalue of J over the zero mode's: small means the kink is not isolated in ima...
double betaHbar
imaginary time the path spans
double delta0
tunnelling splitting, eV
std::vector< VectorXd > path
P + 1 beads, ends at the minima.
The two lowest levels of a one-dimensional double well, in eV.
std::vector< double > frictionEtaBeads
OwnedBatchPotential ownedPotential
Stable bead identities and bounded derivative scratch slots.
long memory
L-BFGS correction pairs.
std::shared_ptr< const PhysicalQuadraticBath > physicalBath
Fixed physical quadratic bath, eliminated on the same primitive ring.
double collapseFraction
The search stops, with RateInstanton::collapsed set, when B_N falls below this fraction of the starti...
std::vector< double > rigidSqrtMasses
Rigid motions of the ring: a translation, or one rotation about the ring's centre of mass,...
std::array< bool, 3 > rigidRotations
double maxStep
largest bead move per step, amu^0.5 Angstrom
double energyShift
subtracted from every bead potential, eV
std::int64_t newtonLimit
Active coordinates at or below this take the Newton step.
long beads
N, beads on the ring.
long lanczosRestart
Lanczos steps from the previous mode.
double forceTolerance
largest per-bead |dU_N/dq|, eV / (amu^0.5 Angstrom)
bool halfRing
Even N, when the guess already matches under j -> N - j: evaluate the potential from one turning poin...
std::function< MatrixXd(const VectorXd &)> physicalHessian
Exact physical potential Hessian at a retained bead, excluding springs and the eliminated bath.
double lanczosStep
finite-difference step, amu^0.5 Angstrom
std::string initialHessians
Where the bead Hessian blocks start: "saddle" copies the saddle's Hessian to every bead and lets the ...
bool friction
Litman friction bath on the rate ring.
long lanczosFirst
Lanczos steps for the first minimum mode.
std::vector< double > discretization
Empty keeps every spring equal.
bool checkOddSector
A half ring that has converged, or that is stationary at the wrong index, is probed for an unstable m...
long maxIterations
translation steps
double physicalHessianStep
Central physical bead-Hessian displacement in sqrt(amu) Angstrom.
double logAbsoluteGaussianWeight
Absolute labelled-saddle Gaussian weight, without contour/rate factors.
double phaseEigenResidual
long negativeModes
eigenvalues below the zero mode
double ringPotential
U_N, eV.
std::vector< double > bathSignedCurvatures
Exact finite bath fluctuation diagnostics after declared rigid projection.
bool collapsed
The search stopped because B_N fell below collapseFraction of the starting ring's: the beads fell tog...
double bathSymmetryResidual
double zeroEigenvalue
the eigenvalue left out
bool rateValid
A physical rate requires a converged index-one stationary ring.
double beta
1 / (kB T), 1 / eV
std::shared_ptr< const PhysicalQuadraticBath > physicalBath
std::vector< double > energies
V at every bead, eV.
std::vector< double > discretization
Empty keeps every spring equal. Otherwise one positive weight per bead.
double bN
sum_j |q_{j+1} - q_j|^2, amu Angstrom^2
std::vector< double > bathEta
Resolved fixed bath coefficients: empty, one value or one per bead.
double logRotationRatio
ln of the ring's rotational partition function over the reactant's, included in logRateTimesZr; zero ...
double logRate
ln k, k in 1 / time
std::vector< VectorXd > beads
N beads, q_N = q_0 implied.
double classicalRate
Classical harmonic transition-state theory at the same T, 1 / s, when the saddle Hessian was given; i...
double logRateTimesZr
ln(k Z_r), k in 1 / time
double bathReactantLogAbsDet
double negativeEigenvalue
of the ring Hessian, 1 / time^2
double effectiveBarrier
-kB T ln(2 pi hbar beta k): the barrier an Eyring rate would need, eV.
Where a ring sits against the saddle it was seeded from, in mass-weighted coordinates.
bool belongs
Beads on both sides of the dividing plane, the chord within 60 degrees of the mode,...
double sMin
least s over the beads, amu^0.5 Angstrom
double chordOverlap
|cos| of the angle between the chord joining the turning points and the unstable mode.
double crossingOffset
Largest distance from the saddle, across the mode, of a point where the ring crosses the dividing pla...
double sMax
greatest s over the beads
The atoms behind a ring's mass-weighted coordinates, for its rigid motions: sqrt(m) per atom,...
std::array< bool, 3 > rotations
std::vector< double > sqrtMasses
Closed ring of beads samples of path whose imaginary-time period is betaHbar.
double pathLow
the higher of the path's two end energies
Spectrum of a closed ring's Hessian without forming it.
double zeroEigenvalue
tau .
double logDetPrime
ln |det' J|: the product over every eigenvalue but the one along tau.
long negativeModes
Eigenvalues below zero, the one along tau left out.
std::array< bool, 3 > zero
double softestVibration
lowest eigenvalue on the complement
std::array< double, 3 > residual
bool deepWells
Both barriers stand above hbar omega; below that WKB is not the right tool and the number is reported...
double hwReactant
hbar omega of the reactant well, eV
double delta0
tunnelling splitting, eV
double barrier
path maximum above the reactant, eV
double asymmetry() const
The diagonal term of the two-level Hamiltonian, the difference of the two local ground states: delta ...
double referenceEnergy
the level tunnelling happens at, eV
double action
the WKB exponent, dimensionless
double tlsEnergy() const
sqrt(asymmetry()^2 + delta0^2), eV
double hwProduct
hbar omega of the product well, eV
double delta
product minus reactant, eV