sci-form-wasm 0.15.2 → 2.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
@@ -11,7 +11,15 @@ Native bindings for **Rust**, **Python**, **TypeScript/JavaScript (WASM)**, and
11
11
  [![npm](https://img.shields.io/npm/v/sci-form-wasm)](https://www.npmjs.com/package/sci-form-wasm)
12
12
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
13
13
 
14
- See also: [CHANGELOG.md](CHANGELOG.md) · [TESTING.md](TESTING.md) · [ROADMAP_REACTION_DYNAMICS_3D.md](ROADMAP_REACTION_DYNAMICS_3D.md)
14
+ See also: [CHANGELOG.md](CHANGELOG.md) · [**Migrating to 1.0**](docs/guide/migration-1.0.md) · [Release checklist](docs/release-checklist-1.0.md) · [TESTING.md](TESTING.md) · [Roadmap: dynamics & reactivity](docs/dynamics_reactivity_roadmap.md)
15
+
16
+ > **Status: 2.0.0 — complete MMFF94, typed errors and promoted core modules.**
17
+ > The library no longer panics on malformed input, the force-field results are
18
+ > bit-for-bit reproducible regardless of the machine's core count, and every
19
+ > public item is documented. Read the [migration guide](docs/guide/migration-1.0.md)
20
+ > before upgrading from 0.15.x: the functions that can fail now return a
21
+ > `Result`, and the canonical name of every capability is the Rust root name
22
+ > in all four surfaces.
15
23
 
16
24
  ## Features
17
25
 
@@ -40,9 +48,10 @@ See also: [CHANGELOG.md](CHANGELOG.md) · [TESTING.md](TESTING.md) · [ROADMAP_R
40
48
  - **AO→MO Integral Transform** — 4-index integral transform with 4-fold symmetry for post-HF methods
41
49
 
42
50
  ### Spectroscopy
43
- - **UV-Vis** — sTDA-xTB vertical excitations, Gaussian/Lorentzian broadening
44
- - **IR** — Numerical Hessian vibrational analysis, dipole intensities, thermochemistry (RRHO), peak assignment
45
- - **NMR** — Chemical shifts via HOSE codes, J-coupling (Karplus 2J–5J including long-range), ensemble averaging
51
+ - **UV-Vis** — sTDA vertical excitations on EHT orbitals, Gaussian/Lorentzian broadening
52
+ - **Fluorescence** — Kasha emission from those singlets, spontaneous-emission lineshape, Einstein A lifetime
53
+ - **IR** — Numerical Hessian vibrational analysis, dipole intensities, thermochemistry (RRHO), peak assignment; atomic masses through Z = 103
54
+ - **NMR** — Chemical shifts via HOSE codes for NMR-active nuclei including metals (Ce omitted, I = 0), J-coupling (Karplus 2J–5J including long-range), ensemble averaging
46
55
 
47
56
  ### Machine Learning
48
57
  - **ANI-2x / ANI-TM** — Neural network potentials with analytical gradients (24 elements including transition metals)
@@ -54,8 +63,8 @@ See also: [CHANGELOG.md](CHANGELOG.md) · [TESTING.md](TESTING.md) · [ROADMAP_R
54
63
  - **Isolated `experimental_2` namespace** — next-generation Roothaan-Hall RHF engine without affecting stable APIs
55
64
  - **Analytical Gaussian integrals** — overlap, kinetic, nuclear attraction, core Hamiltonian, and two-electron ERIs
56
65
  - **SCF with DIIS + parallel ERI** — deterministic RHF/STO-3G workflow with rayon acceleration for the expensive $O(N^4)$ step
57
- - **Experimental spectroscopy stack** — prototype sTDA UV-Vis, GIAO-like NMR shielding, and semi-numerical IR/Hessian workflows
58
- - **GPU-oriented architecture** — WGSL shader stubs, orbital grid evaluation, and marching-cubes rendering pipeline prepared for future `wgpu` enablement
66
+ - **Spectroscopy stack** — sTDA UV-Vis, GIAO-like NMR shielding and semi-numerical IR/Hessian workflows, gated against external references
67
+ - **GPU architecture** — real WGSL kernels for ERI, Fock, gamma, orbital/density grids, ESP, EEQ, CPM, HTST, periodic Bloch and EDL, with 11 GPU↔CPU parity gates
59
68
 
60
69
  ### Electrostatics & Surface
61
70
  - **Electrostatic Potential (ESP)** — Coulomb grid from Mulliken charges, color mapping (red/white/blue), `.cube` export
@@ -71,7 +80,7 @@ See also: [CHANGELOG.md](CHANGELOG.md) · [TESTING.md](TESTING.md) · [ROADMAP_R
71
80
 
72
81
  ### Force Fields
73
82
  - **UFF** — Universal Force Field for 50+ element types (including transition metals Ti–Zn, Pd, Pt, Au)
74
- - **MMFF94** — Merck force field (stretch, bend, torsion, van der Waals, electrostatics via 14-7 potential)
83
+ - **MMFF94** — Merck force field, complete energy: stretch, bend, stretch-bend, out-of-plane, torsion, buffered 14-7 van der Waals and buffered Coulomb electrostatics with PBCI/BCI partial charges
75
84
  - **BFGS / L-BFGS minimizers** — dense BFGS for small molecules, L-BFGS for large systems
76
85
 
77
86
  ### Molecular Alignment
@@ -99,9 +108,9 @@ See also: [CHANGELOG.md](CHANGELOG.md) · [TESTING.md](TESTING.md) · [ROADMAP_R
99
108
 
100
109
  ```toml
101
110
  [dependencies]
102
- sci-form = "0.13"
111
+ sci-form = "1.0"
103
112
  # For parallel batch + ESP:
104
- sci-form = { version = "0.13", features = ["parallel"] }
113
+ sci-form = { version = "2.0", features = ["parallel"] }
105
114
  ```
106
115
 
107
116
  ```rust
@@ -165,6 +174,24 @@ dos = sci_form.compute_dos(elements, positions, sigma=0.2, e_min=-20.0, e_max=5.
165
174
  print(f"Gap: {dos['homo_lumo_gap']:.3f} eV")
166
175
  ```
167
176
 
177
+ #### Zero-copy arrays
178
+
179
+ `embed_coords_into` and `compute_esp_grid_into` write their result straight
180
+ into a caller-owned `float64` buffer, so a full volumetric grid or a long MD
181
+ trajectory never crosses the Python boundary twice:
182
+
183
+ ```python
184
+ import array
185
+ import sci_form
186
+
187
+ n_atoms = sci_form.parse("CCO").num_atoms
188
+ buf = array.array("d", [0.0] * (3 * n_atoms))
189
+ sci_form.embed_coords_into("CCO", buf, seed=42) # buf now holds the coords
190
+ ```
191
+
192
+ Both functions raise `ValueError` when the buffer has the wrong length, and
193
+ they refuse a read-only or non-`float64` buffer.
194
+
168
195
  → [Full Python API reference](https://jigonzalez930209.github.io/sci-form/api/python) · [Guide](https://jigonzalez930209.github.io/sci-form/guide/python)
169
196
 
170
197
  ---
@@ -213,10 +240,30 @@ const dos = JSON.parse(compute_dos('[6,8,6,1,1,1,1,1,1]', coords.toString(), 0.2
213
240
 
214
241
  ---
215
242
 
243
+ ### Live examples
244
+
245
+ One runnable example for every function of the JavaScript API, computed in your browser with the compiled WebAssembly package: **[sci-form docs → live examples](https://jigonzalez930209.github.io/sci-form/guide/live-examples)**.
246
+
216
247
  ### CLI
217
248
 
249
+ Download the package for your system from the [latest release](https://github.com/jigonzalez930209/sci-form/releases/latest):
250
+
251
+ | System | Package | Install |
252
+ |---|---|---|
253
+ | Debian / Ubuntu | `sci-form_<version>_amd64.deb` / `arm64` | `sudo apt install ./sci-form_*.deb` |
254
+ | Fedora / RHEL | `sci-form-<version>.x86_64.rpm` / `aarch64` | `sudo dnf install ./sci-form-*.rpm` |
255
+ | Linux (any) | `sci-form-<version>-x86_64-unknown-linux-gnu.tar.gz` / `aarch64` | unpack, put `sci-form` on your `PATH` |
256
+ | macOS | `…-aarch64-apple-darwin.tar.gz` (Apple Silicon) / `…-x86_64-apple-darwin.tar.gz` | unpack, put `sci-form` on your `PATH` |
257
+ | Windows | `…-x86_64-pc-windows-msvc.zip` | unpack, add the folder to `PATH` |
258
+
259
+ or from source: `cargo install sci-form-cli`. Each release carries a `SHA256SUMS` file.
260
+
218
261
  ```bash
219
- cargo install sci-form-cli
262
+ sci-form # a short guide with examples
263
+ sci-form commands # every command, grouped by topic
264
+ sci-form examples pm3 --run # a ready-to-run example, with its output
265
+ sci-form help pm3 # every option of one command
266
+ sci-form completions bash # shell completion (bash, zsh, fish, powershell)
220
267
  ```
221
268
 
222
269
  ```bash
@@ -261,18 +308,20 @@ The repository now includes an isolated experimental quantum-chemistry stack und
261
308
 
262
309
  | Phase | Status | Scope |
263
310
  |------|--------|-------|
264
- | Phase 1 | Complete | GPU infrastructure scaffolding, aligned types, CPU fallback, WGSL interface stubs |
311
+ | Phase 1 | Complete | GPU infrastructure, aligned types, CPU fallback, real WGSL compute kernels |
265
312
  | Phase 2 | Complete | Gaussian basis, overlap/kinetic/nuclear/core matrices, ERIs, validation helpers |
266
313
  | Phase 3 | Complete | RHF SCF loop, Löwdin orthogonalization, DIIS, Mulliken analysis, gradients, optimizer, parallel ERI |
267
- | Phase 4 | Prototype complete | Experimental sTDA UV-Vis, GIAO-style NMR shielding, Hessian/IR workflows |
268
- | Phase 5 | Prototype complete | Orbital grid evaluation, marching cubes, isosurface generation, GPU-ready rendering path |
314
+ | Phase 4 | Complete (gated) | sTDA UV-Vis, GIAO-style NMR shielding, Hessian/IR workflows |
315
+ | Phase 5 | Complete | Orbital grid evaluation, marching cubes, isosurface generation, GPU mesh path |
269
316
 
270
317
  ### Current Practical Status
271
318
 
272
- - Stable production APIs remain unchanged; the experimental work is isolated in `experimental_2`
319
+ - Stable production APIs remain unchanged; the experimental work is isolated behind `experimental_*` feature flags
273
320
  - Real acceleration today is CPU parallelism via rayon in the ERI build path
274
- - GPU execution is not enabled yet; `phase1_gpu_infrastructure` currently exposes a CPU fallback plus WGSL-ready interfaces
275
- - The main known scientific limitation is absolute RHF/STO-3G total energy scaling in the experimental engine; comparative gaps and regression behavior are the primary validation target today
321
+ - GPU execution is available through the `experimental-gpu` feature (wgpu/Vulkan with a CPU fallback); the numerical paths stay gated against the CPU reference
322
+ - The cross-library validation campaign gates the quantum-chemistry stack against external references (RDKit, PySCF, tblite, xtb, dftd4/s-dftd3, multicharge, pormake, YAeHMOP, MOPAC, LAMMPS, scipy, ASE, clifford, CVXPY, jsonschema): 38 active tests in `tests/cross_validation.rs`, all green (the release-profile Rust suite is green: 1038 library tests with the CI feature set as of 2026-11-08). Completed 2026-10-13: PM3 exact on 24/24 MOPAC molecules, unrestricted GFN1/GFN2 (UKS) vs tblite `uhf`, torsional/inversion barriers vs literature, CPM vs LAMMPS `electrode/conp`, ReaxFF bond orders vs LAMMPS `reaxff`. Completed 2026-10-14 (second campaign, 44 gates in `tests/{alpha,beta}_*_validation.rs`): KS-DFT vs PySCF, BP symmetry functions, Boys/ERI vs libcint, CGA motors vs clifford, GSM string vs ASE CI-NEB, SDR vs CVXPY, live-dynamics UFF forces vs RDKit, IMD steering, EDL analytics, HTST/microkinetics, periodic meshes/Bloch, chart schemas, KPM/Mulliken, MBH harmonics, randomized Nyström, PSD Riemannian optimizer. The 1.1 follow-up adds dedicated gates for complete MMFF94 vs RDKit (F100, <3e-11 kcal/mol), ReaxFF analytical gradients, ERI Cholesky, typed root-API errors and the RandNLA N>500 low-rank path.
323
+ - Known documented limitations: PM3 convergence on long alkanes, CISD excited states are not size-consistent, transition-metal EHT parameters are validated against the literature table but not against experiment, HLA J-couplings cover C/S/N/Cl substituents in the general form, CPM electrode response is within 2.5x of LAMMPS (point-charge hardness vs Gaussian self-energy), ReaxFF total energies exclude H2O shapes (EEM polarity inverts at short range) and use LJ instead of Morse+f13 nonbonded
324
+ - Promoted to the library core (2026-10-13/14): `cpm` (F95), `forcefield::reaxff` (F78), `scf::{obara_saika,screening}` (F80), `cga` (F81), `sdr` (F83), `imd` (F85), `edl` (F86), `kmesh` (F88 base), `render_bridge` (F90 base), `riemannian` (F94); `alpha::`/`beta::` paths and feature flags remain as compatible aliases
276
325
 
277
326
  ### Validation Snapshot
278
327
 
@@ -300,7 +349,7 @@ Current verified results on this repository state:
300
349
  | `cargo test --test regression test_experimental_comparison` | **54 passed, 0 failed** |
301
350
  | `cargo test --test regression test_extended_molecules` | **14 passed, 0 failed, 7 ignored** |
302
351
 
303
- More detailed coverage notes live in [TESTING.md](TESTING.md), and the broader project plan remains in [ROADMAP.md](ROADMAP.md).
352
+ More detailed coverage notes live in [TESTING.md](TESTING.md), and the broader project plan lives in the [documentation site](docs/index.md).
304
353
 
305
354
  ---
306
355
 
@@ -348,7 +397,8 @@ More detailed coverage notes live in [TESTING.md](TESTING.md), and the broader p
348
397
  | `sci_form::compute_dos` | Density of states + PDOS (EHT orbital energies) |
349
398
  | `sci_form::compute_rmsd` | RMSD after Kabsch alignment |
350
399
  | `sci_form::compute_pm3` | PM3/PM3(tm) semi-empirical SCF |
351
- | `sci_form::compute_xtb` | GFN0-xTB tight-binding with Broyden SCC |
400
+ | `sci_form::compute_xtb` | xTB tight binding — runs GFN2-xTB (same numbers as `compute_gfn2`) |
401
+ | `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 |
352
402
  | `sci_form::compute_uhf` | Unrestricted Hartree-Fock SCF |
353
403
  | `sci_form::compute_rohf` | Restricted open-shell Hartree-Fock SCF |
354
404
  | `sci_form::compute_uff_energy` | UFF force field energy evaluation |
@@ -364,7 +414,7 @@ More detailed coverage notes live in [TESTING.md](TESTING.md), and the broader p
364
414
  |-------------|---------|
365
415
  | `sci_form::eht` | `solve_eht()`, `EhtResult`, `evaluate_orbital_on_grid_chunked()`, `marching_cubes()` |
366
416
  | `sci_form::pm3` | `compute_pm3()`, PM3/PM3(tm) SCF, Gaussian core-core corrections |
367
- | `sci_form::xtb` | `compute_xtb()`, GFN0 SCC with Broyden mixing; `xtb::gfn1`, `xtb::gfn2` |
417
+ | `sci_form::xtb` | `compute_xtb()` (GFN2), `xtb::gfn0` (faithful GFN0), `xtb::gfn1`, `xtb::gfn2`, `compute_xtb_gradient()` |
368
418
  | `sci_form::scf::uhf` | `run_uhf()`, `run_rohf()`, open-shell SCF with spin contamination analysis |
369
419
  | `sci_form::hf` | `solve_hf3c()`, CISD, `mo_transform::ao_to_mo_transform()` |
370
420
  | `sci_form::esp` | `compute_esp_grid_parallel()`, `esp_color_map()`, `esp_grid_to_colors()`, `export_cube()`, `read_cube()` |
@@ -447,11 +497,11 @@ cargo clippy --all-targets -- -D warnings
447
497
  Use the provided bump script. It updates all version strings, commits, tags, and pushes:
448
498
 
449
499
  ```bash
450
- # Auto-increment patch (0.1.7 → 0.1.8)
500
+ # Auto-increment patch (2.0.0 → 2.0.1)
451
501
  ./scripts/bump_version.sh
452
502
 
453
503
  # Set a specific version
454
- ./scripts/bump_version.sh 0.2.0
504
+ ./scripts/bump_version.sh 2.0.1
455
505
  ```
456
506
 
457
507
  This updates versions in:
@@ -465,6 +515,10 @@ This updates versions in:
465
515
 
466
516
  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.
467
517
 
518
+ The workflow refuses to publish a tag that does not match the manifest
519
+ versions, so a mismatch fails fast instead of shipping mislabelled artefacts.
520
+ Before tagging, walk through the [release checklist](docs/release-checklist-1.0.md).
521
+
468
522
  **Required repository secrets:**
469
523
 
470
524
  | Secret | Used for |