wai-quantum 0.3.37: complex neural quantum states, and referees that cannot stop on an excited state #176

Merged
dcharlot merged 3 commits from wai-quantum-nqs-complex into main 2026-10-07 09:13:46 -04:00
Owner

Fix: the referees could stop on an excited state (0.3.36)

0.3.36 made Lanczos stop a restart as soon as its lowest Ritz pair converged. From DMRG's warm starts (the current state) that is safe. From the referees' cold starts, the lowest Ritz pair can be an excited state that converges first: exact diagonalisation of the 8-site Majumdar–Ghosh ring returned −2.595 instead of −3. A variational energy then came out below the referee, which is how it surfaced.

Early stopping is now opt-in and used by the DMRG sweeps only. Exact diagonalisation, full CI and the spin-model referee build every Krylov vector again. The DMRG and NQS pins were re-taken.

New: complex neural quantum states

  • Rbm<T>, Vmc<T> and stochastic reconfiguration are generic over Amplitude, which is real (f64) or complex. The real path keeps its exact bits (the NQS pin did not move under the refactor).
  • The complex path adds exp, ln cosh and tanh, built on the crate's reproducible exp, ln, sin/cos and atan2. Reconfiguration becomes the Hermitian step (S = ⟨O*O⟩ − …, F = ⟨O*E⟩ − …), still solved in whichever of parameter or sample space is smaller, with a Hermitian Cholesky.
  • SpinModel::j1j2, chain_next_nearest, square_diagonals.

Checked

  • A complex network with real parameters is the real one, to 10⁻¹³. Its complex ratios equal amplitude ratios, holomorphic derivatives agree with real-step differences, and both spaces take the same complex step.
  • Exact diagonalisation gives Majumdar–Ghosh rings exactly −3n/8, at 8 and 12 sites.
  • A sign nobody supplied. On 8-site rings (Heisenberg and Majumdar–Ghosh, no sign rule given), a real network stays more than 10 % off; a complex one comes within 2·10⁻³. The CLI solves the 8-site Majumdar–Ghosh ring to 3·10⁻¹⁵, with variance 5·10⁻¹⁷.
  • 12-site rings, 400 steps: Majumdar–Ghosh 2·10⁻⁶, J₁–J₂ (0.3) 3.5·10⁻⁴, Heisenberg 2·10⁻³.
  • The NQS pin now includes a complex machine. All 22 pins pass natively and under wasm32-wasip2, and nqs --complex is byte-identical under WASI.
  • The full suite passes in debug (446 library tests).

Measured, and documented

  • 10-site rings settle about 9 % high, on an eigenstate with zero variance. (Corrected in this PR: the first version blamed momentum, which was wrong.) The cause is spin-flip parity. With zero biases the network is exactly even under a global spin flip, and training keeps it even. A singlet is odd when half the ring is odd, so on 10-site rings the ground state is out of reach. Drawn biases reach it: 3·10⁻⁴, 1·10⁻⁶ and 1.4·10⁻⁵ in 400 steps. On 12-site rings, where the ground state is even, the even start does better. Choosing the sector explicitly is the next PR.
  • The 4×4 torus at J₂ = 0.5: all three networks at α = 1 and 600 steps stay about 3 % above exact (−8.45792335). Recorded as a boundary.

Also

  • nqs_ground now declares required-features (a featureless --examples build failed on it since 0.3.36), and a stray scratch example is removed.

CI note

The release build of staged_resources, the one wall-clock step left over from #164's replication, now passes at low load (0.78 s). Every macOS step has now passed on #164's head.

🤖 Generated with Claude Code

## Fix: the referees could stop on an excited state (0.3.36) 0.3.36 made Lanczos stop a restart as soon as its lowest Ritz pair converged. From DMRG's warm starts (the current state) that is safe. From the referees' cold starts, the lowest Ritz pair can be an excited state that converges first: exact diagonalisation of the 8-site Majumdar–Ghosh ring returned **−2.595 instead of −3**. A variational energy then came out below the referee, which is how it surfaced. Early stopping is now opt-in and used by the DMRG sweeps only. Exact diagonalisation, full CI and the spin-model referee build every Krylov vector again. The DMRG and NQS pins were re-taken. ## New: complex neural quantum states - `Rbm<T>`, `Vmc<T>` and stochastic reconfiguration are generic over `Amplitude`, which is real (`f64`) or complex. The real path keeps its exact bits (the NQS pin did not move under the refactor). - The complex path adds exp, ln cosh and tanh, built on the crate's reproducible exp, ln, sin/cos and atan2. Reconfiguration becomes the Hermitian step (`S = ⟨O*O⟩ − …`, `F = ⟨O*E⟩ − …`), still solved in whichever of parameter or sample space is smaller, with a Hermitian Cholesky. - `SpinModel::j1j2`, `chain_next_nearest`, `square_diagonals`. ### Checked - A complex network with real parameters is the real one, to `10⁻¹³`. Its complex ratios equal amplitude ratios, holomorphic derivatives agree with real-step differences, and both spaces take the same complex step. - Exact diagonalisation gives Majumdar–Ghosh rings exactly `−3n/8`, at 8 and 12 sites. - **A sign nobody supplied.** On 8-site rings (Heisenberg and Majumdar–Ghosh, no sign rule given), a real network stays more than 10 % off; a complex one comes within `2·10⁻³`. The CLI solves the 8-site Majumdar–Ghosh ring to `3·10⁻¹⁵`, with variance `5·10⁻¹⁷`. - 12-site rings, 400 steps: Majumdar–Ghosh `2·10⁻⁶`, J₁–J₂ (0.3) `3.5·10⁻⁴`, Heisenberg `2·10⁻³`. - The NQS pin now includes a complex machine. All 22 pins pass natively and under `wasm32-wasip2`, and `nqs --complex` is byte-identical under WASI. - The full suite passes in debug (446 library tests). ### Measured, and documented - **10-site rings** settle about 9 % high, on an eigenstate with zero variance. *(Corrected in this PR: the first version blamed momentum, which was wrong.)* The cause is **spin-flip parity**. With zero biases the network is exactly even under a global spin flip, and training keeps it even. A singlet is odd when half the ring is odd, so on 10-site rings the ground state is out of reach. Drawn biases reach it: `3·10⁻⁴`, `1·10⁻⁶` and `1.4·10⁻⁵` in 400 steps. On 12-site rings, where the ground state is even, the even start does better. Choosing the sector explicitly is the next PR. - **The 4×4 torus at J₂ = 0.5**: all three networks at α = 1 and 600 steps stay about 3 % above exact (−8.45792335). Recorded as a boundary. ## Also - `nqs_ground` now declares `required-features` (a featureless `--examples` build failed on it since 0.3.36), and a stray scratch example is removed. ## CI note The release build of `staged_resources`, the one wall-clock step left over from #164's replication, now passes at low load (0.78 s). Every macOS step has now passed on #164's head. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wai-quantum 0.3.37: complex neural quantum states, and referees that cannot stop on an excited state
Some checks failed
no-vanity-metrics / WAI public text names no company or product (pull_request) Has been cancelled
standards workspaces build + test / arl-rs (pull_request) Has been cancelled
standards workspaces build + test / eoc-rs (pull_request) Has been cancelled
standards workspaces build + test / jcp-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-ui-rs (pull_request) Has been cancelled
standards workspaces build + test / joulehook-rs (pull_request) Has been cancelled
standards workspaces build + test / openpay (pull_request) Has been cancelled
standards workspaces build + test / proof-rs (pull_request) Has been cancelled
standards workspaces build + test / sandbox-rs (pull_request) Has been cancelled
standards workspaces build + test / sense-rs (pull_request) Has been cancelled
standards workspaces build + test / smart-byte-rs (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Has been cancelled
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · macos (pull_request) Has been cancelled
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI energy receipts / energy receipts · macos (pull_request) Has been cancelled
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Has been cancelled
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Has been cancelled
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Has been cancelled
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been cancelled
standards workspaces build + test / mesh-rs (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (pull_request) Has been cancelled
5cd36795cd
Fix. In 0.3.36, Lanczos stopped a restart as soon as its lowest Ritz pair
converged. That is safe from DMRG's warm starts, but from the referees' cold
ones that pair can be an excited state. Exact diagonalisation of the 8-site
Majumdar-Ghosh ring returned -2.595 instead of -3, and a variational energy
came out below it. Early stopping is now opt-in, used by the DMRG sweeps only;
exact diagonalisation, full CI and the spin-model referee build every Krylov
vector. The DMRG and NQS pins were re-taken.

New: the RBM, VMC and stochastic reconfiguration are generic over real and
complex parameters, and the real path keeps its bits.
- The complex path adds exp, ln cosh and tanh, the Hermitian reconfiguration
  step in either space, and a Hermitian Cholesky.
- New lattices: J1-J2 models, plus next-nearest bonds on chains and diagonal
  bonds on square lattices.
- A complex network learns sign structures nobody supplied. On 8-site rings it
  gets within 2e-3 where a real one stays >10% off, and the CLI solves the
  8-site Majumdar-Ghosh ring to rounding. On 12-site rings: Majumdar-Ghosh
  2e-6, J1-J2 (0.3) 3.5e-4.
- Measured and documented:
  - 10-site rings settle on a momentum-zero excited eigenstate, because the
    ground state has momentum pi.
  - At J2 = 0.5 on the 4x4 torus, alpha = 1 stays about 3% above exact.

The NQS pin now covers a complex machine. All 22 pins pass natively and
under wasm32-wasip2. The nqs CLI gains --complex, --model j1j2 and
--periodic, byte-identical under WASI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum 0.3.37: the 10-site trap is spin-flip parity, not momentum; drop a stray probe
Some checks failed
standards workspaces build + test / joule-code-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-ui-rs (pull_request) Has been cancelled
standards workspaces build + test / joulecontract-rs (pull_request) Has been cancelled
standards workspaces build + test / joulehook-rs (pull_request) Has been cancelled
standards workspaces build + test / map-rs (pull_request) Has been cancelled
standards workspaces build + test / mesh-rs (pull_request) Has been cancelled
standards workspaces build + test / openpay (pull_request) Has been cancelled
standards workspaces build + test / proof-rs (pull_request) Has been cancelled
standards workspaces build + test / sandbox-rs (pull_request) Has been cancelled
standards workspaces build + test / sense-rs (pull_request) Has been cancelled
standards workspaces build + test / smart-byte-rs (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Has been cancelled
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · macos (pull_request) Has been cancelled
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI energy receipts / energy receipts · macos (pull_request) Has been cancelled
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Has been cancelled
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Has been cancelled
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Has been cancelled
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (pull_request) Has been cancelled
standards workspaces build + test / jouleclaw-rs (pull_request) Has been cancelled
defa8a8a94
With zero biases the network is exactly even under a global spin flip, and
training keeps it even. A singlet is odd when half the ring is odd, so on
10-site rings the ground state was out of reach. Drawn biases reach it, and
the docs now say so, with both starts measured. The earlier text blamed
momentum, which is wrong.

Also removes examples/nqs_probe.rs, a scratch probe that the squash swept in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum 0.3.37: nqs_ground declares its feature
Some checks failed
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 7m30s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 52s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 2m36s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 4s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m8s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m55s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m30s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m13s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m10s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m13s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m12s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m7s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m54s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 4m29s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 13s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 2m21s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 26s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 47s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m35s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m26s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m9s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 4m4s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 1m46s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 1h25m55s
standards workspaces build + test / macOS energy backends (pull_request) Failing after 1h48m39s
WAI conformance / cargo-class corpora · macos (pull_request) Failing after 31m24s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 7m6s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 50m6s
a6636aa3dc
Without it a build of every example with default features failed on it
(since 0.3.36).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!176
No description provided.