QVF writer — handover / status¶
Last updated: 2026-05-22 Branch: main Commit: (pending) Agent session: QVF writer — release-readiness pass
What this is¶
The vibe-qc producer half of the QVF (Quantum Visualisation Format)
pipeline. Writes .qvf files from SCF results. The consumer half
lives in vibe-view/ (see vibe-view/HANDOVER.md). Both halves share
the design document at docs/design_qcv_format.md.
Status: COMPLETE — all 13 milestones delivered, release-ready.
Current progress¶
Milestone |
Status |
Tests |
|---|---|---|
M1 — Core writer + all v1 section kinds |
✅ done |
11 per-kind unit |
M2 — Validator + CLI |
✅ done |
10 validator + 1 CLI |
M3 — Round-trip + E2E |
✅ done |
2 round-trip + 1 E2E |
M4 — Guardrails |
✅ done |
4 guardrail |
M5 — Runner integration ( |
✅ done |
— |
M6 — Plan integration ( |
✅ done |
— |
M7 — JSON Schema |
✅ done |
— |
M8 — Consumer manifest alignment |
✅ done |
— |
M9 — Grid helpers (P2) |
✅ done |
2 slow |
M10 — Periodic runner integration (P3) |
✅ done |
— |
M11 — viewer_defaults + volume.spin (P4) |
✅ done |
— |
M12 — 5 remaining reserved kinds |
✅ done |
5 fast |
M13 — Consumer reference reader (P2) |
✅ done |
— |
Total |
38 tests |
Completed work¶
Files¶
File |
Purpose |
Lines |
|---|---|---|
|
Writer + validator + CLI |
~1370 |
|
JSON Schema |
312 |
|
Test suite |
~1050 |
|
|
+15 |
|
|
+56 |
|
Export |
+2 |
|
Re-export QVF symbols |
+8 |
Section kinds implemented (v1)¶
Kind |
Source data |
Binary payloads |
|---|---|---|
|
molecule/system |
|
|
pre-computed 3D numpy |
|
|
pre-computed 3D numpy |
|
|
|
|
|
list of Molecule frames |
|
|
|
|
|
|
|
|
|
|
|
result + context |
Embedded at manifest root (not in sections[]) |
|
BibTeX string |
|
Producer rules enforced¶
Float32 default, float64 opt-in via
volume_dtype="float64"Deflate default, auto-detects
zipfile-zstdif importablemanifest.jsonalwaysZIP_STOREDEvery binary member carries sha256 hex digest in manifest
All kinds from the registry or
x_<vendor>.*namespaceNo unregistered kinds emitted
Guardrails¶
Guard |
Level |
Behavior |
|---|---|---|
Bad plan type |
|
|
Volume > 1 Gvoxel |
|
|
Missing molecule/system |
|
|
Empty |
|
|
Zip bomb (>128 MiB/member) |
|
Validity error |
Missing |
|
Hard error |
Unknown kind (non-vendor) |
|
Validity error |
Vendor kind ( |
|
⚠ warning, not validated |
Reserved kind |
|
Noted, payloads skipped |
sha256 mismatch |
|
Per-member error |
Runner integration¶
result = run_job(mol, basis="sto-3g", method="rhf",
output="h2o", output_qvf=True)
# → h2o.qvf (structure + atom_properties + citations)
The .qvf is recorded in the .system manifest via OutputWriter.record()
so vq can fetch it alongside the .out / .molden / .xyz siblings.
Next steps (priority order)¶
None — all P0–P2 items are complete. The remaining reserved kinds
(volume.potential, volume.difference, volume.generic,
volume.orbital_projection, spectra.uvvis, spectra.ecd,
spectra.vcd, spectra.nmr, spectra.generic, topology.qtaim,
topology.elf_basins, projections.lcao, basis)
all follow the same section-writer pattern (~50 lines each) when
needed. The dispatcher adapter (P1 from previous revision) was
deemed unnecessary — the aggregate-archive shape of QVF does not fit
the per-file, per-role dispatcher model used by cube/molden/xyz
writers.
Blockers¶
None.
Assumptions¶
Volumetric data is provided as pre-computed numpy arrays. The writer does not call grid evaluators internally — it’s the caller’s responsibility.
atoms_cart.binis always present for molecular systems;atoms_frac.bin+lattice.binfor periodic. Both paths are disjoint — a section never has both cart and frac.The
structuresection always haspbcanddimensionalityfields for the consumer to decide on replication / unit-cell rendering.
Key decisions¶
Single-file module:
qvf.pyrather than a package. All section writers are private_write_<kind>_section()functions. If the file grows past ~2000 lines in v2, split into a package.In-memory zip construction: all payloads are
zf.writestr()rather than written to a temp dir first. Keeps the lifecycle simple.Provence at manifest root, not in
sections[]. Matches the design doc §7 informal example.Band structure eigenvalues in eV, not Hartree. Matches the consumer expectation (per design doc §8.4).
Normal-mode displacements are mass-weighted eigenvectors, not Cartesian displacements. Consumer divides by
sqrt(m_i)to animate.