react-cheminfo 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -6
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/ecosystem/core/sites.d.ts +1 -1
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +18 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts +16 -0
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -0
- package/lib/ecosystem/ui/glyphs.js +41 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -0
- package/lib/ecosystem/ui/marks.d.ts.map +1 -1
- package/lib/ecosystem/ui/marks.js +2 -33
- package/lib/ecosystem/ui/marks.js.map +1 -1
- package/lib/orbital/core/atomicGrid.d.ts +58 -0
- package/lib/orbital/core/atomicGrid.d.ts.map +1 -0
- package/lib/orbital/core/atomicGrid.js +69 -0
- package/lib/orbital/core/atomicGrid.js.map +1 -0
- package/lib/orbital/core/atomicOrbitals.d.ts +97 -0
- package/lib/orbital/core/atomicOrbitals.d.ts.map +1 -0
- package/lib/orbital/core/atomicOrbitals.js +135 -0
- package/lib/orbital/core/atomicOrbitals.js.map +1 -0
- package/lib/orbital/core/constants.d.ts +33 -0
- package/lib/orbital/core/constants.d.ts.map +1 -0
- package/lib/orbital/core/constants.js +21 -0
- package/lib/orbital/core/constants.js.map +1 -0
- package/lib/orbital/core/electronConfiguration.d.ts +106 -0
- package/lib/orbital/core/electronConfiguration.d.ts.map +1 -0
- package/lib/orbital/core/electronConfiguration.js +207 -0
- package/lib/orbital/core/electronConfiguration.js.map +1 -0
- package/lib/orbital/core/grid.d.ts +60 -0
- package/lib/orbital/core/grid.d.ts.map +1 -0
- package/lib/orbital/core/grid.js +81 -0
- package/lib/orbital/core/grid.js.map +1 -0
- package/lib/orbital/core/hydrogenic.d.ts +99 -0
- package/lib/orbital/core/hydrogenic.d.ts.map +1 -0
- package/lib/orbital/core/hydrogenic.js +181 -0
- package/lib/orbital/core/hydrogenic.js.map +1 -0
- package/lib/orbital/core/index.d.ts +22 -0
- package/lib/orbital/core/index.d.ts.map +1 -0
- package/lib/orbital/core/index.js +12 -0
- package/lib/orbital/core/index.js.map +1 -0
- package/lib/orbital/core/numerics.d.ts +39 -0
- package/lib/orbital/core/numerics.d.ts.map +1 -0
- package/lib/orbital/core/numerics.js +75 -0
- package/lib/orbital/core/numerics.js.map +1 -0
- package/lib/orbital/core/occupancy.d.ts +44 -0
- package/lib/orbital/core/occupancy.d.ts.map +1 -0
- package/lib/orbital/core/occupancy.js +85 -0
- package/lib/orbital/core/occupancy.js.map +1 -0
- package/lib/orbital/core/palette.d.ts +36 -0
- package/lib/orbital/core/palette.d.ts.map +1 -0
- package/lib/orbital/core/palette.js +37 -0
- package/lib/orbital/core/palette.js.map +1 -0
- package/lib/orbital/core/realHarmonics.d.ts +57 -0
- package/lib/orbital/core/realHarmonics.d.ts.map +1 -0
- package/lib/orbital/core/realHarmonics.js +144 -0
- package/lib/orbital/core/realHarmonics.js.map +1 -0
- package/lib/orbital/core/sample.d.ts +52 -0
- package/lib/orbital/core/sample.d.ts.map +1 -0
- package/lib/orbital/core/sample.js +54 -0
- package/lib/orbital/core/sample.js.map +1 -0
- package/lib/orbital/core/screening.d.ts +46 -0
- package/lib/orbital/core/screening.d.ts.map +1 -0
- package/lib/orbital/core/screening.js +72 -0
- package/lib/orbital/core/screening.js.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts +57 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.js +105 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts +73 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.js +49 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -0
- package/lib/orbital/ui/camera.d.ts +36 -0
- package/lib/orbital/ui/camera.d.ts.map +1 -0
- package/lib/orbital/ui/camera.js +98 -0
- package/lib/orbital/ui/camera.js.map +1 -0
- package/lib/orbital/ui/capability.d.ts +28 -0
- package/lib/orbital/ui/capability.d.ts.map +1 -0
- package/lib/orbital/ui/capability.js +77 -0
- package/lib/orbital/ui/capability.js.map +1 -0
- package/lib/orbital/ui/index.d.ts +17 -0
- package/lib/orbital/ui/index.d.ts.map +1 -0
- package/lib/orbital/ui/index.js +13 -0
- package/lib/orbital/ui/index.js.map +1 -0
- package/lib/orbital/ui/renderVolume.d.ts +57 -0
- package/lib/orbital/ui/renderVolume.d.ts.map +1 -0
- package/lib/orbital/ui/renderVolume.js +120 -0
- package/lib/orbital/ui/renderVolume.js.map +1 -0
- package/lib/orbital/ui/viewer.d.ts +86 -0
- package/lib/orbital/ui/viewer.d.ts.map +1 -0
- package/lib/orbital/ui/viewer.js +155 -0
- package/lib/orbital/ui/viewer.js.map +1 -0
- package/lib/orbital/ui/volumeField.d.ts +49 -0
- package/lib/orbital/ui/volumeField.d.ts.map +1 -0
- package/lib/orbital/ui/volumeField.js +108 -0
- package/lib/orbital/ui/volumeField.js.map +1 -0
- package/lib/orbital.d.ts +11 -0
- package/lib/orbital.d.ts.map +1 -0
- package/lib/orbital.js +11 -0
- package/lib/orbital.js.map +1 -0
- package/package.json +11 -3
- package/src/core.ts +1 -0
- package/src/ecosystem/core/sites.ts +21 -1
- package/src/ecosystem/ui/glyphs.tsx +246 -0
- package/src/ecosystem/ui/marks.tsx +4 -201
- package/src/orbital/core/atomicGrid.ts +115 -0
- package/src/orbital/core/atomicOrbitals.ts +212 -0
- package/src/orbital/core/constants.ts +36 -0
- package/src/orbital/core/electronConfiguration.ts +242 -0
- package/src/orbital/core/grid.ts +126 -0
- package/src/orbital/core/hydrogenic.ts +222 -0
- package/src/orbital/core/index.ts +72 -0
- package/src/orbital/core/numerics.ts +79 -0
- package/src/orbital/core/occupancy.ts +100 -0
- package/src/orbital/core/palette.ts +56 -0
- package/src/orbital/core/realHarmonics.ts +172 -0
- package/src/orbital/core/sample.ts +91 -0
- package/src/orbital/core/screening.ts +90 -0
- package/src/orbital/ui/AtomicOrbitalCanvas.tsx +181 -0
- package/src/orbital/ui/AtomicOrbitalViewer.tsx +150 -0
- package/src/orbital/ui/camera.ts +125 -0
- package/src/orbital/ui/capability.ts +102 -0
- package/src/orbital/ui/index.ts +17 -0
- package/src/orbital/ui/renderVolume.ts +190 -0
- package/src/orbital/ui/viewer.ts +186 -0
- package/src/orbital/ui/volumeField.ts +128 -0
- package/src/orbital.ts +11 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sampling a wavefunction onto a dense scalar field for the isosurface renderer.
|
|
3
|
+
*
|
|
4
|
+
* The memory order is a hard contract with molstar: `Tensor.Space([nx, ny, nz],
|
|
5
|
+
* [0, 1, 2])` reads `dataOffset = x·ny·nz + y·nz + z`, so **z varies fastest**.
|
|
6
|
+
* The loops below are written in exactly that order and
|
|
7
|
+
* {@link gridIndex} is the single place the arithmetic is spelled out.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Sample a wavefunction over a box.
|
|
11
|
+
* @param evaluate - the wavefunction, cartesian ångström in, amplitude out.
|
|
12
|
+
* @param box - the region to cover.
|
|
13
|
+
* @param resolution - samples along the longest edge; the spacing it implies is
|
|
14
|
+
* used on all three axes, so the voxels stay cubic.
|
|
15
|
+
* @returns the field, its layout and its single-pass statistics.
|
|
16
|
+
* @throws {Error} when `resolution` is below 2 or the box has no volume.
|
|
17
|
+
*/
|
|
18
|
+
export function evaluateGrid(evaluate, box, resolution) {
|
|
19
|
+
if (resolution < 2) {
|
|
20
|
+
throw new Error('a grid needs at least 2 samples per axis');
|
|
21
|
+
}
|
|
22
|
+
const { origin, size } = box;
|
|
23
|
+
const longestEdge = Math.max(size.x, size.y, size.z);
|
|
24
|
+
if (!(longestEdge > 0)) {
|
|
25
|
+
throw new Error('the sampling box must have a non-zero edge');
|
|
26
|
+
}
|
|
27
|
+
const spacing = longestEdge / (resolution - 1);
|
|
28
|
+
const countX = axisCount(size.x, spacing);
|
|
29
|
+
const countY = axisCount(size.y, spacing);
|
|
30
|
+
const countZ = axisCount(size.z, spacing);
|
|
31
|
+
const data = new Float32Array(countX * countY * countZ);
|
|
32
|
+
let min = Infinity;
|
|
33
|
+
let max = -Infinity;
|
|
34
|
+
let sum = 0;
|
|
35
|
+
let sumSquares = 0;
|
|
36
|
+
let index = 0;
|
|
37
|
+
for (let indexX = 0; indexX < countX; indexX++) {
|
|
38
|
+
const x = origin.x + indexX * spacing;
|
|
39
|
+
for (let indexY = 0; indexY < countY; indexY++) {
|
|
40
|
+
const y = origin.y + indexY * spacing;
|
|
41
|
+
for (let indexZ = 0; indexZ < countZ; indexZ++) {
|
|
42
|
+
const value = Math.fround(evaluate(x, y, origin.z + indexZ * spacing));
|
|
43
|
+
data[index++] = value;
|
|
44
|
+
if (value < min)
|
|
45
|
+
min = value;
|
|
46
|
+
if (value > max)
|
|
47
|
+
max = value;
|
|
48
|
+
sum += value;
|
|
49
|
+
sumSquares += value * value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const count = data.length;
|
|
54
|
+
const mean = sum / count;
|
|
55
|
+
const variance = sumSquares / count - mean * mean;
|
|
56
|
+
return {
|
|
57
|
+
data,
|
|
58
|
+
dimensions: [countX, countY, countZ],
|
|
59
|
+
origin: { x: origin.x, y: origin.y, z: origin.z },
|
|
60
|
+
spacing,
|
|
61
|
+
min,
|
|
62
|
+
max,
|
|
63
|
+
mean,
|
|
64
|
+
sigma: Math.sqrt(Math.max(variance, 0)),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Flat offset of a sample, the layout molstar expects.
|
|
69
|
+
* @param dimensions - `[nx, ny, nz]` of the grid.
|
|
70
|
+
* @param indexX - sample index along x.
|
|
71
|
+
* @param indexY - sample index along y.
|
|
72
|
+
* @param indexZ - sample index along z, the fastest-varying axis.
|
|
73
|
+
* @returns the index into {@link OrbitalGrid.data}.
|
|
74
|
+
*/
|
|
75
|
+
export function gridIndex(dimensions, indexX, indexY, indexZ) {
|
|
76
|
+
return (indexX * dimensions[1] + indexY) * dimensions[2] + indexZ;
|
|
77
|
+
}
|
|
78
|
+
function axisCount(edge, spacing) {
|
|
79
|
+
return Math.max(2, Math.round(edge / spacing) + 1);
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../src/orbital/core/grid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsCH;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAC1B,QAA0B,EAC1B,GAAY,EACZ,UAAkB;IAElB,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;IAC7B,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,OAAO,GAAG,WAAW,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,C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I,KAAK,GAAG,KAAK,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1B,MAAM,IAAI,GAAG,GAAG,GAAG,KAAK,CAAC;IACzB,MAAM,QAAQ,GAAG,UAAU,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;IAClD,OAAO;QACL,IAAI;QACJ,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QACpC,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE;QACjD,OAAO;QACP,GAAG;QACH,GAAG;QACH,IAAI;QACJ,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;KACxC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,UAAoC,EACpC,MAAc,EACd,MAAc,EACd,MAAc;IAEd,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AACpE,CAAC;AAED,SAAS,SAAS,CAAC,IAAY,EAAE,OAAe;IAC9C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hydrogen-like atomic orbitals: the exact one-electron solutions, scaled to an
|
|
3
|
+
* element by an effective nuclear charge.
|
|
4
|
+
*
|
|
5
|
+
* `R(r) = N (2Zr/na₀)^ℓ e^(−Zr/na₀) L^(2ℓ+1)_(n−ℓ−1)(2Zr/na₀)`
|
|
6
|
+
*
|
|
7
|
+
* The associated Laguerre polynomial is the whole point. The Slater orbital a
|
|
8
|
+
* hybridisation model uses is `r^(n−1) e^(−ζr)`, which is **nodeless**: it draws
|
|
9
|
+
* a 2s exactly like a 1s, only fatter. That is fine for a hybrid lobe, where
|
|
10
|
+
* only the outer contour is ever seen, and wrong for a picture whose subject is
|
|
11
|
+
* what an orbital looks like — `n − ℓ − 1` radial nodes and ℓ angular ones is
|
|
12
|
+
* the first thing a student is asked to count.
|
|
13
|
+
*
|
|
14
|
+
* Amplitudes are in Å^(-3/2) and distances in ångström, like everything else
|
|
15
|
+
* here, so `∫|ψ|² dV` over a grid measured in ångström is 1.
|
|
16
|
+
*/
|
|
17
|
+
/** Which hydrogen-like orbital, and how strongly it is bound. */
|
|
18
|
+
export interface HydrogenicParameters {
|
|
19
|
+
/** Principal quantum number, 1 and up. */
|
|
20
|
+
n: number;
|
|
21
|
+
/** Angular momentum quantum number, 0 to n − 1. */
|
|
22
|
+
l: number;
|
|
23
|
+
/** Effective nuclear charge, in units of the elementary charge. */
|
|
24
|
+
charge: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Radial nodes: spheres on which the wavefunction vanishes and changes sign.
|
|
28
|
+
* @param parameters - Which orbital.
|
|
29
|
+
* @returns `n − ℓ − 1`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function radialNodeCount(parameters: HydrogenicParameters): number;
|
|
32
|
+
/**
|
|
33
|
+
* Mean distance of the electron from the nucleus,
|
|
34
|
+
* `⟨r⟩ = a₀(3n² − ℓ(ℓ+1)) / 2Z`.
|
|
35
|
+
* @param parameters - Which orbital.
|
|
36
|
+
* @returns The expectation value in ångström.
|
|
37
|
+
*/
|
|
38
|
+
export declare function meanRadius(parameters: HydrogenicParameters): number;
|
|
39
|
+
/**
|
|
40
|
+
* Orbital energy in the hydrogen-like model, `E = −13.6 Z²/n²` eV.
|
|
41
|
+
* @param parameters - Which orbital.
|
|
42
|
+
* @returns The energy in electronvolts, always negative.
|
|
43
|
+
*/
|
|
44
|
+
export declare function orbitalEnergy(parameters: HydrogenicParameters): number;
|
|
45
|
+
/**
|
|
46
|
+
* Build the radial function `R(r)`, with every constant hoisted out so a grid
|
|
47
|
+
* sweep pays for the exponential and the polynomial only.
|
|
48
|
+
* @param parameters - Which orbital.
|
|
49
|
+
* @returns A function taking a distance in ångström and returning Å^(-3/2).
|
|
50
|
+
* @throws {Error} When the quantum numbers are not a real orbital, i.e. `n < 1` or
|
|
51
|
+
* `ℓ` outside `0 … n − 1`, or when the charge is not positive.
|
|
52
|
+
*/
|
|
53
|
+
export declare function createRadialFunction(parameters: HydrogenicParameters): (distance: number) => number;
|
|
54
|
+
/**
|
|
55
|
+
* Evaluate the radial function once.
|
|
56
|
+
* @param parameters - Which orbital.
|
|
57
|
+
* @param distance - Distance from the nucleus, ångström.
|
|
58
|
+
* @returns The radial amplitude, Å^(-3/2).
|
|
59
|
+
*/
|
|
60
|
+
export declare function radialAmplitude(parameters: HydrogenicParameters, distance: number): number;
|
|
61
|
+
/**
|
|
62
|
+
* Where the radial nodes actually are.
|
|
63
|
+
*
|
|
64
|
+
* The `n − ℓ − 1` roots are bracketed by scanning outwards and then bisected,
|
|
65
|
+
* rather than solved for, because the Laguerre roots have no closed form past
|
|
66
|
+
* the quadratic and a bisection on a function we already evaluate cannot drift
|
|
67
|
+
* out of step with what is drawn.
|
|
68
|
+
* @param parameters - Which orbital.
|
|
69
|
+
* @param limit - Distance to search out to, ångström. Defaults to a box that
|
|
70
|
+
* comfortably holds the outermost node.
|
|
71
|
+
* @returns The node radii in ångström, ascending; empty for a nodeless orbital.
|
|
72
|
+
*/
|
|
73
|
+
export declare function radialNodeRadii(parameters: HydrogenicParameters, limit?: number): number[];
|
|
74
|
+
/**
|
|
75
|
+
* Smallest sphere holding a given share of the electron.
|
|
76
|
+
*
|
|
77
|
+
* Used to size the sampling box: too small clips the orbital at a face, too
|
|
78
|
+
* large wastes the grid on empty space, and both are visible on screen.
|
|
79
|
+
* @param parameters - Which orbital.
|
|
80
|
+
* @param fraction - Share of `∫ r²R² dr` to enclose, between 0 and 1.
|
|
81
|
+
* @returns The radius in ångström.
|
|
82
|
+
* @throws {Error} When `fraction` is outside `(0, 1)`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function enclosingRadius(parameters: HydrogenicParameters, fraction: number): number;
|
|
85
|
+
/**
|
|
86
|
+
* Sample the radial distribution `P(r) = r²R(r)²` — the curve whose zeroes are
|
|
87
|
+
* the radial nodes and whose area is the electron.
|
|
88
|
+
* @param parameters - Which orbital.
|
|
89
|
+
* @param limit - Distance to sample out to, ångström.
|
|
90
|
+
* @param count - Number of samples, at least 2.
|
|
91
|
+
* @returns Distances and the amplitude `R`, plus `P`, at each of them.
|
|
92
|
+
* @throws {Error} When `count` is below 2.
|
|
93
|
+
*/
|
|
94
|
+
export declare function radialProfile(parameters: HydrogenicParameters, limit: number, count: number): {
|
|
95
|
+
distances: Float64Array;
|
|
96
|
+
amplitude: Float64Array;
|
|
97
|
+
density: Float64Array;
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=hydrogenic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrogenic.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/hydrogenic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAUH,iEAAiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,CAAC,EAAE,MAAM,CAAC;IACV,mDAAmD;IACnD,CAAC,EAAE,MAAM,CAAC;IACV,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAMnE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAGtE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,oBAAoB,GAC/B,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAwB9B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,oBAAoB,EAChC,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,oBAAoB,EAChC,KAAK,SAA6B,GACjC,MAAM,EAAE,CAmBV;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,oBAAoB,EAChC,QAAQ,EAAE,MAAM,GACf,MAAM,CA0BR;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,oBAAoB,EAChC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAc7E"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hydrogen-like atomic orbitals: the exact one-electron solutions, scaled to an
|
|
3
|
+
* element by an effective nuclear charge.
|
|
4
|
+
*
|
|
5
|
+
* `R(r) = N (2Zr/na₀)^ℓ e^(−Zr/na₀) L^(2ℓ+1)_(n−ℓ−1)(2Zr/na₀)`
|
|
6
|
+
*
|
|
7
|
+
* The associated Laguerre polynomial is the whole point. The Slater orbital a
|
|
8
|
+
* hybridisation model uses is `r^(n−1) e^(−ζr)`, which is **nodeless**: it draws
|
|
9
|
+
* a 2s exactly like a 1s, only fatter. That is fine for a hybrid lobe, where
|
|
10
|
+
* only the outer contour is ever seen, and wrong for a picture whose subject is
|
|
11
|
+
* what an orbital looks like — `n − ℓ − 1` radial nodes and ℓ angular ones is
|
|
12
|
+
* the first thing a student is asked to count.
|
|
13
|
+
*
|
|
14
|
+
* Amplitudes are in Å^(-3/2) and distances in ångström, like everything else
|
|
15
|
+
* here, so `∫|ψ|² dV` over a grid measured in ångström is 1.
|
|
16
|
+
*/
|
|
17
|
+
import { BOHR_IN_ANGSTROM, RYDBERG_ELECTRONVOLTS } from "./constants.js";
|
|
18
|
+
import { assertQuantumNumbers, bisectRoot, factorial, laguerre, } from "./numerics.js";
|
|
19
|
+
/**
|
|
20
|
+
* Radial nodes: spheres on which the wavefunction vanishes and changes sign.
|
|
21
|
+
* @param parameters - Which orbital.
|
|
22
|
+
* @returns `n − ℓ − 1`.
|
|
23
|
+
*/
|
|
24
|
+
export function radialNodeCount(parameters) {
|
|
25
|
+
return parameters.n - parameters.l - 1;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Mean distance of the electron from the nucleus,
|
|
29
|
+
* `⟨r⟩ = a₀(3n² − ℓ(ℓ+1)) / 2Z`.
|
|
30
|
+
* @param parameters - Which orbital.
|
|
31
|
+
* @returns The expectation value in ångström.
|
|
32
|
+
*/
|
|
33
|
+
export function meanRadius(parameters) {
|
|
34
|
+
const { n, l, charge } = parameters;
|
|
35
|
+
return ((BOHR_IN_ANGSTROM * (3 * n * n - l * (l + 1))) /
|
|
36
|
+
(2 * Math.max(charge, 1e-6)));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Orbital energy in the hydrogen-like model, `E = −13.6 Z²/n²` eV.
|
|
40
|
+
* @param parameters - Which orbital.
|
|
41
|
+
* @returns The energy in electronvolts, always negative.
|
|
42
|
+
*/
|
|
43
|
+
export function orbitalEnergy(parameters) {
|
|
44
|
+
const { n, charge } = parameters;
|
|
45
|
+
return (-RYDBERG_ELECTRONVOLTS * charge * charge) / (n * n);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build the radial function `R(r)`, with every constant hoisted out so a grid
|
|
49
|
+
* sweep pays for the exponential and the polynomial only.
|
|
50
|
+
* @param parameters - Which orbital.
|
|
51
|
+
* @returns A function taking a distance in ångström and returning Å^(-3/2).
|
|
52
|
+
* @throws {Error} When the quantum numbers are not a real orbital, i.e. `n < 1` or
|
|
53
|
+
* `ℓ` outside `0 … n − 1`, or when the charge is not positive.
|
|
54
|
+
*/
|
|
55
|
+
export function createRadialFunction(parameters) {
|
|
56
|
+
const { n, l, charge } = parameters;
|
|
57
|
+
assertQuantumNumbers(n, l);
|
|
58
|
+
if (!(charge > 0)) {
|
|
59
|
+
throw new RangeError(`the effective charge must be positive, got ${charge}`);
|
|
60
|
+
}
|
|
61
|
+
const degree = n - l - 1;
|
|
62
|
+
const alpha = 2 * l + 1;
|
|
63
|
+
// ρ = 2Zr/(n a₀), with r in ångström, so a₀ appears once here and never again.
|
|
64
|
+
const rho = (2 * charge) / (n * BOHR_IN_ANGSTROM);
|
|
65
|
+
const normalisation = Math.sqrt(rho * rho * rho * (factorial(degree) / (2 * n * factorial(n + l))));
|
|
66
|
+
return (distance) => {
|
|
67
|
+
const scaled = rho * distance;
|
|
68
|
+
return (normalisation *
|
|
69
|
+
scaled ** l *
|
|
70
|
+
Math.exp(-scaled / 2) *
|
|
71
|
+
laguerre(degree, alpha, scaled));
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Evaluate the radial function once.
|
|
76
|
+
* @param parameters - Which orbital.
|
|
77
|
+
* @param distance - Distance from the nucleus, ångström.
|
|
78
|
+
* @returns The radial amplitude, Å^(-3/2).
|
|
79
|
+
*/
|
|
80
|
+
export function radialAmplitude(parameters, distance) {
|
|
81
|
+
return createRadialFunction(parameters)(distance);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Where the radial nodes actually are.
|
|
85
|
+
*
|
|
86
|
+
* The `n − ℓ − 1` roots are bracketed by scanning outwards and then bisected,
|
|
87
|
+
* rather than solved for, because the Laguerre roots have no closed form past
|
|
88
|
+
* the quadratic and a bisection on a function we already evaluate cannot drift
|
|
89
|
+
* out of step with what is drawn.
|
|
90
|
+
* @param parameters - Which orbital.
|
|
91
|
+
* @param limit - Distance to search out to, ångström. Defaults to a box that
|
|
92
|
+
* comfortably holds the outermost node.
|
|
93
|
+
* @returns The node radii in ångström, ascending; empty for a nodeless orbital.
|
|
94
|
+
*/
|
|
95
|
+
export function radialNodeRadii(parameters, limit = meanRadius(parameters) * 3) {
|
|
96
|
+
const expected = radialNodeCount(parameters);
|
|
97
|
+
if (expected === 0)
|
|
98
|
+
return [];
|
|
99
|
+
const radial = createRadialFunction(parameters);
|
|
100
|
+
const radii = [];
|
|
101
|
+
const steps = 4000;
|
|
102
|
+
let previousDistance = 1e-6;
|
|
103
|
+
let previous = radial(previousDistance);
|
|
104
|
+
for (let step = 1; step <= steps; step++) {
|
|
105
|
+
const distance = (limit * step) / steps;
|
|
106
|
+
const value = radial(distance);
|
|
107
|
+
if (previous === 0 || previous < 0 !== value < 0) {
|
|
108
|
+
radii.push(bisectRoot(radial, previousDistance, distance));
|
|
109
|
+
if (radii.length === expected)
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
previousDistance = distance;
|
|
113
|
+
previous = value;
|
|
114
|
+
}
|
|
115
|
+
return radii;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Smallest sphere holding a given share of the electron.
|
|
119
|
+
*
|
|
120
|
+
* Used to size the sampling box: too small clips the orbital at a face, too
|
|
121
|
+
* large wastes the grid on empty space, and both are visible on screen.
|
|
122
|
+
* @param parameters - Which orbital.
|
|
123
|
+
* @param fraction - Share of `∫ r²R² dr` to enclose, between 0 and 1.
|
|
124
|
+
* @returns The radius in ångström.
|
|
125
|
+
* @throws {Error} When `fraction` is outside `(0, 1)`.
|
|
126
|
+
*/
|
|
127
|
+
export function enclosingRadius(parameters, fraction) {
|
|
128
|
+
if (!(fraction > 0) || fraction >= 1) {
|
|
129
|
+
throw new RangeError(`the enclosed fraction must be in (0, 1)`);
|
|
130
|
+
}
|
|
131
|
+
const radial = createRadialFunction(parameters);
|
|
132
|
+
// The tail decays as e^(−2Zr/n a₀); ten mean radii is far past every node.
|
|
133
|
+
const limit = meanRadius(parameters) * 10;
|
|
134
|
+
const steps = 4000;
|
|
135
|
+
const step = limit / steps;
|
|
136
|
+
const weights = new Float64Array(steps + 1);
|
|
137
|
+
let total = 0;
|
|
138
|
+
for (let index = 0; index <= steps; index++) {
|
|
139
|
+
const distance = index * step;
|
|
140
|
+
const value = radial(distance);
|
|
141
|
+
const weight = value * value * distance * distance;
|
|
142
|
+
weights[index] = weight;
|
|
143
|
+
total += weight;
|
|
144
|
+
}
|
|
145
|
+
if (total === 0)
|
|
146
|
+
return limit;
|
|
147
|
+
let running = 0;
|
|
148
|
+
const target = total * fraction;
|
|
149
|
+
for (let index = 0; index <= steps; index++) {
|
|
150
|
+
running += weights[index];
|
|
151
|
+
if (running >= target)
|
|
152
|
+
return index * step;
|
|
153
|
+
}
|
|
154
|
+
return limit;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Sample the radial distribution `P(r) = r²R(r)²` — the curve whose zeroes are
|
|
158
|
+
* the radial nodes and whose area is the electron.
|
|
159
|
+
* @param parameters - Which orbital.
|
|
160
|
+
* @param limit - Distance to sample out to, ångström.
|
|
161
|
+
* @param count - Number of samples, at least 2.
|
|
162
|
+
* @returns Distances and the amplitude `R`, plus `P`, at each of them.
|
|
163
|
+
* @throws {Error} When `count` is below 2.
|
|
164
|
+
*/
|
|
165
|
+
export function radialProfile(parameters, limit, count) {
|
|
166
|
+
if (count < 2)
|
|
167
|
+
throw new RangeError('a radial profile needs 2 samples');
|
|
168
|
+
const radial = createRadialFunction(parameters);
|
|
169
|
+
const distances = new Float64Array(count);
|
|
170
|
+
const amplitude = new Float64Array(count);
|
|
171
|
+
const density = new Float64Array(count);
|
|
172
|
+
for (let index = 0; index < count; index++) {
|
|
173
|
+
const distance = (limit * index) / (count - 1);
|
|
174
|
+
const value = radial(distance);
|
|
175
|
+
distances[index] = distance;
|
|
176
|
+
amplitude[index] = value;
|
|
177
|
+
density[index] = value * value * distance * distance;
|
|
178
|
+
}
|
|
179
|
+
return { distances, amplitude, density };
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=hydrogenic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrogenic.js","sourceRoot":"","sources":["../../../src/orbital/core/hydrogenic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,QAAQ,GACT,MAAM,eAAe,CAAC;AAYvB;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,UAAgC;IAC9D,OAAO,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,UAAgC;IACzD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACpC,OAAO,CACL,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAC7B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,UAAgC;IAC5D,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACjC,OAAO,CAAC,CAAC,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC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AU,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IACxC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/B,SAAS,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;QAC5B,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvD,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { AtomicGridOptions } from './atomicGrid.ts';
|
|
2
|
+
export { atomicGridBox, createAtomicOrbitalEvaluator, sampleAtomicOrbital, } from './atomicGrid.ts';
|
|
3
|
+
export type { AtomicOrbital, AtomicOrbitalOptions } from './atomicOrbitals.ts';
|
|
4
|
+
export { atomicOrbitalsOf, defaultOrbitalId, findAtomicOrbital, hydrogenicParametersOf, orbitalId, } from './atomicOrbitals.ts';
|
|
5
|
+
export type { Vec3 } from './constants.ts';
|
|
6
|
+
export { BOHR_IN_ANGSTROM, ENCLOSED_WEIGHT, RYDBERG_ELECTRONVOLTS, } from './constants.ts';
|
|
7
|
+
export type { Subshell, SubshellOccupancy } from './electronConfiguration.ts';
|
|
8
|
+
export { ELEMENT_ANOMALIES, HIGHEST_ATOMIC_NUMBER, MADELUNG_ORDER, NOBLE_GASES, assertAtomicNumber, aufbauConfigurationOf, configurationOf, coreAtomicNumber, formatConfiguration, formatOccupancy, isAnomalous, subshellCapacity, subshellLabel, superscript, } from './electronConfiguration.ts';
|
|
9
|
+
export type { GridBox, OrbitalEvaluator, OrbitalGrid } from './grid.ts';
|
|
10
|
+
export { evaluateGrid, gridIndex } from './grid.ts';
|
|
11
|
+
export type { HydrogenicParameters } from './hydrogenic.ts';
|
|
12
|
+
export { createRadialFunction, enclosingRadius, meanRadius, orbitalEnergy, radialAmplitude, radialNodeCount, radialNodeRadii, radialProfile, } from './hydrogenic.ts';
|
|
13
|
+
export { hundDistribution, outermostShell, withoutOutermostElectron, } from './occupancy.ts';
|
|
14
|
+
export type { PhasePalette, PhasePaletteId } from './palette.ts';
|
|
15
|
+
export { DEFAULT_PHASE_PALETTE_ID, PHASE_PALETTES } from './palette.ts';
|
|
16
|
+
export type { RealHarmonic } from './realHarmonics.ts';
|
|
17
|
+
export { REAL_HARMONICS, SUBSHELL_LETTERS, harmonicsOf, subshellLetter, } from './realHarmonics.ts';
|
|
18
|
+
export type { AtomicSampleRequest, AtomicSampleResult, AtomicSampler, } from './sample.ts';
|
|
19
|
+
export { runAtomicSample, sampleInProcess } from './sample.ts';
|
|
20
|
+
export type { Screening } from './screening.ts';
|
|
21
|
+
export { groupRank, slaterScreening } from './screening.ts';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,gBAAgB,EA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AE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { atomicGridBox, createAtomicOrbitalEvaluator, sampleAtomicOrbital, } from "./atomicGrid.js";
|
|
2
|
+
export { atomicOrbitalsOf, defaultOrbitalId, findAtomicOrbital, hydrogenicParametersOf, orbitalId, } from "./atomicOrbitals.js";
|
|
3
|
+
export { BOHR_IN_ANGSTROM, ENCLOSED_WEIGHT, RYDBERG_ELECTRONVOLTS, } from "./constants.js";
|
|
4
|
+
export { ELEMENT_ANOMALIES, HIGHEST_ATOMIC_NUMBER, MADELUNG_ORDER, NOBLE_GASES, assertAtomicNumber, aufbauConfigurationOf, configurationOf, coreAtomicNumber, formatConfiguration, formatOccupancy, isAnomalous, subshellCapacity, subshellLabel, superscript, } from "./electronConfiguration.js";
|
|
5
|
+
export { evaluateGrid, gridIndex } from "./grid.js";
|
|
6
|
+
export { createRadialFunction, enclosingRadius, meanRadius, orbitalEnergy, radialAmplitude, radialNodeCount, radialNodeRadii, radialProfile, } from "./hydrogenic.js";
|
|
7
|
+
export { hundDistribution, outermostShell, withoutOutermostElectron, } from "./occupancy.js";
|
|
8
|
+
export { DEFAULT_PHASE_PALETTE_ID, PHASE_PALETTES } from "./palette.js";
|
|
9
|
+
export { REAL_HARMONICS, SUBSHELL_LETTERS, harmonicsOf, subshellLetter, } from "./realHarmonics.js";
|
|
10
|
+
export { runAtomicSample, sampleInProcess } from "./sample.js";
|
|
11
|
+
export { groupRank, slaterScreening } from "./screening.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orbital/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,SAAS,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,WAAW,GACZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,cAAc,GACf,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The numerical machinery the radial functions are built on.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from `hydrogenic.ts` so that file reads as the physics it is —
|
|
5
|
+
* `R(r)`, `⟨r⟩`, the nodes, the enclosing sphere — with none of it buried under
|
|
6
|
+
* a polynomial recurrence and a bisection.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The generalised Laguerre polynomial `L^α_k(x)`, by its three-term recurrence.
|
|
10
|
+
*
|
|
11
|
+
* The closed form overflows well before `n = 7`; `k` is at most 6 here.
|
|
12
|
+
* @param degree - Degree `k` of the polynomial.
|
|
13
|
+
* @param alpha - Order `α` of the polynomial.
|
|
14
|
+
* @param x - Where to evaluate it.
|
|
15
|
+
* @returns The value of the polynomial.
|
|
16
|
+
*/
|
|
17
|
+
export declare function laguerre(degree: number, alpha: number, x: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* The root of a function inside a bracket it already changes sign over.
|
|
20
|
+
* @param radial - The function to find a zero of.
|
|
21
|
+
* @param low - Lower end of the bracket.
|
|
22
|
+
* @param high - Upper end.
|
|
23
|
+
* @returns The root, to about a picometre.
|
|
24
|
+
*/
|
|
25
|
+
export declare function bisectRoot(radial: (distance: number) => number, low: number, high: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Reject quantum numbers that are not a real orbital.
|
|
28
|
+
* @param n - Principal quantum number.
|
|
29
|
+
* @param l - Angular momentum quantum number.
|
|
30
|
+
* @throws {RangeError} When `n < 1`, or ℓ is outside `0 … n − 1`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function assertQuantumNumbers(n: number, l: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* The factorial of a small non-negative integer.
|
|
35
|
+
* @param value - The integer.
|
|
36
|
+
* @returns Its factorial.
|
|
37
|
+
*/
|
|
38
|
+
export declare function factorial(value: number): number;
|
|
39
|
+
//# sourceMappingURL=numerics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numerics.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/numerics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAYzE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,EACpC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAUR;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAO/D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI/C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The numerical machinery the radial functions are built on.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from `hydrogenic.ts` so that file reads as the physics it is —
|
|
5
|
+
* `R(r)`, `⟨r⟩`, the nodes, the enclosing sphere — with none of it buried under
|
|
6
|
+
* a polynomial recurrence and a bisection.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The generalised Laguerre polynomial `L^α_k(x)`, by its three-term recurrence.
|
|
10
|
+
*
|
|
11
|
+
* The closed form overflows well before `n = 7`; `k` is at most 6 here.
|
|
12
|
+
* @param degree - Degree `k` of the polynomial.
|
|
13
|
+
* @param alpha - Order `α` of the polynomial.
|
|
14
|
+
* @param x - Where to evaluate it.
|
|
15
|
+
* @returns The value of the polynomial.
|
|
16
|
+
*/
|
|
17
|
+
export function laguerre(degree, alpha, x) {
|
|
18
|
+
if (degree === 0)
|
|
19
|
+
return 1;
|
|
20
|
+
let previous = 1;
|
|
21
|
+
let current = 1 + alpha - x;
|
|
22
|
+
for (let index = 1; index < degree; index++) {
|
|
23
|
+
const next = ((2 * index + 1 + alpha - x) * current - (index + alpha) * previous) /
|
|
24
|
+
(index + 1);
|
|
25
|
+
previous = current;
|
|
26
|
+
current = next;
|
|
27
|
+
}
|
|
28
|
+
return current;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The root of a function inside a bracket it already changes sign over.
|
|
32
|
+
* @param radial - The function to find a zero of.
|
|
33
|
+
* @param low - Lower end of the bracket.
|
|
34
|
+
* @param high - Upper end.
|
|
35
|
+
* @returns The root, to about a picometre.
|
|
36
|
+
*/
|
|
37
|
+
export function bisectRoot(radial, low, high) {
|
|
38
|
+
let left = low;
|
|
39
|
+
let right = high;
|
|
40
|
+
const leftSign = radial(left) < 0;
|
|
41
|
+
for (let step = 0; step < 60 && right - left > 1e-9; step++) {
|
|
42
|
+
const middle = (left + right) / 2;
|
|
43
|
+
if (radial(middle) < 0 === leftSign)
|
|
44
|
+
left = middle;
|
|
45
|
+
else
|
|
46
|
+
right = middle;
|
|
47
|
+
}
|
|
48
|
+
return (left + right) / 2;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Reject quantum numbers that are not a real orbital.
|
|
52
|
+
* @param n - Principal quantum number.
|
|
53
|
+
* @param l - Angular momentum quantum number.
|
|
54
|
+
* @throws {RangeError} When `n < 1`, or ℓ is outside `0 … n − 1`.
|
|
55
|
+
*/
|
|
56
|
+
export function assertQuantumNumbers(n, l) {
|
|
57
|
+
if (!Number.isInteger(n) || n < 1) {
|
|
58
|
+
throw new RangeError(`the principal quantum number must be 1 or more`);
|
|
59
|
+
}
|
|
60
|
+
if (!Number.isInteger(l) || l < 0 || l >= n) {
|
|
61
|
+
throw new RangeError(`ℓ must be between 0 and ${n - 1} for n = ${n}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The factorial of a small non-negative integer.
|
|
66
|
+
* @param value - The integer.
|
|
67
|
+
* @returns Its factorial.
|
|
68
|
+
*/
|
|
69
|
+
export function factorial(value) {
|
|
70
|
+
let result = 1;
|
|
71
|
+
for (let index = 2; index <= value; index++)
|
|
72
|
+
result *= index;
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=numerics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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YAC9C,KAAK,GAAG,MAAM,CAAC;IACtB,CAAC;IACD,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAAS,EAAE,CAAS;IACvD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAAC,gDAAgD,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,UAAU,CAAC,2BAA2B,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,KAAK,EAAE,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the electrons of one atom are laid out over its orbitals, and the two
|
|
3
|
+
* adjustments a *virtual* orbital needs.
|
|
4
|
+
*
|
|
5
|
+
* Split out of `atomicOrbitals.ts` so that module stays what it says it is —
|
|
6
|
+
* the join of a configuration, a screening, a radial function and a harmonic —
|
|
7
|
+
* with none of the bookkeeping in the way.
|
|
8
|
+
*/
|
|
9
|
+
import type { SubshellOccupancy } from './electronConfiguration.ts';
|
|
10
|
+
/**
|
|
11
|
+
* Slater's rules can hand a badly-screened orbital a charge at or below zero —
|
|
12
|
+
* a 7p on hydrogen, say — which has no bound hydrogen-like solution. Clamping
|
|
13
|
+
* to a small positive charge keeps such an orbital enormous and diffuse, which
|
|
14
|
+
* is the honest picture, rather than throwing.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MINIMUM_CHARGE = 0.3;
|
|
17
|
+
/**
|
|
18
|
+
* Spread electrons over the orbitals of a subshell by Hund's rule.
|
|
19
|
+
* @param electrons - Electrons in the subshell.
|
|
20
|
+
* @param orbitalCount - `2ℓ + 1`.
|
|
21
|
+
* @returns One count per orbital: singles first, then pairs.
|
|
22
|
+
*/
|
|
23
|
+
export declare function hundDistribution(electrons: number, orbitalCount: number): number[];
|
|
24
|
+
/**
|
|
25
|
+
* How far up the list goes when the caller does not say.
|
|
26
|
+
* @param valenceShell - Outermost occupied shell.
|
|
27
|
+
* @returns One shell past it, never below 4 and never above 7.
|
|
28
|
+
*/
|
|
29
|
+
export declare function defaultMaximumShell(valenceShell: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* The configuration with one electron taken out of the outermost occupied
|
|
32
|
+
* subshell — the atom as it is while one of its electrons sits in a virtual
|
|
33
|
+
* orbital.
|
|
34
|
+
* @param configuration - The ground-state configuration to reduce.
|
|
35
|
+
* @returns The reduced configuration, empty subshells dropped.
|
|
36
|
+
*/
|
|
37
|
+
export declare function withoutOutermostElectron(configuration: readonly SubshellOccupancy[]): SubshellOccupancy[];
|
|
38
|
+
/**
|
|
39
|
+
* The outermost shell an atom actually occupies.
|
|
40
|
+
* @param configuration - Its configuration.
|
|
41
|
+
* @returns The largest `n` holding an electron.
|
|
42
|
+
*/
|
|
43
|
+
export declare function outermostShell(configuration: readonly SubshellOccupancy[]): number;
|
|
44
|
+
//# sourceMappingURL=occupancy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"occupancy.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/occupancy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,MAAM,EAAE,CAWV;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,SAAS,iBAAiB,EAAE,GAC1C,iBAAiB,EAAE,CAqBrB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,iBAAiB,EAAE,GAC1C,MAAM,CAMR"}
|