react-cheminfo 0.1.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 +50 -9
- package/lib/citation/core/formats.js +2 -3
- package/lib/citation/core/formats.js.map +1 -1
- package/lib/citation/core/segments.d.ts +8 -0
- package/lib/citation/core/segments.d.ts.map +1 -1
- package/lib/citation/core/segments.js +12 -3
- package/lib/citation/core/segments.js.map +1 -1
- 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 +45 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.d.ts +33 -0
- package/lib/ecosystem/ui/EcosystemLinks.d.ts.map +1 -0
- package/lib/ecosystem/ui/EcosystemLinks.js +55 -0
- package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -0
- package/lib/ecosystem/ui/EcosystemMenu.d.ts +3 -1
- package/lib/ecosystem/ui/EcosystemMenu.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js +7 -84
- package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
- package/lib/ecosystem/ui/SiteTile.d.ts +34 -0
- package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -0
- package/lib/ecosystem/ui/SiteTile.js +78 -0
- package/lib/ecosystem/ui/SiteTile.js.map +1 -0
- 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/index.d.ts +4 -0
- package/lib/ecosystem/ui/index.d.ts.map +1 -1
- package/lib/ecosystem/ui/index.js +2 -0
- package/lib/ecosystem/ui/index.js.map +1 -1
- package/lib/ecosystem/ui/marks.d.ts.map +1 -1
- package/lib/ecosystem/ui/marks.js +3 -28
- 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 +13 -5
- package/src/citation/core/formats.ts +2 -3
- package/src/citation/core/segments.ts +11 -3
- package/src/core.ts +1 -0
- package/src/ecosystem/core/sites.ts +51 -1
- package/src/ecosystem/ui/EcosystemLinks.tsx +114 -0
- package/src/ecosystem/ui/EcosystemMenu.tsx +8 -135
- package/src/ecosystem/ui/SiteTile.tsx +148 -0
- package/src/ecosystem/ui/glyphs.tsx +246 -0
- package/src/ecosystem/ui/index.ts +4 -0
- package/src/ecosystem/ui/marks.tsx +5 -159
- 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,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every orbital of one element, assembled from the four parts that describe it.
|
|
3
|
+
*
|
|
4
|
+
* The configuration says which subshells hold electrons, Slater's rules say how
|
|
5
|
+
* strongly each is bound, the hydrogen-like radial function gives it a size and
|
|
6
|
+
* its radial nodes, and a real spherical harmonic gives it a shape. This module
|
|
7
|
+
* is only the join — it computes nothing itself, which is what keeps each of
|
|
8
|
+
* those four testable on its own.
|
|
9
|
+
*
|
|
10
|
+
* Electrons inside a subshell are spread by Hund's rule: every orbital of the
|
|
11
|
+
* subshell takes one before any takes a second. That is why nitrogen shows
|
|
12
|
+
* three singly-occupied 2p orbitals and oxygen one pair and two singles.
|
|
13
|
+
*/
|
|
14
|
+
import { MADELUNG_ORDER, configurationOf, subshellLabel, } from "./electronConfiguration.js";
|
|
15
|
+
import { meanRadius, orbitalEnergy, radialNodeCount } from "./hydrogenic.js";
|
|
16
|
+
import { MINIMUM_CHARGE, defaultMaximumShell, hundDistribution, outermostShell, withoutOutermostElectron, } from "./occupancy.js";
|
|
17
|
+
import { harmonicsOf, subshellLetter } from "./realHarmonics.js";
|
|
18
|
+
import { slaterScreening } from "./screening.js";
|
|
19
|
+
/**
|
|
20
|
+
* Every orbital of an element, in Madelung (roughly energetic) order.
|
|
21
|
+
* @param atomicNumber - Proton count, 1 to 118.
|
|
22
|
+
* @param options - See {@link AtomicOrbitalOptions}.
|
|
23
|
+
* @returns The orbitals, occupied ones first in filling order and the empty
|
|
24
|
+
* ones after them in the same order.
|
|
25
|
+
* @throws {Error} When the atomic number is outside the periodic table.
|
|
26
|
+
*/
|
|
27
|
+
export function atomicOrbitalsOf(atomicNumber, options = {}) {
|
|
28
|
+
const configuration = configurationOf(atomicNumber);
|
|
29
|
+
const valenceShell = outermostShell(configuration);
|
|
30
|
+
const { maximumShell = defaultMaximumShell(valenceShell) } = options;
|
|
31
|
+
const occupancies = new Map();
|
|
32
|
+
for (const entry of configuration) {
|
|
33
|
+
occupancies.set(`${entry.n}.${entry.l}`, entry.electrons);
|
|
34
|
+
}
|
|
35
|
+
const promoted = withoutOutermostElectron(configuration);
|
|
36
|
+
const orbitals = [];
|
|
37
|
+
for (const subshell of MADELUNG_ORDER) {
|
|
38
|
+
if (subshell.n > maximumShell)
|
|
39
|
+
continue;
|
|
40
|
+
const subshellElectrons = occupancies.get(`${subshell.n}.${subshell.l}`) ?? 0;
|
|
41
|
+
// An empty orbital is the one an electron would be *promoted* into, so the
|
|
42
|
+
// electron doing the promoting is not also left behind to screen it. This
|
|
43
|
+
// is what makes hydrogen's 3s and 4f come out as the exact hydrogen
|
|
44
|
+
// orbitals every textbook draws, rather than as unbound ones: screened by
|
|
45
|
+
// its own single electron, hydrogen's 3s would see a nuclear charge of zero.
|
|
46
|
+
const screening = slaterScreening(atomicNumber, subshellElectrons === 0 ? promoted : configuration, subshell);
|
|
47
|
+
// Slater's rules can still over-screen a far virtual orbital; a charge at
|
|
48
|
+
// or below zero has no bound radial function at all.
|
|
49
|
+
const charge = Math.max(screening.effectiveCharge, MINIMUM_CHARGE);
|
|
50
|
+
const parameters = {
|
|
51
|
+
n: subshell.n,
|
|
52
|
+
l: subshell.l,
|
|
53
|
+
charge,
|
|
54
|
+
};
|
|
55
|
+
const harmonics = harmonicsOf(subshell.l);
|
|
56
|
+
const spread = hundDistribution(subshellElectrons, harmonics.length);
|
|
57
|
+
for (let index = 0; index < harmonics.length; index++) {
|
|
58
|
+
const harmonic = harmonics[index];
|
|
59
|
+
orbitals.push({
|
|
60
|
+
id: orbitalId(subshell.n, subshell.l, harmonic),
|
|
61
|
+
n: subshell.n,
|
|
62
|
+
l: subshell.l,
|
|
63
|
+
harmonic,
|
|
64
|
+
shell: subshellLabel(subshell),
|
|
65
|
+
electrons: spread[index],
|
|
66
|
+
subshellElectrons,
|
|
67
|
+
effectiveCharge: charge,
|
|
68
|
+
shielding: screening.shielding,
|
|
69
|
+
energy: orbitalEnergy(parameters),
|
|
70
|
+
radialNodes: radialNodeCount(parameters),
|
|
71
|
+
angularNodes: subshell.l,
|
|
72
|
+
meanRadius: meanRadius(parameters),
|
|
73
|
+
isVirtual: subshellElectrons === 0,
|
|
74
|
+
isValence: subshellElectrons > 0 && subshell.n === valenceShell,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return orbitals;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Find one orbital of an element by its id.
|
|
82
|
+
* @param orbitals - What {@link atomicOrbitalsOf} returned.
|
|
83
|
+
* @param id - Orbital id, e.g. `2px`.
|
|
84
|
+
* @returns The orbital, or `null` when the id names none.
|
|
85
|
+
*/
|
|
86
|
+
export function findAtomicOrbital(orbitals, id) {
|
|
87
|
+
for (const orbital of orbitals) {
|
|
88
|
+
if (orbital.id === id)
|
|
89
|
+
return orbital;
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The hydrogen-like parameters an orbital is drawn from.
|
|
95
|
+
* @param orbital - The orbital.
|
|
96
|
+
* @returns Its principal quantum number, ℓ and effective charge.
|
|
97
|
+
*/
|
|
98
|
+
export function hydrogenicParametersOf(orbital) {
|
|
99
|
+
return { n: orbital.n, l: orbital.l, charge: orbital.effectiveCharge };
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The id of one orbital, as it appears in a URL.
|
|
103
|
+
* @param n - Principal quantum number.
|
|
104
|
+
* @param l - Angular momentum quantum number.
|
|
105
|
+
* @param harmonic - Which real harmonic of the subshell.
|
|
106
|
+
* @returns The id, e.g. `4fxyz`.
|
|
107
|
+
*/
|
|
108
|
+
export function orbitalId(n, l, harmonic) {
|
|
109
|
+
return `${n}${subshellLetter(l)}${harmonic.key}`;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The orbital a student should land on when they pick an element: the first
|
|
113
|
+
* one of the outermost occupied subshell, which is what the element's chemistry
|
|
114
|
+
* is about.
|
|
115
|
+
* @param orbitals - What {@link atomicOrbitalsOf} returned.
|
|
116
|
+
* @returns Its id, or `null` when the list is empty.
|
|
117
|
+
*/
|
|
118
|
+
export function defaultOrbitalId(orbitals) {
|
|
119
|
+
let candidate = null;
|
|
120
|
+
for (const orbital of orbitals) {
|
|
121
|
+
if (orbital.electrons === 0)
|
|
122
|
+
continue;
|
|
123
|
+
if (candidate === null) {
|
|
124
|
+
candidate = orbital;
|
|
125
|
+
}
|
|
126
|
+
else if (orbital.n > candidate.n) {
|
|
127
|
+
candidate = orbital;
|
|
128
|
+
}
|
|
129
|
+
else if (orbital.n === candidate.n && orbital.l > candidate.l) {
|
|
130
|
+
candidate = orbital;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return (candidate ?? orbitals[0])?.id ?? null;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=atomicOrbitals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomicOrbitals.js","sourceRoot":"","sources":["../../../src/orbital/core/atomicOrbitals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,GACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC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
|
|
1
|
+
/**
|
|
2
|
+
* The two physical constants the orbital maths is written in, and the units
|
|
3
|
+
* everything else here follows.
|
|
4
|
+
*
|
|
5
|
+
* Distances are **ångström** and amplitudes **Å^(-3/2)** throughout, so
|
|
6
|
+
* `∫|ψ|² dV` over a grid measured in ångström is one and nothing has to be
|
|
7
|
+
* converted on the way to a renderer. The Bohr radius therefore appears exactly
|
|
8
|
+
* once, in `hydrogenic.ts`.
|
|
9
|
+
*/
|
|
10
|
+
/** The Bohr radius in ångström (CODATA 2018). */
|
|
11
|
+
export declare const BOHR_IN_ANGSTROM = 0.529177210903;
|
|
12
|
+
/** One rydberg in electronvolts (CODATA 2018). */
|
|
13
|
+
export declare const RYDBERG_ELECTRONVOLTS = 13.605693122994;
|
|
14
|
+
/**
|
|
15
|
+
* Share of an orbital's weight the default isosurface encloses.
|
|
16
|
+
*
|
|
17
|
+
* 0.85 is the contour a textbook draws: tight enough that the lobes are
|
|
18
|
+
* separate shapes, loose enough that the outer one of a 3s is still there.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ENCLOSED_WEIGHT = 0.85;
|
|
21
|
+
/**
|
|
22
|
+
* A point in space, ångström.
|
|
23
|
+
*
|
|
24
|
+
* Declared here rather than taken from a geometry package: three numbers are
|
|
25
|
+
* not worth a dependency, and this one crosses a worker boundary as a plain
|
|
26
|
+
* object.
|
|
27
|
+
*/
|
|
28
|
+
export interface Vec3 {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
z: number;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,iBAAoB,CAAC;AAElD,kDAAkD;AAClD,eAAO,MAAM,qBAAqB,kBAAqB,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two physical constants the orbital maths is written in, and the units
|
|
3
|
+
* everything else here follows.
|
|
4
|
+
*
|
|
5
|
+
* Distances are **ångström** and amplitudes **Å^(-3/2)** throughout, so
|
|
6
|
+
* `∫|ψ|² dV` over a grid measured in ångström is one and nothing has to be
|
|
7
|
+
* converted on the way to a renderer. The Bohr radius therefore appears exactly
|
|
8
|
+
* once, in `hydrogenic.ts`.
|
|
9
|
+
*/
|
|
10
|
+
/** The Bohr radius in ångström (CODATA 2018). */
|
|
11
|
+
export const BOHR_IN_ANGSTROM = 0.529_177_210_903;
|
|
12
|
+
/** One rydberg in electronvolts (CODATA 2018). */
|
|
13
|
+
export const RYDBERG_ELECTRONVOLTS = 13.605_693_122_994;
|
|
14
|
+
/**
|
|
15
|
+
* Share of an orbital's weight the default isosurface encloses.
|
|
16
|
+
*
|
|
17
|
+
* 0.85 is the contour a textbook draws: tight enough that the lobes are
|
|
18
|
+
* separate shapes, loose enough that the outer one of a 3s is still there.
|
|
19
|
+
*/
|
|
20
|
+
export const ENCLOSED_WEIGHT = 0.85;
|
|
21
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/orbital/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,iDAAiD;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAElD,kDAAkD;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ground-state electron configurations, by the Aufbau principle and the twenty
|
|
3
|
+
* elements that ignore it.
|
|
4
|
+
*
|
|
5
|
+
* Subshells fill in Madelung order — increasing `n + ℓ`, and increasing `n`
|
|
6
|
+
* within a tie — which is why 4s fills before 3d. That rule gets 98 of the 118
|
|
7
|
+
* elements right; the rest are measured, not derived, and live in
|
|
8
|
+
* {@link ELEMENT_ANOMALIES}. Chromium is the canonical one: Aufbau predicts
|
|
9
|
+
* `[Ar]3d⁴4s²` and the atom is `[Ar]3d⁵4s¹`.
|
|
10
|
+
*
|
|
11
|
+
* Configurations are returned sorted by `n` then `ℓ`, the order a textbook
|
|
12
|
+
* writes them in — `[Ar]3d⁵4s¹`, not `[Ar]4s¹3d⁵`.
|
|
13
|
+
*/
|
|
14
|
+
/** One subshell, e.g. `{ n: 3, l: 2 }` for 3d. */
|
|
15
|
+
export interface Subshell {
|
|
16
|
+
n: number;
|
|
17
|
+
/** Angular momentum quantum number: 0 = s, 1 = p, 2 = d, 3 = f. */
|
|
18
|
+
l: number;
|
|
19
|
+
}
|
|
20
|
+
/** A subshell and how many electrons sit in it. */
|
|
21
|
+
export interface SubshellOccupancy extends Subshell {
|
|
22
|
+
electrons: number;
|
|
23
|
+
}
|
|
24
|
+
/** Protons in the heaviest element that has been made. */
|
|
25
|
+
export declare const HIGHEST_ATOMIC_NUMBER = 118;
|
|
26
|
+
/** The atomic numbers of the noble gases, which a configuration abbreviates on. */
|
|
27
|
+
export declare const NOBLE_GASES: readonly number[];
|
|
28
|
+
/**
|
|
29
|
+
* Reject an atomic number outside the periodic table.
|
|
30
|
+
* @param atomicNumber - Proton count to check.
|
|
31
|
+
* @throws {Error} When it is not an integer between 1 and 118.
|
|
32
|
+
*/
|
|
33
|
+
export declare function assertAtomicNumber(atomicNumber: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Subshells in the order they fill, `s` to `f` and up to n = 7 — everything the
|
|
36
|
+
* 118 known elements use, plus the empty subshells a light atom's virtual
|
|
37
|
+
* orbitals come from.
|
|
38
|
+
*/
|
|
39
|
+
export declare const MADELUNG_ORDER: Subshell[];
|
|
40
|
+
/**
|
|
41
|
+
* How many electrons a subshell holds: `2(2ℓ + 1)`.
|
|
42
|
+
* @param l - Angular momentum quantum number.
|
|
43
|
+
* @returns The capacity, `2(2ℓ + 1)`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function subshellCapacity(l: number): number;
|
|
46
|
+
/**
|
|
47
|
+
* The measured ground states that Madelung order gets wrong, as the occupancy
|
|
48
|
+
* beyond the preceding noble gas.
|
|
49
|
+
*
|
|
50
|
+
* Half-filled and filled d shells are unusually stable, which is the story for
|
|
51
|
+
* Cr, Cu, Mo, Ag, Au and Gd; the early actinides are relativistic and 6d/5f sit
|
|
52
|
+
* almost on top of each other. Configurations past lawrencium are calculated
|
|
53
|
+
* rather than observed, so nothing beyond Z = 103 is listed here.
|
|
54
|
+
*/
|
|
55
|
+
export declare const ELEMENT_ANOMALIES: Record<number, SubshellOccupancy[]>;
|
|
56
|
+
/**
|
|
57
|
+
* The ground-state configuration of a neutral atom.
|
|
58
|
+
* @param atomicNumber - Proton count, 1 to 118.
|
|
59
|
+
* @returns Its occupied subshells, sorted by `n` then `ℓ`.
|
|
60
|
+
* @throws {Error} When the atomic number is outside the table.
|
|
61
|
+
*/
|
|
62
|
+
export declare function configurationOf(atomicNumber: number): SubshellOccupancy[];
|
|
63
|
+
/**
|
|
64
|
+
* Whether an element's ground state departs from Madelung order.
|
|
65
|
+
* @param atomicNumber - Proton count.
|
|
66
|
+
* @returns True for the twenty listed in {@link ELEMENT_ANOMALIES}.
|
|
67
|
+
*/
|
|
68
|
+
export declare function isAnomalous(atomicNumber: number): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* What Madelung order alone predicts, so the UI can show the two side by side.
|
|
71
|
+
* @param atomicNumber - Proton count, 1 to 118.
|
|
72
|
+
* @returns The predicted occupied subshells, sorted by `n` then `ℓ`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function aufbauConfigurationOf(atomicNumber: number): SubshellOccupancy[];
|
|
75
|
+
/**
|
|
76
|
+
* The noble gas a configuration is abbreviated against.
|
|
77
|
+
* @param atomicNumber - Proton count.
|
|
78
|
+
* @returns The largest noble gas strictly below it, or 0 for hydrogen and
|
|
79
|
+
* helium, which are written out in full.
|
|
80
|
+
*/
|
|
81
|
+
export declare function coreAtomicNumber(atomicNumber: number): number;
|
|
82
|
+
/**
|
|
83
|
+
* Write a configuration the way a textbook does.
|
|
84
|
+
* @param occupancies - Subshells to write, in the order they should appear.
|
|
85
|
+
* @returns A string such as `1s² 2s² 2p⁶`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function formatConfiguration(occupancies: readonly SubshellOccupancy[]): string;
|
|
88
|
+
/**
|
|
89
|
+
* Write one subshell, e.g. `3d⁵`.
|
|
90
|
+
* @param occupancy - The subshell and its electron count.
|
|
91
|
+
* @returns The label with a superscript electron count.
|
|
92
|
+
*/
|
|
93
|
+
export declare function formatOccupancy(occupancy: SubshellOccupancy): string;
|
|
94
|
+
/**
|
|
95
|
+
* Write one subshell without its electron count, e.g. `3d`.
|
|
96
|
+
* @param subshell - The subshell.
|
|
97
|
+
* @returns The principal quantum number followed by the subshell letter.
|
|
98
|
+
*/
|
|
99
|
+
export declare function subshellLabel(subshell: Subshell): string;
|
|
100
|
+
/**
|
|
101
|
+
* Render a number in unicode superscript digits.
|
|
102
|
+
* @param value - A non-negative integer.
|
|
103
|
+
* @returns The digits as superscripts, e.g. `14` becomes `¹⁴`.
|
|
104
|
+
*/
|
|
105
|
+
export declare function superscript(value: number): string;
|
|
106
|
+
//# sourceMappingURL=electronConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"electronConfiguration.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/electronConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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AQ,GAAG,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMjD"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ground-state electron configurations, by the Aufbau principle and the twenty
|
|
3
|
+
* elements that ignore it.
|
|
4
|
+
*
|
|
5
|
+
* Subshells fill in Madelung order — increasing `n + ℓ`, and increasing `n`
|
|
6
|
+
* within a tie — which is why 4s fills before 3d. That rule gets 98 of the 118
|
|
7
|
+
* elements right; the rest are measured, not derived, and live in
|
|
8
|
+
* {@link ELEMENT_ANOMALIES}. Chromium is the canonical one: Aufbau predicts
|
|
9
|
+
* `[Ar]3d⁴4s²` and the atom is `[Ar]3d⁵4s¹`.
|
|
10
|
+
*
|
|
11
|
+
* Configurations are returned sorted by `n` then `ℓ`, the order a textbook
|
|
12
|
+
* writes them in — `[Ar]3d⁵4s¹`, not `[Ar]4s¹3d⁵`.
|
|
13
|
+
*/
|
|
14
|
+
import { subshellLetter } from "./realHarmonics.js";
|
|
15
|
+
/** No known element occupies a shell above n = 7. */
|
|
16
|
+
const MAXIMUM_PRINCIPAL_NUMBER = 7;
|
|
17
|
+
/** Protons in the heaviest element that has been made. */
|
|
18
|
+
export const HIGHEST_ATOMIC_NUMBER = 118;
|
|
19
|
+
/** The atomic numbers of the noble gases, which a configuration abbreviates on. */
|
|
20
|
+
export const NOBLE_GASES = [2, 10, 18, 36, 54, 86, 118];
|
|
21
|
+
/**
|
|
22
|
+
* Reject an atomic number outside the periodic table.
|
|
23
|
+
* @param atomicNumber - Proton count to check.
|
|
24
|
+
* @throws {Error} When it is not an integer between 1 and 118.
|
|
25
|
+
*/
|
|
26
|
+
export function assertAtomicNumber(atomicNumber) {
|
|
27
|
+
if (!Number.isInteger(atomicNumber) ||
|
|
28
|
+
atomicNumber < 1 ||
|
|
29
|
+
atomicNumber > HIGHEST_ATOMIC_NUMBER) {
|
|
30
|
+
throw new RangeError(`no element with atomic number ${atomicNumber}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Subshells in the order they fill, `s` to `f` and up to n = 7 — everything the
|
|
35
|
+
* 118 known elements use, plus the empty subshells a light atom's virtual
|
|
36
|
+
* orbitals come from.
|
|
37
|
+
*/
|
|
38
|
+
export const MADELUNG_ORDER = buildMadelungOrder();
|
|
39
|
+
/**
|
|
40
|
+
* How many electrons a subshell holds: `2(2ℓ + 1)`.
|
|
41
|
+
* @param l - Angular momentum quantum number.
|
|
42
|
+
* @returns The capacity, `2(2ℓ + 1)`.
|
|
43
|
+
*/
|
|
44
|
+
export function subshellCapacity(l) {
|
|
45
|
+
return 2 * (2 * l + 1);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The measured ground states that Madelung order gets wrong, as the occupancy
|
|
49
|
+
* beyond the preceding noble gas.
|
|
50
|
+
*
|
|
51
|
+
* Half-filled and filled d shells are unusually stable, which is the story for
|
|
52
|
+
* Cr, Cu, Mo, Ag, Au and Gd; the early actinides are relativistic and 6d/5f sit
|
|
53
|
+
* almost on top of each other. Configurations past lawrencium are calculated
|
|
54
|
+
* rather than observed, so nothing beyond Z = 103 is listed here.
|
|
55
|
+
*/
|
|
56
|
+
export const ELEMENT_ANOMALIES = {
|
|
57
|
+
24: [o(3, 2, 5), o(4, 0, 1)],
|
|
58
|
+
29: [o(3, 2, 10), o(4, 0, 1)],
|
|
59
|
+
41: [o(4, 2, 4), o(5, 0, 1)],
|
|
60
|
+
42: [o(4, 2, 5), o(5, 0, 1)],
|
|
61
|
+
44: [o(4, 2, 7), o(5, 0, 1)],
|
|
62
|
+
45: [o(4, 2, 8), o(5, 0, 1)],
|
|
63
|
+
46: [o(4, 2, 10)],
|
|
64
|
+
47: [o(4, 2, 10), o(5, 0, 1)],
|
|
65
|
+
57: [o(5, 2, 1), o(6, 0, 2)],
|
|
66
|
+
58: [o(4, 3, 1), o(5, 2, 1), o(6, 0, 2)],
|
|
67
|
+
64: [o(4, 3, 7), o(5, 2, 1), o(6, 0, 2)],
|
|
68
|
+
78: [o(4, 3, 14), o(5, 2, 9), o(6, 0, 1)],
|
|
69
|
+
79: [o(4, 3, 14), o(5, 2, 10), o(6, 0, 1)],
|
|
70
|
+
89: [o(6, 2, 1), o(7, 0, 2)],
|
|
71
|
+
90: [o(6, 2, 2), o(7, 0, 2)],
|
|
72
|
+
91: [o(5, 3, 2), o(6, 2, 1), o(7, 0, 2)],
|
|
73
|
+
92: [o(5, 3, 3), o(6, 2, 1), o(7, 0, 2)],
|
|
74
|
+
93: [o(5, 3, 4), o(6, 2, 1), o(7, 0, 2)],
|
|
75
|
+
96: [o(5, 3, 7), o(6, 2, 1), o(7, 0, 2)],
|
|
76
|
+
103: [o(5, 3, 14), o(7, 0, 2), o(7, 1, 1)],
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The ground-state configuration of a neutral atom.
|
|
80
|
+
* @param atomicNumber - Proton count, 1 to 118.
|
|
81
|
+
* @returns Its occupied subshells, sorted by `n` then `ℓ`.
|
|
82
|
+
* @throws {Error} When the atomic number is outside the table.
|
|
83
|
+
*/
|
|
84
|
+
export function configurationOf(atomicNumber) {
|
|
85
|
+
assertAtomicNumber(atomicNumber);
|
|
86
|
+
const anomaly = ELEMENT_ANOMALIES[atomicNumber];
|
|
87
|
+
if (anomaly === undefined)
|
|
88
|
+
return sortByShell(aufbauFill(atomicNumber));
|
|
89
|
+
const core = coreAtomicNumber(atomicNumber);
|
|
90
|
+
return sortByShell([
|
|
91
|
+
...aufbauFill(core),
|
|
92
|
+
...anomaly.map((entry) => ({ ...entry })),
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Whether an element's ground state departs from Madelung order.
|
|
97
|
+
* @param atomicNumber - Proton count.
|
|
98
|
+
* @returns True for the twenty listed in {@link ELEMENT_ANOMALIES}.
|
|
99
|
+
*/
|
|
100
|
+
export function isAnomalous(atomicNumber) {
|
|
101
|
+
return atomicNumber in ELEMENT_ANOMALIES;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* What Madelung order alone predicts, so the UI can show the two side by side.
|
|
105
|
+
* @param atomicNumber - Proton count, 1 to 118.
|
|
106
|
+
* @returns The predicted occupied subshells, sorted by `n` then `ℓ`.
|
|
107
|
+
*/
|
|
108
|
+
export function aufbauConfigurationOf(atomicNumber) {
|
|
109
|
+
return sortByShell(aufbauFill(atomicNumber));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The noble gas a configuration is abbreviated against.
|
|
113
|
+
* @param atomicNumber - Proton count.
|
|
114
|
+
* @returns The largest noble gas strictly below it, or 0 for hydrogen and
|
|
115
|
+
* helium, which are written out in full.
|
|
116
|
+
*/
|
|
117
|
+
export function coreAtomicNumber(atomicNumber) {
|
|
118
|
+
let core = 0;
|
|
119
|
+
for (const noble of NOBLE_GASES) {
|
|
120
|
+
if (noble >= atomicNumber)
|
|
121
|
+
break;
|
|
122
|
+
core = noble;
|
|
123
|
+
}
|
|
124
|
+
return core;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Write a configuration the way a textbook does.
|
|
128
|
+
* @param occupancies - Subshells to write, in the order they should appear.
|
|
129
|
+
* @returns A string such as `1s² 2s² 2p⁶`.
|
|
130
|
+
*/
|
|
131
|
+
export function formatConfiguration(occupancies) {
|
|
132
|
+
const parts = [];
|
|
133
|
+
for (const occupancy of occupancies)
|
|
134
|
+
parts.push(formatOccupancy(occupancy));
|
|
135
|
+
return parts.join(' ');
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Write one subshell, e.g. `3d⁵`.
|
|
139
|
+
* @param occupancy - The subshell and its electron count.
|
|
140
|
+
* @returns The label with a superscript electron count.
|
|
141
|
+
*/
|
|
142
|
+
export function formatOccupancy(occupancy) {
|
|
143
|
+
return `${subshellLabel(occupancy)}${superscript(occupancy.electrons)}`;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Write one subshell without its electron count, e.g. `3d`.
|
|
147
|
+
* @param subshell - The subshell.
|
|
148
|
+
* @returns The principal quantum number followed by the subshell letter.
|
|
149
|
+
*/
|
|
150
|
+
export function subshellLabel(subshell) {
|
|
151
|
+
return `${subshell.n}${subshellLetter(subshell.l)}`;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Render a number in unicode superscript digits.
|
|
155
|
+
* @param value - A non-negative integer.
|
|
156
|
+
* @returns The digits as superscripts, e.g. `14` becomes `¹⁴`.
|
|
157
|
+
*/
|
|
158
|
+
export function superscript(value) {
|
|
159
|
+
let text = '';
|
|
160
|
+
for (const digit of String(value)) {
|
|
161
|
+
text += SUPERSCRIPT_DIGITS[Number(digit)] ?? digit;
|
|
162
|
+
}
|
|
163
|
+
return text;
|
|
164
|
+
}
|
|
165
|
+
const SUPERSCRIPT_DIGITS = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
|
|
166
|
+
function o(n, l, electrons) {
|
|
167
|
+
return { n, l, electrons };
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Fill `count` electrons into {@link MADELUNG_ORDER}, lowest subshell first.
|
|
171
|
+
* @param count - Electrons to place.
|
|
172
|
+
* @returns The filled subshells, in Madelung order.
|
|
173
|
+
*/
|
|
174
|
+
function aufbauFill(count) {
|
|
175
|
+
const filled = [];
|
|
176
|
+
let left = count;
|
|
177
|
+
for (const subshell of MADELUNG_ORDER) {
|
|
178
|
+
if (left <= 0)
|
|
179
|
+
break;
|
|
180
|
+
const electrons = Math.min(left, subshellCapacity(subshell.l));
|
|
181
|
+
filled.push({ n: subshell.n, l: subshell.l, electrons });
|
|
182
|
+
left -= electrons;
|
|
183
|
+
}
|
|
184
|
+
return filled;
|
|
185
|
+
}
|
|
186
|
+
function sortByShell(occupancies) {
|
|
187
|
+
return occupancies.toSorted((first, second) => first.n === second.n ? first.l - second.l : first.n - second.n);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Madelung order: ascending `n + ℓ`, then ascending `n`. Capped at ℓ = 3 — the
|
|
191
|
+
* g subshells a Madelung diagram shows after 8s are unoccupied in every known
|
|
192
|
+
* element, and this site has no g harmonics to draw them with.
|
|
193
|
+
* @returns The subshells, in filling order.
|
|
194
|
+
*/
|
|
195
|
+
function buildMadelungOrder() {
|
|
196
|
+
const order = [];
|
|
197
|
+
for (let sum = 1; sum <= 10; sum++) {
|
|
198
|
+
for (let l = Math.min(3, Math.ceil(sum / 2) - 1); l >= 0; l--) {
|
|
199
|
+
const n = sum - l;
|
|
200
|
+
if (n > MAXIMUM_PRINCIPAL_NUMBER || n <= l)
|
|
201
|
+
continue;
|
|
202
|
+
order.push({ n, l });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return order;
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=electronConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"electronConfiguration.js","sourceRoot":"","sources":["../../../src/orbital/core/electronConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAcpD,qDAAqD;AACrD,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAsB,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,YAAoB;IACrD,IACE,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC;QAC/B,YAAY,GAAG,CAAC;QAChB,YAAY,GAAG,qBAAqB,EACpC,CAAC;QACD,MAAM,IAAI,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AC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAC5C,KAAK,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAC/D,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB;IACzB,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;QACnC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9D,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YAClB,IAAI,CAAC,GAAG,wBAAwB,IAAI,CAAC,IAAI,CAAC;gBAAE,SAAS;YACrD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
import type { Vec3 } from './constants.ts';
|
|
10
|
+
/** An axis-aligned sampling box, ångström. */
|
|
11
|
+
export interface GridBox {
|
|
12
|
+
/** Lowest corner. */
|
|
13
|
+
origin: Vec3;
|
|
14
|
+
/** Edge lengths along x, y and z. */
|
|
15
|
+
size: Vec3;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A wavefunction, sampled at one point.
|
|
19
|
+
* @param x - Offset from the origin along x, ångström.
|
|
20
|
+
* @param y - Offset along y.
|
|
21
|
+
* @param z - Offset along z.
|
|
22
|
+
* @returns The amplitude, Å^(-3/2).
|
|
23
|
+
*/
|
|
24
|
+
export type OrbitalEvaluator = (x: number, y: number, z: number) => number;
|
|
25
|
+
/** A sampled scalar field plus the statistics an isovalue is chosen from. */
|
|
26
|
+
export interface OrbitalGrid {
|
|
27
|
+
/** `nx·ny·nz` samples, z varying fastest. */
|
|
28
|
+
data: Float32Array;
|
|
29
|
+
/** `[nx, ny, nz]`. */
|
|
30
|
+
dimensions: [number, number, number];
|
|
31
|
+
/** Position of sample `(0, 0, 0)`, ångström. */
|
|
32
|
+
origin: Vec3;
|
|
33
|
+
/** Distance between neighbouring samples on every axis, ångström. */
|
|
34
|
+
spacing: number;
|
|
35
|
+
min: number;
|
|
36
|
+
max: number;
|
|
37
|
+
mean: number;
|
|
38
|
+
/** Population standard deviation of the samples. */
|
|
39
|
+
sigma: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Sample a wavefunction over a box.
|
|
43
|
+
* @param evaluate - the wavefunction, cartesian ångström in, amplitude out.
|
|
44
|
+
* @param box - the region to cover.
|
|
45
|
+
* @param resolution - samples along the longest edge; the spacing it implies is
|
|
46
|
+
* used on all three axes, so the voxels stay cubic.
|
|
47
|
+
* @returns the field, its layout and its single-pass statistics.
|
|
48
|
+
* @throws {Error} when `resolution` is below 2 or the box has no volume.
|
|
49
|
+
*/
|
|
50
|
+
export declare function evaluateGrid(evaluate: OrbitalEvaluator, box: GridBox, resolution: number): OrbitalGrid;
|
|
51
|
+
/**
|
|
52
|
+
* Flat offset of a sample, the layout molstar expects.
|
|
53
|
+
* @param dimensions - `[nx, ny, nz]` of the grid.
|
|
54
|
+
* @param indexX - sample index along x.
|
|
55
|
+
* @param indexY - sample index along y.
|
|
56
|
+
* @param indexZ - sample index along z, the fastest-varying axis.
|
|
57
|
+
* @returns the index into {@link OrbitalGrid.data}.
|
|
58
|
+
*/
|
|
59
|
+
export declare function gridIndex(dimensions: [number, number, number], indexX: number, indexY: number, indexZ: number): number;
|
|
60
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/grid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,8CAA8C;AAC9C,MAAM,WAAW,OAAO;IACtB,qBAAqB;IACrB,MAAM,EAAE,IAAI,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAE3E,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,IAAI,EAAE,YAAY,CAAC;IACnB,sBAAsB;IACtB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,gDAAgD;IAChD,MAAM,EAAE,IAAI,CAAC;IACb,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,MAAM,GACjB,WAAW,CA8Cb;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,MAAM,CAER"}
|