sci-form-wasm 0.9.1 → 0.10.1

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
@@ -26,6 +26,13 @@ Native bindings for **Rust**, **Python**, **TypeScript/JavaScript (WASM)**, and
26
26
  - **Volumetric orbital grids** — STO-3G basis, chunked evaluation for large molecules, marching cubes isosurfaces
27
27
  - **Density of States** — total DOS + per-atom PDOS with Gaussian smearing, JSON export, MSE metric
28
28
 
29
+ ### Experimental RHF Engine
30
+ - **Isolated `experimental_2` namespace** — next-generation Roothaan-Hall RHF engine without affecting stable APIs
31
+ - **Analytical Gaussian integrals** — overlap, kinetic, nuclear attraction, core Hamiltonian, and two-electron ERIs
32
+ - **SCF with DIIS + parallel ERI** — deterministic RHF/STO-3G workflow with rayon acceleration for the expensive $O(N^4)$ step
33
+ - **Experimental spectroscopy stack** — prototype sTDA UV-Vis, GIAO-like NMR shielding, and semi-numerical IR/Hessian workflows
34
+ - **GPU-oriented architecture** — WGSL shader stubs, orbital grid evaluation, and marching-cubes rendering pipeline prepared for future `wgpu` enablement
35
+
29
36
  ### Electrostatics & Surface
30
37
  - **Electrostatic Potential (ESP)** — Coulomb grid from Mulliken charges, color mapping (red/white/blue), `.cube` export
31
38
  - **Parallel ESP** — rayon-accelerated grid computation (`parallel` feature)
@@ -220,6 +227,57 @@ Prebuilt binaries available at [GitHub Releases](https://github.com/jigonzalez93
220
227
 
221
228
  ---
222
229
 
230
+ ## Experimental Engine
231
+
232
+ The repository now includes an isolated experimental quantum-chemistry stack under `sci_form::experimental_2`.
233
+
234
+ ### Phase Status
235
+
236
+ | Phase | Status | Scope |
237
+ |------|--------|-------|
238
+ | Phase 1 | Complete | GPU infrastructure scaffolding, aligned types, CPU fallback, WGSL interface stubs |
239
+ | Phase 2 | Complete | Gaussian basis, overlap/kinetic/nuclear/core matrices, ERIs, validation helpers |
240
+ | Phase 3 | Complete | RHF SCF loop, Löwdin orthogonalization, DIIS, Mulliken analysis, gradients, optimizer, parallel ERI |
241
+ | Phase 4 | Prototype complete | Experimental sTDA UV-Vis, GIAO-style NMR shielding, Hessian/IR workflows |
242
+ | Phase 5 | Prototype complete | Orbital grid evaluation, marching cubes, isosurface generation, GPU-ready rendering path |
243
+
244
+ ### Current Practical Status
245
+
246
+ - Stable production APIs remain unchanged; the experimental work is isolated in `experimental_2`
247
+ - Real acceleration today is CPU parallelism via rayon in the ERI build path
248
+ - GPU execution is not enabled yet; `phase1_gpu_infrastructure` currently exposes a CPU fallback plus WGSL-ready interfaces
249
+ - 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
250
+
251
+ ### Validation Snapshot
252
+
253
+ The experimental stack is covered by dedicated regression suites:
254
+
255
+ ```bash
256
+ # Build all library + test targets
257
+ cargo check --tests
258
+
259
+ # Base experimental regression suite
260
+ cargo test --test regression test_experimental_comparison -- --nocapture
261
+
262
+ # Extended complex-molecule battery (fast active tests)
263
+ cargo test --test regression test_extended_molecules -- --nocapture
264
+
265
+ # Heavy experimental benchmarks and long-running tests
266
+ cargo test --release --test regression test_extended_molecules -- --include-ignored
267
+ ```
268
+
269
+ Current verified results on this repository state:
270
+
271
+ | Command | Result |
272
+ |--------|--------|
273
+ | `cargo check --tests` | passes |
274
+ | `cargo test --test regression test_experimental_comparison` | **54 passed, 0 failed** |
275
+ | `cargo test --test regression test_extended_molecules` | **14 passed, 0 failed, 7 ignored** |
276
+
277
+ More detailed coverage notes live in [TESTING.md](TESTING.md), and the broader project plan remains in [ROADMAP.md](ROADMAP.md).
278
+
279
+ ---
280
+
223
281
  ## Benchmark Results
224
282
 
225
283
  ### Conformer Generation — Diverse Molecules (131 molecules, all functional groups)
@@ -311,7 +369,7 @@ cargo build --release
311
369
  cd crates/python && pip install maturin && maturin develop --release
312
370
 
313
371
  # WASM bindings
314
- cd crates/wasm && wasm-pack build --target web --release
372
+ cd crates/wasm && ./build.sh --web-only --web-features "parallel experimental-gpu"
315
373
 
316
374
  # With parallel feature
317
375
  cargo build --release --features parallel
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sci-form-wasm",
3
3
  "type": "module",
4
4
  "description": "WASM/TypeScript bindings for high-performance 3D molecular conformer generation",
5
- "version": "0.9.1",
5
+ "version": "0.10.1",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -321,6 +321,8 @@ export function eht_orbital_mesh(elements: string, coords_flat: string, mo_index
321
321
  */
322
322
  export function eht_support(elements: string): string;
323
323
 
324
+ export function eht_volumetric_grid_info(elements: string, coords_flat: string, spacing: number, padding: number): string;
325
+
324
326
  /**
325
327
  * Generate a 3D conformer from a SMILES string.
326
328
  *
@@ -418,11 +420,6 @@ export function wbg_rayon_start_worker(receiver: number): void;
418
420
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
419
421
 
420
422
  export interface InitOutput {
421
- readonly embed: (a: number, b: number, c: number, d: number) => void;
422
- readonly embed_coords: (a: number, b: number, c: number, d: number) => void;
423
- readonly embed_coords_typed: (a: number, b: number, c: number) => number;
424
- readonly embed_batch: (a: number, b: number, c: number, d: number) => void;
425
- readonly parse_smiles: (a: number, b: number, c: number) => void;
426
423
  readonly compute_charges: (a: number, b: number, c: number) => void;
427
424
  readonly compute_sasa: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
428
425
  readonly compute_population: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -430,45 +427,57 @@ export interface InitOutput {
430
427
  readonly compute_dipole: (a: number, b: number, c: number, d: number, e: number) => void;
431
428
  readonly compute_dos: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
432
429
  readonly compute_rmsd: (a: number, b: number, c: number, d: number, e: number) => void;
433
- readonly compute_ml_properties: (a: number, b: number, c: number) => void;
434
- readonly compute_molecular_descriptors: (a: number, b: number, c: number) => void;
435
- readonly compute_sssr: (a: number, b: number, c: number) => void;
436
- readonly compute_ecfp: (a: number, b: number, c: number, d: number, e: number) => void;
437
- readonly compute_tanimoto: (a: number, b: number, c: number, d: number, e: number) => void;
438
- readonly butina_cluster: (a: number, b: number, c: number, d: number) => void;
439
- readonly compute_rmsd_matrix: (a: number, b: number, c: number) => void;
430
+ readonly compute_pm3: (a: number, b: number, c: number, d: number, e: number) => void;
431
+ readonly compute_xtb: (a: number, b: number, c: number, d: number, e: number) => void;
432
+ readonly compute_hf3c: (a: number, b: number, c: number, d: number, e: number) => void;
433
+ readonly compute_hf3c_custom: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
434
+ readonly compute_ani: (a: number, b: number, c: number, d: number, e: number) => void;
435
+ readonly create_unit_cell: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
436
+ readonly assemble_framework: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
440
437
  readonly compute_nonpolar_solvation: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
441
438
  readonly compute_gb_solvation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
442
- readonly analyze_stereo: (a: number, b: number, c: number, d: number, e: number) => void;
443
439
  readonly compute_md_trajectory: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
444
440
  readonly compute_md_trajectory_nvt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
445
441
  readonly compute_simplified_neb_path: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
446
442
  readonly search_conformers_with_uff: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
447
- readonly compute_orbital_mesh: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
448
443
  readonly compute_frontier_descriptors: (a: number, b: number, c: number, d: number, e: number) => void;
449
444
  readonly compute_fukui_descriptors: (a: number, b: number, c: number, d: number, e: number) => void;
450
445
  readonly compute_reactivity_ranking: (a: number, b: number, c: number, d: number, e: number) => void;
451
446
  readonly compute_uv_vis_spectrum: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
452
447
  readonly analyze_graph_features: (a: number, b: number, c: number) => void;
453
448
  readonly compute_topology: (a: number, b: number, c: number, d: number, e: number) => void;
449
+ readonly version: (a: number) => void;
450
+ readonly system_capabilities: (a: number, b: number, c: number) => void;
451
+ readonly system_method_plan: (a: number, b: number, c: number) => void;
452
+ readonly compare_methods: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
454
453
  readonly compute_uff_energy: (a: number, b: number, c: number, d: number, e: number) => void;
455
454
  readonly compute_uff_energy_with_aromatic_heuristics: (a: number, b: number, c: number, d: number, e: number) => void;
456
455
  readonly compute_mmff94_energy: (a: number, b: number, c: number, d: number, e: number) => void;
457
456
  readonly compute_empirical_pka: (a: number, b: number, c: number) => void;
458
- readonly compute_pm3: (a: number, b: number, c: number, d: number, e: number) => void;
459
- readonly compute_xtb: (a: number, b: number, c: number, d: number, e: number) => void;
460
- readonly compute_hf3c: (a: number, b: number, c: number, d: number, e: number) => void;
461
- readonly compute_hf3c_custom: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
462
- readonly compute_ani: (a: number, b: number, c: number, d: number, e: number) => void;
463
- readonly compute_esp: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
464
- readonly compute_esp_grid_typed: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
465
- readonly compute_esp_grid_info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
466
457
  readonly eht_calculate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
467
458
  readonly eht_or_uff_fallback: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
468
459
  readonly eht_orbital_mesh: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
469
460
  readonly eht_support: (a: number, b: number, c: number) => void;
470
461
  readonly eht_orbital_grid_typed: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
471
462
  readonly eht_orbital_grid_from_coefficients_typed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
463
+ readonly eht_volumetric_grid_info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
464
+ readonly compute_orbital_mesh: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
465
+ readonly compute_sssr: (a: number, b: number, c: number) => void;
466
+ readonly compute_ecfp: (a: number, b: number, c: number, d: number, e: number) => void;
467
+ readonly compute_tanimoto: (a: number, b: number, c: number, d: number, e: number) => void;
468
+ readonly butina_cluster: (a: number, b: number, c: number, d: number) => void;
469
+ readonly compute_rmsd_matrix: (a: number, b: number, c: number) => void;
470
+ readonly compute_esp: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
471
+ readonly compute_esp_grid_typed: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
472
+ readonly compute_esp_grid_info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
473
+ readonly analyze_stereo: (a: number, b: number, c: number, d: number, e: number) => void;
474
+ readonly embed: (a: number, b: number, c: number, d: number) => void;
475
+ readonly embed_coords: (a: number, b: number, c: number, d: number) => void;
476
+ readonly embed_coords_typed: (a: number, b: number, c: number) => number;
477
+ readonly embed_batch: (a: number, b: number, c: number, d: number) => void;
478
+ readonly parse_smiles: (a: number, b: number, c: number) => void;
479
+ readonly compute_ml_properties: (a: number, b: number, c: number) => void;
480
+ readonly compute_molecular_descriptors: (a: number, b: number, c: number) => void;
472
481
  readonly compute_stda_uvvis: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
473
482
  readonly compute_vibrational_analysis: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
474
483
  readonly compute_ir_spectrum: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
@@ -476,15 +485,9 @@ export interface InitOutput {
476
485
  readonly predict_nmr_couplings: (a: number, b: number, c: number, d: number, e: number) => void;
477
486
  readonly compute_nmr_spectrum: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
478
487
  readonly compute_hose_codes: (a: number, b: number, c: number, d: number) => void;
479
- readonly version: (a: number) => void;
480
- readonly system_capabilities: (a: number, b: number, c: number) => void;
481
- readonly system_method_plan: (a: number, b: number, c: number) => void;
482
- readonly compare_methods: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
483
488
  readonly pack_batch_arrow: (a: number, b: number, c: number) => void;
484
489
  readonly split_worker_tasks: (a: number, b: number, c: number, d: number, e: number) => void;
485
490
  readonly estimate_workers: (a: number, b: number) => number;
486
- readonly create_unit_cell: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
487
- readonly assemble_framework: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
488
491
  readonly __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
489
492
  readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
490
493
  readonly wbg_rayon_poolbuilder_receiver: (a: number) => number;
package/sci_form_wasm.js CHANGED
@@ -1507,6 +1507,34 @@ export function eht_support(elements) {
1507
1507
  }
1508
1508
  }
1509
1509
 
1510
+ /**
1511
+ * @param {string} elements
1512
+ * @param {string} coords_flat
1513
+ * @param {number} spacing
1514
+ * @param {number} padding
1515
+ * @returns {string}
1516
+ */
1517
+ export function eht_volumetric_grid_info(elements, coords_flat, spacing, padding) {
1518
+ let deferred3_0;
1519
+ let deferred3_1;
1520
+ try {
1521
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1522
+ const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1523
+ const len0 = WASM_VECTOR_LEN;
1524
+ const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1525
+ const len1 = WASM_VECTOR_LEN;
1526
+ wasm.eht_volumetric_grid_info(retptr, ptr0, len0, ptr1, len1, spacing, padding);
1527
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1528
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1529
+ deferred3_0 = r0;
1530
+ deferred3_1 = r1;
1531
+ return getStringFromWasm0(r0, r1);
1532
+ } finally {
1533
+ wasm.__wbindgen_add_to_stack_pointer(16);
1534
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
1535
+ }
1536
+ }
1537
+
1510
1538
  /**
1511
1539
  * Generate a 3D conformer from a SMILES string.
1512
1540
  *
Binary file