sci-form-wasm 2.3.0 → 3.0.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 CHANGED
@@ -9,11 +9,11 @@ Native bindings for **Rust**, **Python**, **TypeScript/JavaScript (WASM)**, and
9
9
  [![crates.io](https://img.shields.io/crates/v/sci-form)](https://crates.io/crates/sci-form)
10
10
  [![PyPI](https://img.shields.io/pypi/v/sciforma)](https://pypi.org/project/sciforma)
11
11
  [![npm](https://img.shields.io/npm/v/sci-form-wasm)](https://www.npmjs.com/package/sci-form-wasm)
12
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
12
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/jigonzalez930209/sci-form/blob/main/LICENSE)
13
13
 
14
- See also: [CHANGELOG.md](CHANGELOG.md) · [**Migrating to 2.0**](docs/guide/migration-2.0.md) · [Migrating to 1.0 (historical)](docs/guide/migration-1.0.md) · [Release checklist](docs/release-checklist-2.3.md) · [TESTING.md](TESTING.md) · [Roadmap: v2.x feature roadmap](docs/v2-roadmap.md) · [Dynamics & reactivity](docs/dynamics_reactivity_roadmap.md)
14
+ See also: [CHANGELOG.md](https://github.com/jigonzalez930209/sci-form/blob/main/CHANGELOG.md) · [**Migrating to 2.0**](https://jigonzalez930209.github.io/sci-form/guide/migration-2.0) · [Migrating to 1.0 (historical)](https://jigonzalez930209.github.io/sci-form/guide/migration-1.0) · [Release checklist](https://jigonzalez930209.github.io/sci-form/release-checklist-2.3) · [TESTING.md](https://github.com/jigonzalez930209/sci-form/blob/main/TESTING.md) · [Roadmap: v2.x feature roadmap](https://jigonzalez930209.github.io/sci-form/v2-roadmap) · [Dynamics & reactivity](https://jigonzalez930209.github.io/sci-form/dynamics_reactivity_roadmap) · [Maturity roadmap](https://github.com/jigonzalez930209/sci-form/blob/main/docs/maturity-roadmap.md)
15
15
 
16
- > **Status: 2.3.0 — stable CLI/API plus the complete v2 alpha-inclusive release.**
16
+ > **Status: 3.0.0 — modular Stage 4 workspace, analytic xTB gradients, standard IO and lightweight WASM.**
17
17
  > The 2.0 baseline removed panics on malformed input and made force-field
18
18
  > results reproducible. 2.1 promoted GCMC, reaction networks and kMC to core;
19
19
  > 2.2 promoted enhanced sampling and active learning. 2.3 ships all three v2
@@ -21,10 +21,34 @@ See also: [CHANGELOG.md](CHANGELOG.md) · [**Migrating to 2.0**](docs/guide/migr
21
21
  > FEP/BAR/MBAR, metadynamics/OPES, 3D-RISM, all-nuclide NMR, periodic
22
22
  > KPM/RandNLA adapters and conformal active learning. The candidates that have
23
23
  > not passed their L3/L4 promotion gate remain clearly labelled experimental;
24
- > see the [2.3 release checklist](docs/release-checklist-2.3.md). Read the [2.0 migration guide](docs/guide/migration-2.0.md) before
25
- > upgrading from 1.x; the [1.0 guide](docs/guide/migration-1.0.md) remains for
24
+ > see the [2.3 release checklist](https://jigonzalez930209.github.io/sci-form/release-checklist-2.3). Read the [2.0 migration guide](https://jigonzalez930209.github.io/sci-form/guide/migration-2.0) before
25
+ > upgrading from 1.x; the [1.0 guide](https://jigonzalez930209.github.io/sci-form/guide/migration-1.0) remains for
26
26
  > the 0.15 → 1.0 step.
27
27
 
28
+ ## Stage 4 workspace (v3.0, `dev`)
29
+
30
+ The Stage 4 architecture is in place: the library is now a Cargo workspace with
31
+ `sci-form-core`, `sci-form-conformer`, `sci-form-ff`, `sci-form-qm`,
32
+ `sci-form-spectroscopy`, `sci-form-dynamics` and the `sci-form` facade. The
33
+ facade preserves every previous `sci_form::*` path, while lightweight tools can
34
+ depend on a single sub-crate. Stage 4 also adds SDF/PDB/mmCIF/extended-XYZ/
35
+ QCSchema IO, SHA-256-verified external-weight MLIP loading, the one-SCC xTB
36
+ gradient engine, typed-array WASM hot paths and the 139 KB
37
+ `@sci-form/conformer` bundle.
38
+
39
+ See [docs/stage-4-implementation.md](docs/stage-4-implementation.md) for the
40
+ subtask-by-subtask report and reproducible commands.
41
+
42
+ ## Stability Matrix
43
+
44
+ | Tier | Feature Flag | Subsystems | Guarantee |
45
+ | :--- | :--- | :--- | :--- |
46
+ | **Stable** | *(default)* | ETKDG, UFF/MMFF94, EHT, PM3, GFN0/1/2-xTB, HF-3c, UHF/ROHF, CISD, EEQ, D3/D4, SASA, ALPB, CPM, EDL, IR/NMR/sTDA, SMIRKS, CIF/Materials | Production APIs cross-validated against RDKit / PySCF / MOPAC / tblite |
47
+ | **Beta** | *(core / `beta-*`)* | KPM, RandNLA, Riemannian PSD, MBH (`beta-mbh`), CGA, SDR, GSM, Kinetics, Live MD | Validated against external oracles; API stable within minor versions |
48
+ | **Experimental** | `experimental-ani`, `experimental-gpu`, `alpha-*` | ANI-2x/ANI-TM (`experimental-ani`, test weights only), wgpu GPU (`experimental-gpu`), v2 research (`alpha-*`) | Opt-in only; not included in default build |
49
+
50
+ See the full [Stability Matrix](docs/guide/stability-matrix.md) for per-module accuracy and valid use cases.
51
+
28
52
  ## Features
29
53
 
30
54
  ### Conformer Generation
@@ -122,7 +146,7 @@ See also: [CHANGELOG.md](CHANGELOG.md) · [**Migrating to 2.0**](docs/guide/migr
122
146
  [dependencies]
123
147
  sci-form = "1.0"
124
148
  # For parallel batch + ESP:
125
- sci-form = { version = "2.3", features = ["parallel"] }
149
+ sci-form = { version = "3.0", features = ["parallel"] }
126
150
  ```
127
151
 
128
152
  ```rust
@@ -361,7 +385,7 @@ Current verified results on this repository state:
361
385
  | `cargo test --test regression test_experimental_comparison` | **54 passed, 0 failed** |
362
386
  | `cargo test --test regression test_extended_molecules` | **14 passed, 0 failed, 7 ignored** |
363
387
 
364
- More detailed coverage notes live in [TESTING.md](TESTING.md), and the broader project plan lives in the [documentation site](docs/index.md).
388
+ More detailed coverage notes live in [TESTING.md](https://github.com/jigonzalez930209/sci-form/blob/main/TESTING.md), and the broader project plan lives in the [documentation site](https://jigonzalez930209.github.io/sci-form/).
365
389
 
366
390
  ---
367
391
 
@@ -410,7 +434,7 @@ More detailed coverage notes live in [TESTING.md](TESTING.md), and the broader p
410
434
  | `sci_form::compute_rmsd` | RMSD after Kabsch alignment |
411
435
  | `sci_form::compute_pm3` | PM3/PM3(tm) semi-empirical SCF |
412
436
  | `sci_form::compute_xtb` | xTB tight binding — runs GFN2-xTB (same numbers as `compute_gfn2`) |
413
- | `sci_form::compute_pm3_gradient` / `compute_xtb_gradient` | Energy gradients (eV/Å): PM3 stationary-density (Pulay-free, no SCF per displacement), xTB warm-started central differences |
437
+ | `sci_form::compute_pm3_gradient` / `compute_xtb_gradient` | Energy gradients (eV/Å): PM3 stationary-density (Pulay-free, no SCF per displacement), GFN2 analytic fixed-density gradient |
414
438
  | `sci_form::compute_uhf` | Unrestricted Hartree-Fock SCF |
415
439
  | `sci_form::compute_rohf` | Restricted open-shell Hartree-Fock SCF |
416
440
  | `sci_form::compute_uff_energy` | UFF force field energy evaluation |
@@ -525,11 +549,11 @@ This updates versions in:
525
549
  - `crates/wasm/pkg/package.json`
526
550
  - `pkg/package.json` & `pkg-node/package.json`
527
551
 
528
- Then creates a `vX.Y.Z` git tag, which triggers the [release workflow](.github/workflows/release.yml) to publish to **crates.io**, **PyPI**, and **npm** automatically.
552
+ Then creates a `vX.Y.Z` git tag, which triggers the [release workflow](https://github.com/jigonzalez930209/sci-form/blob/main/.github/workflows/release.yml) to publish to **crates.io**, **PyPI**, and **npm** automatically.
529
553
 
530
554
  The workflow refuses to publish a tag that does not match the manifest
531
555
  versions, so a mismatch fails fast instead of shipping mislabelled artefacts.
532
- Before tagging, walk through the [release checklist](docs/release-checklist-2.3.md).
556
+ Before tagging, walk through the [release checklist](https://jigonzalez930209.github.io/sci-form/release-checklist-2.3).
533
557
  The local gate builds the test binaries once and runs them in a bounded pool
534
558
  (`SCI_FORM_TEST_JOBS`, default 8, x `SCI_FORM_TEST_THREADS`, default 3); set it to 1 to reproduce the historical
535
559
  serial execution.
@@ -70,6 +70,151 @@ export class LiveSimulation {
70
70
  temperature(): number;
71
71
  }
72
72
 
73
+ /**
74
+ * Typed EHT result.
75
+ */
76
+ export class TypedEht {
77
+ private constructor();
78
+ free(): void;
79
+ [Symbol.dispose](): void;
80
+ /**
81
+ * MO coefficients, row-major `[ao * n_mo + mo]`.
82
+ */
83
+ readonly coefficients: Float64Array;
84
+ /**
85
+ * Orbital energies in eV, ascending.
86
+ */
87
+ readonly energies: Float64Array;
88
+ /**
89
+ * HOMO-LUMO gap in eV.
90
+ */
91
+ readonly gap: number;
92
+ /**
93
+ * HOMO energy in eV.
94
+ */
95
+ readonly homo_energy: number;
96
+ /**
97
+ * LUMO energy in eV.
98
+ */
99
+ readonly lumo_energy: number;
100
+ /**
101
+ * Number of basis functions (rows in `coefficients`).
102
+ */
103
+ readonly n_basis: number;
104
+ /**
105
+ * Number of valence electrons.
106
+ */
107
+ readonly n_electrons: number;
108
+ }
109
+
110
+ /**
111
+ * Typed embedding result: coordinates plus element numbers.
112
+ */
113
+ export class TypedEmbedding {
114
+ private constructor();
115
+ free(): void;
116
+ [Symbol.dispose](): void;
117
+ /**
118
+ * Flat coordinates `[x0,y0,z0,...]` in Å.
119
+ */
120
+ readonly coords: Float64Array;
121
+ /**
122
+ * Atomic numbers in atom order.
123
+ */
124
+ readonly elements: Uint8Array;
125
+ /**
126
+ * Number of atoms.
127
+ */
128
+ readonly num_atoms: number;
129
+ }
130
+
131
+ /**
132
+ * Typed force-field result: energy and Cartesian gradient.
133
+ */
134
+ export class TypedForceField {
135
+ private constructor();
136
+ free(): void;
137
+ [Symbol.dispose](): void;
138
+ /**
139
+ * Energy in kcal/mol.
140
+ */
141
+ readonly energy: number;
142
+ /**
143
+ * Flat gradient `[gx0,gy0,gz0,...]` in kcal/mol/Å.
144
+ */
145
+ readonly gradients: Float64Array;
146
+ }
147
+
148
+ /**
149
+ * Typed MD trajectory: all frames flattened into typed arrays.
150
+ */
151
+ export class TypedTrajectory {
152
+ private constructor();
153
+ free(): void;
154
+ [Symbol.dispose](): void;
155
+ /**
156
+ * Flat coordinates `[frame][atom][xyz]`.
157
+ */
158
+ readonly coords: Float64Array;
159
+ /**
160
+ * Timestep in femtoseconds.
161
+ */
162
+ readonly dt_fs: number;
163
+ /**
164
+ * Potential energy per frame in kcal/mol.
165
+ */
166
+ readonly energies: Float64Array;
167
+ /**
168
+ * Number of atoms per frame.
169
+ */
170
+ readonly n_atoms: number;
171
+ /**
172
+ * Number of frames.
173
+ */
174
+ readonly n_frames: number;
175
+ /**
176
+ * Temperature per frame in K.
177
+ */
178
+ readonly temperatures: Float64Array;
179
+ }
180
+
181
+ /**
182
+ * Typed xTB result: energies, charges and optional gradient.
183
+ */
184
+ export class TypedXtb {
185
+ private constructor();
186
+ free(): void;
187
+ [Symbol.dispose](): void;
188
+ /**
189
+ * Whether the SCC converged.
190
+ */
191
+ readonly converged: boolean;
192
+ /**
193
+ * Electronic energy in eV.
194
+ */
195
+ readonly electronic_energy: number;
196
+ /**
197
+ * Flat gradient in eV/Å; empty when the caller requested energy only.
198
+ */
199
+ readonly gradients: Float64Array;
200
+ /**
201
+ * Mulliken charges in e.
202
+ */
203
+ readonly mulliken_charges: Float64Array;
204
+ /**
205
+ * Orbital energies in eV.
206
+ */
207
+ readonly orbital_energies: Float64Array;
208
+ /**
209
+ * Repulsive energy in eV.
210
+ */
211
+ readonly repulsive_energy: number;
212
+ /**
213
+ * Total energy in eV.
214
+ */
215
+ readonly total_energy: number;
216
+ }
217
+
73
218
  /**
74
219
  * Propose active-learning labels from a JSON request.
75
220
  */
@@ -1073,6 +1218,11 @@ export function compute_md_trajectory_nvt(smiles: string, coords_json: string, n
1073
1218
  */
1074
1219
  export function compute_md_trajectory_nvt_seed64(smiles: string, coords_json: string, n_steps: number, dt_fs: number, seed: bigint, target_temp_k: number, thermostat_tau_fs: number): string;
1075
1220
 
1221
+ /**
1222
+ * Run NVT UFF dynamics and return all frames as typed arrays.
1223
+ */
1224
+ export function compute_md_trajectory_nvt_typed(smiles: string, coords: Float64Array, n_steps: number, dt_fs: number, seed: bigint, target_temp_k: number, thermostat_tau_fs: number): TypedTrajectory;
1225
+
1076
1226
  /**
1077
1227
  * Run short NVE molecular dynamics with UFF force field, 64-bit seed.
1078
1228
  *
@@ -1080,6 +1230,11 @@ export function compute_md_trajectory_nvt_seed64(smiles: string, coords_json: st
1080
1230
  */
1081
1231
  export function compute_md_trajectory_seed64(smiles: string, coords_json: string, n_steps: number, dt_fs: number, seed: bigint): string;
1082
1232
 
1233
+ /**
1234
+ * Run NVE UFF dynamics and return all frames as typed arrays.
1235
+ */
1236
+ export function compute_md_trajectory_typed(smiles: string, coords: Float64Array, n_steps: number, dt_fs: number, seed: bigint): TypedTrajectory;
1237
+
1083
1238
  /**
1084
1239
  * Run velocity-Verlet MD with a configurable energy backend.
1085
1240
  *
@@ -1127,6 +1282,11 @@ export function compute_mmff94_energy(smiles: string, coords: string): string;
1127
1282
  */
1128
1283
  export function compute_mmff94_energy_breakdown(smiles: string, coords: string): string;
1129
1284
 
1285
+ /**
1286
+ * Compute MMFF94 energy from a `Float64Array` coordinate buffer (no JSON).
1287
+ */
1288
+ export function compute_mmff94_energy_typed(smiles: string, coords: Float64Array): number;
1289
+
1130
1290
  /**
1131
1291
  * Compute molecular descriptors from SMILES.
1132
1292
  *
@@ -1393,6 +1553,14 @@ export function compute_trajectory_chart(smiles: string, reactant_coords_json: s
1393
1553
  */
1394
1554
  export function compute_uff_energy(smiles: string, coords: string): string;
1395
1555
 
1556
+ /**
1557
+ * Compute UFF energy and its analytic gradient in one pass.
1558
+ *
1559
+ * Returns a [`crate::typed::TypedForceField`] whose `gradients` getter is a
1560
+ * `Float64Array` in kcal/mol/Å.
1561
+ */
1562
+ export function compute_uff_energy_and_gradient_typed(smiles: string, coords: Float64Array): TypedForceField;
1563
+
1396
1564
  /**
1397
1565
  * Per-term-type UFF energy breakdown (kcal/mol).
1398
1566
  *
@@ -1402,6 +1570,11 @@ export function compute_uff_energy(smiles: string, coords: string): string;
1402
1570
  */
1403
1571
  export function compute_uff_energy_breakdown(smiles: string, coords: string): string;
1404
1572
 
1573
+ /**
1574
+ * Compute UFF energy from a `Float64Array` coordinate buffer (no JSON).
1575
+ */
1576
+ export function compute_uff_energy_typed(smiles: string, coords: Float64Array): number;
1577
+
1405
1578
  /**
1406
1579
  * Compute UFF energy with aromaticity-informed heuristic correction metadata.
1407
1580
  */
@@ -1461,6 +1634,15 @@ export function compute_xtb(elements_json: string, coords_flat_json: string): st
1461
1634
  */
1462
1635
  export function compute_xtb_gradient(elements_json: string, coords_flat_json: string): string;
1463
1636
 
1637
+ /**
1638
+ * Compute xTB and return typed energy, charges and optional gradient.
1639
+ *
1640
+ * When `with_gradient` is true the analytic gradient is evaluated as well and
1641
+ * exposed through the `gradients` getter (eV/Å). Without it the call is
1642
+ * energy-only and the gradient array is empty.
1643
+ */
1644
+ export function compute_xtb_typed(elements: Uint8Array, coords: Float64Array, with_gradient: boolean): TypedXtb;
1645
+
1464
1646
  /**
1465
1647
  * Fit a split-conformal calibration radius.
1466
1648
  */
@@ -1498,6 +1680,11 @@ export function discover_template_network(config_json: string): string;
1498
1680
  */
1499
1681
  export function eht_calculate(elements: string, coords_flat: string, k: number): string;
1500
1682
 
1683
+ /**
1684
+ * Solve EHT from typed buffers and return typed orbital arrays.
1685
+ */
1686
+ export function eht_calculate_typed(elements: Uint8Array, coords: Float64Array, k: number): TypedEht;
1687
+
1501
1688
  /**
1502
1689
  * Run EHT or route to UFF fallback based on support/confidence.
1503
1690
  */
@@ -1614,6 +1801,20 @@ export function embed_diverse(smiles: string, n_conformers: number, rmsd_cutoff:
1614
1801
  */
1615
1802
  export function embed_seed64(smiles: string, seed: bigint): string;
1616
1803
 
1804
+ /**
1805
+ * Generate a conformer and return typed buffers (no JSON).
1806
+ *
1807
+ * Coordinates are a `Float64Array`, elements a `Uint8Array`. This is the
1808
+ * JSON-free counterpart of [`embed`] and is bit-identical to it for the same
1809
+ * SMILES and seed.
1810
+ */
1811
+ export function embed_typed(smiles: string, seed: bigint): TypedEmbedding;
1812
+
1813
+ /**
1814
+ * 32-bit-seed variant of [`embed_typed`].
1815
+ */
1816
+ export function embed_typed_seed32(smiles: string, seed: number): TypedEmbedding;
1817
+
1617
1818
  /**
1618
1819
  * Estimate an alchemical free-energy difference from JSON samples.
1619
1820
  */