Loading...
Searching...
No Matches
gpr::priors Namespace Reference

Prior distributions and prior-mean functions for the GP. More...

Classes

class  CovalentBondPrior
class  MorsePriorMean
struct  MorsePriorMeanEvaluation
struct  PopulationPairPrior
class  PopulationPrior
struct  PriorHessianPair
 Pair term of a prior Hessian: block acts on x_first - x_second. A negative second is a fixed partner, so the block acts on x_first alone. More...
struct  PriorPairFrame
class  ZBLPriorMean
struct  ZBLPriorMeanEvaluation

Functions

double cordero_radius_angstrom (int Z) noexcept
 Convert one Cordero entry to Angstrom (kernel length-scale unit).
double bond_length_angstrom (int Za, int Zb, double alpha=1.0) noexcept
template<typename Derived>
Eigen::MatrixXd applyPriorHessianPairs (const std::vector< PriorHessianPair > &pairs, const Eigen::MatrixBase< Derived > &directions)
 Apply physical prior curvature without forming a dense Hessian.
void addPriorHessianPairs (const std::vector< PriorHessianPair > &pairs, Eigen::MatrixXd &hessian)
 Add the same pair blocks to a dense Cartesian Hessian.

Variables

constexpr std::array< double, 97 > kCorderoRadiusPm

Detailed Description

Prior distributions and prior-mean functions for the GP.

Function Documentation

◆ addPriorHessianPairs()

void gpr::priors::addPriorHessianPairs ( const std::vector< PriorHessianPair > & pairs,
Eigen::MatrixXd & hessian )
inline

Add the same pair blocks to a dense Cartesian Hessian.

Definition at line 50 of file PriorMeanHessian.h.

52{
53 for (const auto& pair: pairs) {
54 hessian.block<3, 3>(pair.first, pair.first) += pair.block;
55 if (pair.second < 0) continue;
56 hessian.block<3, 3>(pair.first, pair.second) -= pair.block;
57 hessian.block<3, 3>(pair.second, pair.first) -= pair.block;
58 hessian.block<3, 3>(pair.second, pair.second) += pair.block;
59 }
60}

◆ applyPriorHessianPairs()

template<typename Derived>
Eigen::MatrixXd gpr::priors::applyPriorHessianPairs ( const std::vector< PriorHessianPair > & pairs,
const Eigen::MatrixBase< Derived > & directions )
inlinenodiscard

Apply physical prior curvature without forming a dense Hessian.

Definition at line 28 of file PriorMeanHessian.h.

31{
32 Eigen::MatrixXd result =
33 Eigen::MatrixXd::Zero(directions.rows(), directions.cols());
34 for (const auto& pair: pairs) {
35 if (pair.second < 0) {
36 result.middleRows(pair.first, 3) +=
37 pair.block * directions.middleRows(pair.first, 3);
38 continue;
39 }
40 const Eigen::MatrixXd value =
41 pair.block * (directions.middleRows(pair.first, 3) -
42 directions.middleRows(pair.second, 3));
43 result.middleRows(pair.first, 3) += value;
44 result.middleRows(pair.second, 3) -= value;
45 }
46 return result;
47}

◆ bond_length_angstrom()

double gpr::priors::bond_length_angstrom ( int Za,
int Zb,
double alpha = 1.0 )
inlinenodiscardnoexcept

Sum of Cordero radii for atoms of species (Za, Zb), scaled by alpha, in Angstrom. The product is the natural physical length scale of an SE kernel applied to atomic systems (Bartok 2010, Bertinetto 2018): the kernel decorrelates atom-pair distances on the order of the equilibrium bond length.

Definition at line 50 of file CovalentBondPrior.h.

52{
53 return alpha * (cordero_radius_angstrom(Za) + cordero_radius_angstrom(Zb));
54}
double cordero_radius_angstrom(int Z) noexcept
Convert one Cordero entry to Angstrom (kernel length-scale unit).

◆ cordero_radius_angstrom()

double gpr::priors::cordero_radius_angstrom ( int Z)
inlinenodiscardnoexcept

Convert one Cordero entry to Angstrom (kernel length-scale unit).

Definition at line 39 of file CovalentBondPrior.h.

40{
41 if (Z < 1 || Z >= static_cast<int>(kCorderoRadiusPm.size())) return 0.0;
42 return kCorderoRadiusPm[static_cast<std::size_t>(Z)] * 0.01;
43}
constexpr std::array< double, 97 > kCorderoRadiusPm

Variable Documentation

◆ kCorderoRadiusPm

std::array<double, 97> gpr::geometry::kCorderoRadiusPm
inlineconstexpr

Cordero 2008 covalent radii (single-bond), indexed by atomic number Z = 1..96. Units: picometres. Z = 0 sentinel reserved for the "unknown / dummy" entry the lookup uses when Z is out of range.

Definition at line 14 of file CorderoRadii.h.

14 {
15 /* 0 X */ 0.0,
16 /* 1 H */ 31.0,
17 /* 2 He */ 28.0,
18 /* 3 Li */ 128.0,
19 /* 4 Be */ 96.0,
20 /* 5 B */ 84.0,
21 /* 6 C */ 76.0,
22 /* 7 N */ 71.0,
23 /* 8 O */ 66.0,
24 /* 9 F */ 57.0,
25 /* 10 Ne */ 58.0,
26 /* 11 Na */ 166.0,
27 /* 12 Mg */ 141.0,
28 /* 13 Al */ 121.0,
29 /* 14 Si */ 111.0,
30 /* 15 P */ 107.0,
31 /* 16 S */ 105.0,
32 /* 17 Cl */ 102.0,
33 /* 18 Ar */ 106.0,
34 /* 19 K */ 203.0,
35 /* 20 Ca */ 176.0,
36 /* 21 Sc */ 170.0,
37 /* 22 Ti */ 160.0,
38 /* 23 V */ 153.0,
39 /* 24 Cr */ 139.0,
40 /* 25 Mn */ 139.0,
41 /* 26 Fe */ 132.0,
42 /* 27 Co */ 126.0,
43 /* 28 Ni */ 124.0,
44 /* 29 Cu */ 132.0,
45 /* 30 Zn */ 122.0,
46 /* 31 Ga */ 122.0,
47 /* 32 Ge */ 120.0,
48 /* 33 As */ 119.0,
49 /* 34 Se */ 120.0,
50 /* 35 Br */ 120.0,
51 /* 36 Kr */ 116.0,
52 /* 37 Rb */ 220.0,
53 /* 38 Sr */ 195.0,
54 /* 39 Y */ 190.0,
55 /* 40 Zr */ 175.0,
56 /* 41 Nb */ 164.0,
57 /* 42 Mo */ 154.0,
58 /* 43 Tc */ 147.0,
59 /* 44 Ru */ 146.0,
60 /* 45 Rh */ 142.0,
61 /* 46 Pd */ 139.0,
62 /* 47 Ag */ 145.0,
63 /* 48 Cd */ 144.0,
64 /* 49 In */ 142.0,
65 /* 50 Sn */ 139.0,
66 /* 51 Sb */ 139.0,
67 /* 52 Te */ 138.0,
68 /* 53 I */ 139.0,
69 /* 54 Xe */ 140.0,
70 /* 55 Cs */ 244.0,
71 /* 56 Ba */ 215.0,
72 /* 57 La */ 207.0,
73 /* 58 Ce */ 204.0,
74 /* 59 Pr */ 203.0,
75 /* 60 Nd */ 201.0,
76 /* 61 Pm */ 199.0,
77 /* 62 Sm */ 198.0,
78 /* 63 Eu */ 198.0,
79 /* 64 Gd */ 196.0,
80 /* 65 Tb */ 194.0,
81 /* 66 Dy */ 192.0,
82 /* 67 Ho */ 192.0,
83 /* 68 Er */ 189.0,
84 /* 69 Tm */ 190.0,
85 /* 70 Yb */ 187.0,
86 /* 71 Lu */ 187.0,
87 /* 72 Hf */ 175.0,
88 /* 73 Ta */ 170.0,
89 /* 74 W */ 162.0,
90 /* 75 Re */ 151.0,
91 /* 76 Os */ 144.0,
92 /* 77 Ir */ 141.0,
93 /* 78 Pt */ 136.0,
94 /* 79 Au */ 136.0,
95 /* 80 Hg */ 132.0,
96 /* 81 Tl */ 145.0,
97 /* 82 Pb */ 146.0,
98 /* 83 Bi */ 148.0,
99 /* 84 Po */ 140.0,
100 /* 85 At */ 150.0,
101 /* 86 Rn */ 150.0,
102 /* 87 Fr */ 260.0,
103 /* 88 Ra */ 221.0,
104 /* 89 Ac */ 215.0,
105 /* 90 Th */ 206.0,
106 /* 91 Pa */ 200.0,
107 /* 92 U */ 196.0,
108 /* 93 Np */ 190.0,
109 /* 94 Pu */ 187.0,
110 /* 95 Am */ 180.0,
111 /* 96 Cm */ 169.0,
112};