Skip to content

abgnydn/webgpu-q

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

188 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
webgpu-q — quantum chemistry and many-body physics in a browser tab

Launch   SI Report   Research dashboard



version license tests typescript webgpu install-free

A research-grade quantum chemistry + many-body physics engine that runs entirely in a browser tab.

No install. No backend. No CUDA. Open a URL and get HF · UHF · DFT (RKS+UKS) · MP2 · CCSD · CCSD(T) · EOM-CCSD · TDDFT α(ω) · C₆ dispersion on real molecules — with GPU acceleration via WebGPU. Molden / Cube / QCSchema / XYZ exports for visualization + interop.



📸   See it

Landing page
landing · what the engine is + run-anywhere CTAs
Molecule SI report
/molecule.html · H₂O SI report — properties, spectra, gradients
Experiment dashboard
/experiments/ · research dashboard (E1–E33, JSON artifacts)


📊   The numbers (single source of truth — see bottom of file)

Key numbers: 553 tests, 39.3× CCSD(T) on GPU, 10⁻⁵ Ha EOM-CCSD vs FCI, 7×10⁻¹⁴ Ha DF-HF, 1.35×10⁻¹¹ GPU↔CPU, 4.18× fusion, F ≥ 0.999999 statevector, N=128 MPS


🧪   What's inside

Capability map: 7 modules — ground state, correlation, excited states, properties, geometry, density fitting, many-body simulation


⚡   How fast — honestly, both directions

The headline 39.3× on CCSD(T) is real. So is the fact that PySCF/NumPy is 480× faster than us on CCSD at cc-pVDZ. Both numbers come from the same comparison run, against PySCF 2.13.0 on identical inputs.

Performance comparison vs PySCF — 198.6s CPU to 5.05s GPU on H₂O cc-pVDZ CCSD(T) (39.3× speedup), plus an honest two-column where-we-win / where-we-lose summary from E34

↑ Single-run measurements (not warmup+trials harness). Energy agreement ≤ 10⁻⁴ Ha on all 19 comparable cells (well below chemical accuracy of 1.594 mHa). Where we win: no Python startup, HF up to medium systems, GPU CCSD(T) at cc-pVDZ. Where we lose: CPU MP2 / CCSD at production basis where NumPy / BLAS dominates. Full data: E34-comparison.md.



🆚   Completeness scorecard

Every method PySCF 2.13 / ORCA 6.1 / Psi4 1.10 ship, our status against it, and the roadmap tier for every gap.
No "we don't do that" — every missing capability has a planned slot.

Completeness scorecard: 50+ methods across 12 sections (mean field, correlation, multireference, excited states, properties, geometry, basis, solvent, acceleration, relativistic, periodic, platform) with shipped/Tier 3/Tier 4/out-of-scope status per row


🔬   Validation matrix

Validation matrix: every layer cross-checked against PySCF, libxc, ITensor, brute-force projection, or experiment, with residuals disclosed


🪜   The research ladder

6-level research ladder: statevector, MPS/DMRG, kernel fusion (shipped foundation), WebRTC swarm, hardware verify (deferred), quantum chemistry (flagship)


⏱️   60-second demo

git clone https://github.com/abgnydn/webgpu-q && cd webgpu-q
npm install
npm run dev          # http://localhost:5175
                     # /molecule.html → H₂O SI report
                     # /experiments/  → research dashboard
npm run test         # vitest unit/integration · CI green
npm run typecheck    # tsc --noEmit, strict + noUncheckedIndexedAccess
npm run test:e2e     # Playwright · headless WebGPU Chromium
// Or one-call from molecule to a full property report
import { molecules, quickReport, uvVisSpectrum, toMoldenString } from "./src/chemistry";

const report  = quickReport(molecules.h2o, { addD2: true, addStaticAlpha: true });
const uvvis   = uvVisSpectrum(molecules.h2o, { method: "b3lyp5" });
const molden  = toMoldenString({ atoms: molecules.h2o, /* ... */ });
// → energy, dipole, charges, bond orders, NOON, ⟨S²⟩, multireference
//   verdict, static α, D2 dispersion, UV-vis spectrum + peaks, Molden file.
//   All in a Chrome tab.
// Or piece by piece if you want control
import { runRHFSCF, runMP2, runCCSD, runCCSDT_GPU, runEOMCCSD } from "./src/chemistry";

const hf      = runRHFSCF(integrals, nElectrons);
const mp2     = runMP2(hf, integrals);
const ccsd    = runCCSD(hf, integrals);
const t       = await runCCSDT_GPU(ccsd, hf, integrals, device);  // 39× on cc-pVDZ
const excited = runEOMCCSD(ccsd, integrals, hf);


🧱   Architecture · URL → silicon

8-layer architecture stack from URL through dashboard, research harness, chemistry modules, numerical core, WGSL shaders, WebGPU API, down to GPU silicon

Research harness · experiments/lib/

  • runner.tstimedRun with forced GPU sync (read-after-submit on a tiny buffer)
  • seeds.ts — named deterministic seeds (no Math.random())
  • env.ts — captures adapter info, limits, SHA, UTC
  • fidelity.tsF = |⟨ψ_ref|ψ_test⟩|², not max|Δp|
  • stats.ts — median, p10/p90/p99, IQR

Discipline (non-negotiable)

  • 5 warmup + 20 trials per measurement
  • Pass bar: F ≥ 1 − 10⁻⁵ (f32 GPU paths)
  • std/median > 0.1status: "noisy"
  • Honest negatives committed as JSON with diagnosis
  • vitest + Playwright e2e · CI green · TS strict + noUncheckedIndexedAccess


📚   Method catalog

Ground-state electronic structure · HF · UHF · DFT · MP2
method notes
RHF SCF DIIS, frozen-core, spherical-d, f/g/h, level-shift
UHF SCF open-shell, stacked α+β DIIS, ⟨S²⟩ check, level-shift
RKS-DFT (LDA, GGA, hybrid) LDA · BVWN5 · BLYP · B3VWN5 · B3LYP5; Becke grid, Lebedev
UKS-DFT (LDA, GGA, hybrid) full functional ladder, spin-polarized XC kernel, ⟨S²⟩
MP2 · DF-MP2 spin-orbital + B-tensor reformulation
Cholesky DF (CD-DF) rank-3 B-tensor, threshold-controlled
HF / DFT analytical ∇ Pulay 1969, 8-fold ERI loop, Schwarz screening
Correlation & excited states · CCSD · CCSD(T) · EOM-CCSD · CIS · TDDFT
method notes
CCSD (RHF) Stanton-Bartlett, antisym spin-orbital + frozen-core
UCCSD (UHF) shared ccsdIterate core, 3-block ERI
CCSD(T) CPU per-triple, FCI-validated ≤ 0.25 mHa, frozen-core via Set
CCSD(T) GPU 39.3× on H₂O cc-pVDZ, f32→f64 reduce
UCCSD(T) open-shell perturbative triples, frozen-core via Set
EE-EOM-CCSD Stanton-Bartlett σ + stage-32c diagonal patch, Davidson
IP-EOM-CCSD R₁ exact (brute-force); R₂ open
EA-EOM-CCSD R₁ + R₂ patched to exact (stage 32e)
CIS · TDA · TDDFT (Casida) full functional ladder, triplet via spin-pol, Davidson
Counterpoise / BSSE HF / MP2 / CCSD / UHF / UCCSD / RKS / UKS + optional D2 add-on
Oscillator strengths f = (2/3)·ω·
Spin classifier singlet/triplet/spin-flip weight per root
Properties & spectroscopy
property notes
Dipole μ AO→MO transform, RHF + post-HF densities
Polarizability α(0) finite field + analytical CPHF (RHF + UHF)
Polarizability α(ω) TDHF + TDDFT + open-shell UHF-TDHF response
Polarizability α(iω) imaginary-axis response for Casimir-Polder
C₆ van-der-Waals coefficients Casimir-Polder integral; HF/UHF/DFT references
Hyperpolarizability β 3D finite-field stencil
Mulliken populations charges + spin-density resolved (closed + open shell)
Wiberg / Mayer bond orders + atomic valences, Lewis-multiplicity inference
Natural orbital occupations NOON, multi-reference diagnostic
D2 dispersion correction Grimme JCC 2006, energy + analytical gradient
Multireference verdict T1/D1/⟨S²⟩/NOON aggregator with cutoff flags
TRK sum rule oscillator-strength conservation check
Foster-Boys / Pipek-Mezey orbital localization (Boys 1960 + PM 1989)
Energy decomposition one-electron + Coulomb + exchange + V_nn breakdown
Coordination numbers smooth Grimme D3 CN for chemistry-aware features
Coulomb matrix descriptor permutation-invariant ML feature
Molecular formula / graph Hill convention, adjacency, connected components
RMSD + Kabsch alignment optimal rotation between geometries
Standard orientation COM + principal-axes alignment
Rotational constants A/B/C in cm⁻¹ and GHz
Multi-frame XYZ trajectory for geom-opt / NEB visualization
Pre-built molecule library h2o, ch4, nh3, beh2, hf, etc.
quickReport(atoms) one-call full property report
uvVisSpectrum(atoms) atoms → excitations + broadened spectrum + peaks
Harmonic ω mass-weighted Hessian by finite diff
IR intensities dμ/dQ along normal modes
Raman activities Placzek invariants from α(Q)
Thermo (Sackur-Tetrode + RR + HO) H₂O entropy 45.06 vs expt 45.1
Koopmans / ΔSCF / EOM IPs H₂O: 10.65 / 8.36 / 12.03 eV (expt 12.62)
Koopmans / EOM EAs H₂O: −16.48 / −16.37 eV
Molden orbital export Cartesian Gaussian basis, Jmol/Avogadro/Multiwfn
Gaussian Cube export density + MO isosurfaces, VMD/Jmol/Multiwfn
QCSchema JSON export MolSSI standard, QCEngine/QCFractal/cclib consumable
XYZ format I/O parse / emit standard geometry files
Geometry & basis sets
feature notes
BFGS geom-opt analytical HF + DFT gradients
Lebedev angular grids 2.6× point reduction at better accuracy
STO-3G H, He, Li, Be, C, N, O, F (full first + second period)
6-31G* available
cc-pVDZ H, He, Li, Be, C, N, O, F; CCSD(T) on H₂O in 5 s (GPU)
aug-cc-pVDZ H, He, Li, Be, C, N, O, F (diffuse functions wired)
Spherical-d sphd shell (Tier 1 bundle)
f / g / h orbitals Cartesian integrals + transform
Schwarz integral screening 8-fold canonical loop
Many-body simulation · statevector · MPS · DMRG · kernel fusion
level notes
L1 statevector f32 vec2 amplitudes, N/2 threads/gate
L1 controlled-U N/4 threads, only control=1 touched
L2 MPS canonical form, Jacobi complex SVD
L2 TEBD _canonicalizeBond(q) invariant before two-site
DMRG Lanczos + MPO, ITensor cross-checked N=8
L3 fusion Tier B/C 4.18× headline (Tier C, 8×8)
L3 fusion Tier D documented honest negative (plateau)
Phase 6 GPU MPS χ ≤ 64


🔬   For researchers

📖 How to cite

See CITATION.cff. For papers:

Günaydın, A.B. (2026). webgpu-q v0.6.0. https://github.com/abgnydn/webgpu-q

A Zenodo DOI will be minted on the next versioned release.

⚠️ Limitations

Honest, single-page list of what we cannot do, what is untested, and what is known broken — system size ceilings, browser/vendor matrix, SCF failure modes, missing output formats, precision disclosures.

📊 Benchmarks queue

Standardized sets we've run vs. queued: GMTKN55, Thiel/QUEST, W4-11, S66, HEAT-345, SIE4x4, wall-clock vs PySCF / gpu4pyscf, cross-vendor parity.

🛠️ Contributing · 🔁 Migration · 📐 Research standards

15 canonical principles (RESEARCH_STANDARDS.md, mirrored in sibling webgpu-dna). Validation discipline (5w + 20t, fidelity pass bar, honest negatives committed). Migration policy: hand-write only the WebGPU/WGSL/browser layer; port chemistry methods (HF, CCSD, EOM-CCSD, DFT functionals…) from PySCF / libxc with attribution. See LICENSE-PYSCF for the upstream license.

📐 Modern standards audit

Every claim mapped to current literature — GMTKN55 functional rankings, EOM-CCSD literature accuracy bars, chemical accuracy bar (1 kcal/mol = 1.594 mHa), AFQMC beyond-CCSD(T), WebGPU subgroups status.

🤝 Code of conduct

Contributor Covenant 2.1. Report concerns to hi@barisgunaydin.com.



🌐   Companion projects



📜   Key numbers — single source of truth

Click to expand · edit here when stages move forward

Anywhere a number appears above, it traces back to this table. Update the entry below, then rebuild the SVG hero (public/readme-hero.svg) if a top-line number changed.

symbol value context
TESTS 553 vitest unit + integration, all green
CHEMISTRY_TESTS 437 chemistry subset (1 skipped: opt-in cc-pVDZ CCSD(T))
E2E_SPECS 14 Playwright headless WebGPU (CCSD(T), EOM, UV-vis, wallclock-vs-PySCF, levels 1/2/3/6, smoke tests)
CCSD_T_SPEEDUP 39.3× H₂O · cc-pVDZ · M2 Pro · vs our own CPU
CCSD_T_GPU_TIME 5.05 s H₂O · cc-pVDZ · GPU
CCSD_T_CPU_TIME 198.6 s H₂O · cc-pVDZ · CPU
CCSD_T_GPU_DELTA 2.4×10⁻¹⁰ Ha H₂O · cc-pVDZ · |GPU − CPU|
WIN_HF_H2_STO3G 105× E34 vs PySCF 2.13.0 · no-startup advantage
WIN_CCSD_LIH_STO3G 40× E34 vs PySCF 2.13.0 · small-system advantage
LOSS_CCSD_H2O_CCPVDZ 480× slower E34 vs PySCF 2.13.0 · BLAS gap (NumPy wins)
LOSS_MP2_H2O_CCPVDZ 136× slower E34 vs PySCF 2.13.0 · BLAS gap
E34_ENERGY_MAX_DELTA 1.0×10⁻⁴ Ha max |ΔE| vs PySCF over 19 cells · below chemical accuracy
E34_ENERGY_MEAN_DELTA 8.1×10⁻⁶ Ha mean |ΔE| vs PySCF over 19 cells
EOM_CCSD_PRECISION 10⁻⁵ Ha H₂ STO-3G · post-32c patch · 2-electron only
EOM_CCSD_LIH_TRIPLET_GAP 7 meV E35 vs PySCF · 4-electron triplet · effectively exact
EOM_CCSD_LIH_SINGLET_GAP ~0.27 eV E35 vs PySCF · post-32k sign-fix · within literature EOM-CCSD ↔ FCI bar (~0.1–0.2 eV)
EOM_CCSD_H2O_SINGLET_GAP ~1.9 eV E35 vs PySCF · 10-e⁻ system · remaining missing T-dressings · PySCF port closes
IP_EOM_H2O 12.03 eV expt 12.62
EA_EOM_H2O −16.37 eV STO-3G (unbound)
DF_HF_PRECISION 7×10⁻¹⁴ Ha H₂O STO-3G
DF_MP2_PRECISION 0 Ha H₂O STO-3G at τ=10⁻¹⁰
FUSION_HEADLINE 4.18× Tier C · 8×8 cascade
STATEVECTOR_FIDELITY F ≥ 0.999999 f32 GPU vs f64 CPU
MPS_N_MAX 128 TFIM/Heisenberg, χ ≤ 32, browser
MPS_CHI_MAX 64 Phase 6 GPU MPS
H2O_ENTROPY 45.06 cal/(mol·K) expt 45.1
STAGES_SHIPPED through v0.6.0 SVG visualization stack (α(ω) / NOON / UV-vis / dispersion / charges / basis coverage / LMO gallery / convergence / 2D field contours) wired into /molecule.html; polarizability + dispersion matrix end-to-end, UKS-DFT full functional ladder, Molden/Cube/QCSchema/XYZ exports, D2 dispersion + counterpoise, Foster-Boys + Pipek-Mezey localization, NOON + multireference verdict
LIVE_URL webgpu-q.vercel.app production


MIT · Built with WebGPU, TypeScript strict, vitest, Playwright
Author @abgnydn · hi@barisgunaydin.com



About

WebGPU quantum many-body + chemistry simulator — statevector, MPS, kernel fusion, HF/UHF/UCCSD/DFT/MP2/CCSD, CCSD(T) on GPU (39× speedup), EE/IP/EA-EOM-CCSD (FCI-validated via brute-force), Cholesky density fitting. 401 tests, ITensor + PySCF + brute-force-EOM cross-checked. Browser-native.

Topics

Resources

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-PYSCF

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors