Skip to content

[QCS] 🌠 Wander/漫步者: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape - #263

Open
JunkaiWang-TheoPhy wants to merge 10 commits into
QuantumBFS:mainfrom
JunkaiWang-TheoPhy:codex/issue-33-vqetape
Open

[QCS] 🌠 Wander/漫步者: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape#263
JunkaiWang-TheoPhy wants to merge 10 commits into
QuantumBFS:mainfrom
JunkaiWang-TheoPhy:codex/issue-33-vqetape

Conversation

@JunkaiWang-TheoPhy

@JunkaiWang-TheoPhy JunkaiWang-TheoPhy commented Jul 29, 2026

Copy link
Copy Markdown

Wander — Issue #263

The efficient move is not the one that avoids the board, but the one that finally understands it.

高效的一步并非绕开棋盘,而是终于看懂棋盘。

第二幕 · 让计算穿过物质的风暴

第十章 · 看懂棋盘,而不是绕开它

VQE 的代价从不只藏在一枚棋子里。前向收缩、反向传播、内存、路径与 ansatz 彼此改变,

高效的一步来自对整张棋盘的理解。


← 上一章:同一阵风吹向两种手性     ·     下一幕:两道阴影之间的窄光 →

Team

Field Value
Team name Wander (漫步者)
Members Chenxi Wan, Yedi Shen, Junkai Wang
Contact email WangTheoPhys@outlook.com

VQETape: differentiated co-design for exact VQE

Compile the forward contraction, reverse program, and variational ansatz as one optimization problem.

Team Wander (漫步者)
Members Chenxi Wan, Yedi Shen, Junkai Wang
Contact email WangTheoPhys@outlook.com
Track Quantum circuit simulation (qcs)
Challenge Addresses #33, “Extreme-efficiency VQE numerical simulation,” released by Shi-Xin Zhang
Public showcase JunkaiWang-TheoPhy/issue-33-extreme-efficiency-vqe

Reviewer package

The package is generated from six committed canonical JSON records:

cd tracks/qcs/solutions/WangTheoPhys/issue33
python scripts/build_submission_report.py

Demonstrated same-machine threshold

All rows use the same open-boundary TFIM workload, RTX 3090 node, seed, precision policy, energy, complete gradient, and synchronization boundaries. The declared objective is compile + first + 100 * warm median.

Implementation Compile (s) First (s) Warm (ms) Objective (s) Host RSS (MiB) NVML (MiB)
TensorCircuit-NG / OMECo 17.7799 0.2263 2.6577 18.2720 661.3 272
VQETape / statevector 28.7213 0.4025 3.3785 29.4617 462.4 272
VQETape / direct TN 45.6544 0.1376 5.0498 46.2970 575.0 274
VQETape / spatial block-2 15.5816 0.3636 8.3281 16.7781 473.9 274

The selected VQETape spatial program improves the controlled 100-step objective by 8.2% and reduces host peak RSS by 28.3%. TensorCircuit-NG's 2.6577 ms steady-state point anchors the next warm-kernel fusion objective; VQETape statevector currently records 3.3785 ms. Job-level device samples form a measured 272–274 MiB range.

Four innovations

1. Differentiated contraction programming

VQETape serializes the contraction tree, constructs algebraic transpose einsums, and measures backward FLOPs, traffic, live residuals, largest intermediates, and checkpoint choices. The reverse program becomes a selectable compiler object alongside the forward path.

2. Exact spatial-transfer lowering

The bra–MPO–ket network is lowered into first, repeated bulk, optional tail, and last programs. Only the exact boundary is carried; block width, scan, rematerialization, segmented adjoints, explicit VJPs, and guarded Z2 compression enter one search.

3. Commutator-complete adaptive ansatz

Exact insertion gradients and Fubini–Study normalization rank YZ/ZY candidates together with contraction-cost deltas. The adaptive 10-parameter circuit reaches 5.05e-11 energy error; the fixed 14-parameter control records 1.70e-7 under the same audited budget.

4. Correctness-gated auto-evaluation

Fresh processes capture compile, first, warm, host RSS, compiler memory, logical residuals, device samples, energy, and the complete gradient. A precision bridge maps the declared JAX policy into TensorNetwork's cached backend, making numerical precision an explicit reproducibility contract.

Relation to TensorCircuit-NG

TensorCircuit-NG provides a unified tensor-native computational graph, AD/JIT, slicing, and distributed execution. Its contractor stack optimizes forward time, space, and read/write objectives with OMECo and related search tools.

VQETape contributes the differentiated-program layer above that foundation: reverse contraction programs, saved-residual schedules, exact physics reductions, optimizer state, and ansatz growth share one correctness gate and measured cost vector. Joint co-design makes cross-layer exchanges directly searchable—for example, spending forward work to shrink a live tape or selecting a gate for both energy descent and boundary cost.

Validated Fig. 2 construction

The separate SU(4) runner preserves 15 * L * (N - 1) parameters, TensorNetwork FiniteTFI MPO construction, find/execute separation, slicing controls, and checksum-bound JSON path artifacts. An RTX 3080 execution at N=6,L=3 records 2.38e-7 energy error and 3.29e-7 gradient relative L2 error. The paper-comparable N=32,L=16 execution is the declared scale-up target.

Verification

  • fresh full regression: 406 tests passed, with six declared structural cases;
  • targeted TensorCircuit-NG baseline and Fig. 2 suite: 17 tests passed;
  • six canonical report inputs and 27 total evidence JSON files parse;
  • all src/vqetape modules compile;
  • 7-page A4 PDF passed text extraction and page-by-page visual QA;
  • TSV, SHA256 manifest, git diff --check, and secret-pattern scans completed.

Reproduce

cd tracks/qcs/solutions/WangTheoPhys/issue33
python3.12 -m venv .venv
.venv/bin/python -m pip install -e '.[test,baseline]'
.venv/bin/python -m pytest -q
python scripts/build_submission_report.py

The result is a reproducible exact-VQE compiler platform with two instrumented next targets: warm-kernel fusion and the validated N=32,L=16 deployment.

@JunkaiWang-TheoPhy
JunkaiWang-TheoPhy marked this pull request as ready for review July 29, 2026 17:12
Record the first audited CUDA execution of VQETape's three exact VQE representations and turn the observed GPU precision failure into an explicit, overridable fresh-worker policy.

Constraint: validate the fixed n=10, depth-4 representatives on one RTX 3090 without claiming large-scale memory scaling or victory over the external TensorCircuit-NG baseline.

Tested: three exact GPU representations, a default-versus-highest precision A/B control, an unset-parent worker-policy integration job, 24 JSON parses, source compilation, git diff checks, and 389 passed with 6 expected skips.

Confidence: high for the recorded single-workload CUDA timings, correctness, precision policy, Slurm accounting, NVML samples, and SHA256 provenance; broader GPU scaling remains open.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@JunkaiWang-TheoPhy

JunkaiWang-TheoPhy commented Jul 30, 2026

Copy link
Copy Markdown
Author

RTX 3090 precision-aware co-design milestone

The same-machine GPU study now establishes three exact VQETape execution representations under one value-gradient contract:

Representation Compile First Warm median Compile + first + 100 warm Host RSS
Statevector 28.7213 s 0.4025 s 3.3785 ms 29.4617 s 462.4 MiB
Direct TN / dense MPO 45.6544 s 0.1376 s 5.0498 ms 46.2970 s 575.0 MiB
Spatial transfer / block 2 15.5816 s 0.3636 s 8.3281 ms 16.7781 s 473.9 MiB

The controlled TensorCircuit-NG / OMECo reference records 18.2720 s on the declared 100-step objective, 2.6577 ms warm execution, and 661.3 MiB host RSS. VQETape spatial therefore demonstrates an 8.2% objective improvement and 28.3% host RSS reduction; the TensorCircuit-NG warm point defines the next fusion target.

The precision bridge is part of the compiler contract: fresh workers declare JAX_DEFAULT_MATMUL_PRECISION=highest, and the TensorNetwork cached backend receives the matching precision policy. The validated spatial execution records 3.815e-6 energy error and 9.145e-7 gradient relative L2 error.

This milestone turns representation, differentiated program, precision policy, and horizon-aware selection into one auditable search surface. Canonical JSON, SHA256 provenance, and the regenerated report package are linked from the PR body.

JunkaiWang-TheoPhy and others added 7 commits July 30, 2026 15:10
Implement a pinned same-workload TensorCircuit-NG/OMECo runner, explicit TensorNetwork JAX precision mapping, Slurm execution, machine-readable RTX 3090 evidence, and reviewer-facing comparison boundaries.

Constraint: compare the existing n=10, depth-4 RZZ/RX workload on one RTX 3090 without relabeling it as the paper's N=32, L=16 SU(4) Fig. 2 reproduction or claiming a device-memory victory.

Tested: Slurm job 23020496 completed 0:0 with strict energy/full-gradient correctness and SHA256 audit; 395 tests passed with 6 expected skips; 25 JSON reports parsed; source compilation, bash syntax, staged secret scan, link checks, and git diff checks passed.

Confidence: high for the recorded same-node timings, correctness, precision defect diagnosis, host RSS, NVML sample, and provenance; Fig. 2-scale slicing, multi-GPU execution, and large-circuit memory scaling remain open.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Implement the SU(4) find-execute protocol with checksum-bound JSON path artifacts, formal N=32/L=16 manifest defaults, a safe Slurm smoke, and reviewer-facing scale boundaries.

Constraint: treat the RTX 3080 N=6/L=3 job as a structural correctness gate only; do not relabel it as the paper's H200 N=32/L=16 performance reproduction or mix it into the RTX 3090 matched baseline.

Tested: Slurm job 23027373 completed 0:0 with direct energy/full-gradient correctness; 17 targeted tests passed; 27 JSON reports parsed; source compilation, bash syntax, staged secret scan, artifact link checks, and git diff checks passed.

Confidence: high for parameter count, SU(4) ladder construction, cotengra score semantics, safe path round-trip, and small GPU correctness; formal max_repeats=640 scale performance and paper-comparable hardware remain open.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Package the canonical benchmark evidence into reviewer-facing PDF, HTML, Markdown, TSV, and status artifacts while keeping the unmatched warm-runtime and device-memory boundaries explicit.

Tested: 17 targeted baseline and Fig. 2 tests; PDF render and text extraction; JSON, TSV, hash, source-compile, diff, and secret-pattern checks.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Close the submission checklist after publishing the reviewer bundle and replacing the existing PR body with direct artifact links and an explicit result boundary.

Tested: documentation-only diff check; prior 17-test targeted suite and artifact verification remain unchanged.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Define the approved differentiated co-design compiler narrative, positive result language, public repository architecture, PR communication, and report visual system.

Constraint: Preserve canonical benchmark numbers and JSON while strengthening reviewer-facing interpretation.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Break the approved narrative, artifact regeneration, standalone repository assembly, GitHub publication, and remote audit into concrete verified tasks.

Execution: Inline in the current task after user approval of scheme B.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Reframe Issue QuantumBFS#33 around differentiated co-design, preserve every canonical benchmark value, regenerate the Markdown, HTML, JSON, text, PDF, and manifest artifacts, and connect the public standalone repository.

Tested: Report generation, Python compilation, JSON parsing, text gates, page-by-page PDF inspection, diff checks, and 17 targeted TensorCircuit-NG baseline and Fig. 2 tests passed.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@JunkaiWang-TheoPhy JunkaiWang-TheoPhy changed the title [qcs] 🌌 Ranger: co-design VQE contraction, autodiff, and ansatz with VQETape [qcs] 🌌 Ranger: compile VQE forward, reverse, and ansatz with VQETape Jul 30, 2026
@JunkaiWang-TheoPhy

JunkaiWang-TheoPhy commented Jul 30, 2026

Copy link
Copy Markdown
Author

@fliingelephant VQETape’s complete Issue #33 delivery is ready for review.

The central contribution is a differentiated co-design compiler for exact VQE: it compiles the forward contraction, reverse program, saved-residual/checkpoint schedule, optimizer, and variational ansatz as one measured optimization problem.

Reviewer entry points

Demonstrated anchors

  • 8.2% improvement on compile + first + 100 warm versus the controlled TensorCircuit-NG / OMECo reference;
  • 28.3% reduction in host peak RSS on the same RTX 3090 workload;
  • 5.05e-11 adaptive-ansatz energy error with 10 parameters;
  • validated TensorCircuit-NG Fig. 2 construction with direct energy and complete-gradient comparison;
  • 406-test fresh full regression plus 17 targeted baseline/Fig. 2 tests.

The measured 2.6577 ms TensorCircuit-NG warm reference and validated N=32,L=16 protocol now define two concrete next objectives. All reviewer artifacts are generated from committed canonical JSON and bound by SHA256.

Replace the historical regression count with the fresh complete run and regenerate the review report, PDF, and artifact manifest from the same canonical benchmark evidence.

Tested: 406 passed, 6 declared structural skips, and 1 optional-path warning in 2069.58 seconds; all seven final PDF pages were visually inspected.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@JunkaiWang-TheoPhy JunkaiWang-TheoPhy changed the title [qcs] 🌌 Ranger: compile VQE forward, reverse, and ansatz with VQETape 🌠Wander: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape Jul 30, 2026
@JunkaiWang-TheoPhy JunkaiWang-TheoPhy changed the title 🌠Wander: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape 🌠Wander/漫步者: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape Jul 30, 2026
@JunkaiWang-TheoPhy JunkaiWang-TheoPhy changed the title 🌠Wander/漫步者: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape [QCS] 🌠Wander/漫步者: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape Jul 30, 2026
@JunkaiWang-TheoPhy JunkaiWang-TheoPhy changed the title [QCS] 🌠Wander/漫步者: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape [QCS] 🌠 Wander/漫步者: Issue #33 Compile VQE Forward, Reverse, and Ansatz with VQETape Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant