Commit History
-
Audit M1-M3 + minors: lineage, stopping disclosure, anon scrub
TheYuchenM1 scenarios.ts QUCAD_GRAPH is now a literal copy of bundled demo record 5c2a6a71a7a4's graph (ids n1..n5, sampled fidelity, same params/positions) instead of an s1..s5/statevector rebuild — F1/F5 runs now group with the demo cards (same config_hash) and pinned seed 336157917 replays the archived numbers bit-exactly. M2 Optional-stopping honesty in three places: limitation block at the stopping rule (qlib/qiskit_utils.py — width-based data-dependent stopping perturbs exact nominal coverage of the final fixed-n interval; confidence sequences are the rigorous alternative), one sentence in the Wave I doc section, and a clause in the precision-target tooltip. M3 Anon builds scrub the branded theme completely: generateBundle strips the [data-theme=gmu] CSS block, and theme.ts gates the stored-preference fallback behind !ANON so the key literal is dead-code-eliminated from VITE_ANON JS (runtime ?anon=1 behavior unchanged). Anon dist grep…e52951c
-
Wave I: anytime evidence steering (live CIs, optional stopping)
TheYuchenBackend: sampled fidelity always runs as B=min(8,max(2,shots//128)) batches; batch i seeded sha256(f"{node_seed}:batch:{i}") so replays are bit-exact regardless of any run's stopping point. Streaming SSE interleaves {"step_progress": {node_id, batch_i, n_batches, shots_done, successes, point, ci95}} frames (worker thread + queue in the executor; eager path unaffected). RunRequest.precision_target (CI half-width, (0,0.5]) = server-honoured optional stopping, min 2 batches; distribution records shots executed vs requested, stopped_early, and the full per-batch trace. qlib duplicates the Wilson fn (no app import from qlib); twins pinned equal by test. Frontend: toolbar precision-target select (off/±5/±2/±1pp); live narrowing CI band + shot counter on node faces from streamed frames; evidence-funnel in the fidelity card (one line per batch, opacity ramp, target ticks at point±target, early-stop annotation); RunRecord persists precision_target + stopped_early; restore/replay writes the tar…7fa375a -
Memoize fake-backend noise models; first-visit demo archive machinery
TheYuchenBackend: AerSimulator.from_backend / NoiseModel.from_backend rebuilt the full 100+ qubit device noise model on every sampled-fidelity and QuCAD step (~40-90 s of GIL-bound Python per fresh run — the dominant cost of every uncached run on the Space). Fake* snapshots are frozen, so the derived model is memoized by backend name (live IBM backends never cached). qlib/qiskit_utils.aer_simulator_for / noise_model_for. Frontend: plumbing for a bundled first-visit evidence archive — RunRecord.demo flag, lib/demoArchive.ts (ensureDemoArchive imports data/demoArchive.json via buildRunRecord on first visit only, decided flag quda-demo-decided, clearDemoRuns), DemoArchiveBanner on the Multiverse board + History tab, per-row demo chip, multiverse landing for first visits, welcome-slide tagline reframed to the evidence story. Archive JSON itself ships in the next commit (placeholder []).b84dc32 -
Seed coverage for QuBound/Qshot + cost estimates from run history
TheYuchenCloses the two remaining claim-integrity gaps for "every run is exactly replayable" over "stochastic, costly experiments": Seeds. QuBound trains its LSTM on BOTH ok paths (live IBM history and the cached 14-day pickle) — there is no precomputed-only branch in the handler — so both now seed the global RNGs (_seed_stochastic_libs: random + numpy + lazily-imported, try/except-guarded torch) and thread node_seed into qlib (Aer seed_simulator + Sabre seed_transpiler in get_labels_fromNoise); results carry nondeterministic=True + seed_used. Qshot's pilot seed was 99991 + hash(str(base)) — str hashes are PYTHONHASHSEED-salted, i.e. "fixed" only until the next server restart. pilot_seed is now threaded predict → recommend_shots → compute_pilot_pf, making the recommendation reproducible across processes given the seed. Executor cache logic untouched: fresh runs draw fresh node seeds (honest new draw, cache-bypassed), pinned runs re-derive the same seeds (cacheable in the seed-salted namespace)…91b2cd9 -
Provenance core: run identity, replayable seeds, distribution payloads
TheYuchenPhase 0 of the evidence-workbench rework. Every run now gets a server-stamped provenance envelope (run_id, seed_mode, root_seed, app_version) in both the eager and SSE routes; the SSE stream opens with a run_meta event. Every run draws a root seed even when the caller doesn't pin one, so any historical run is replayable later by sending its recorded seed back. Per-node seeds derive from sha256(root_seed, node_id) — independent of execution order and of unrelated graph edits, keeping A/B comparisons honest. Sampled fidelity accepts the seed (seed_simulator) and reports a structured distribution payload: binomial successes/shots, Wilson 95% CI, top-16 outcome histogram. Cache semantics: seed-pinned runs live in a salted cache namespace and may cache stochastic steps (reproducible by construction); fresh runs keep today's namespace and the nondeterministic bypass. Precomputed disk-cache responses are never served for pinned runs. 19 new unit tests (seed derivation, Wilson edges, salted…2efd890
-
QuBound: stop mutating caller's QuantumCircuit + handler defensive copy
Yuchen YuanQuBound's get_labels_fromNoise called qc.measure_all() in place to attach measurements for the Aer shots that train the LSTM. The comment said 'caller doesn't reuse qc after this point' — but the pipeline runner does: ctx['circuit'] points to the same object, so the measurement register leaked into every downstream step. Reproduction on the live server (ry_chain_6q → QuCAD → QuBound → Qshot → Fidelity → Output): Qshot crashed with 'ValueError: invalid literal for int() with base 2: "110100…"' because the counts string suddenly had a 'classical_register meas' delimiter splitting it. Two-layer fix: 1. qbound.get_labels_fromNoise now copies qc before measure_all. 2. _handle_qubound also copies ctx['circuit'] defensively when num_parameters == 0 (when >0, assign_parameters already returns a fresh circuit). Belt + suspenders so any future in-place mutation deeper inside QuBound still can't leak. Audited sampledFidelityEstimator and qshot recommender — both already copy…1c02f7a
-
Fix Fidelity on parameterized circuits + QuBound threshold + Backend shots
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Three user-reported issues, all addressed with proper logging and actionable error surfaces. Issue 1 — Fidelity crashed on parameterized circuits simpleFidelityEstimator used Statevector.from_instruction(qc), which refuses circuits with unbound parameters. ry_chain_6q has 12 such parameters; Fidelity throw "TypeError: Parameter expression with unbound parameters … is not numeric" which surfaced as a generic "unexpected error" in the result card. The estimator now takes an `unbound_param_policy` argument: * "bind_zero" (default) — auto-binds free params to 0, matching the convention QuBound already uses internally, and reports `bound_unbound_to_zero: N` in the summary so the user sees what we did. * "error" — refuses and raises UnboundParametersError with the actionable message naming the offending param count and suggesting the upstream fix. _handle_fidelity catches UnboundParametersError specifically and maps it to a clean error step (the message is shown v…286193c
-
Neutralise dev-process metadata in code comments
Yuchen YuanEarlier audits caught keyword-level leaks (tokens, paths, emails). This pass goes one level up: comments throughout the codebase narrated the project's history — "Jovin's Streamlit prototype", "the handover snapshot", "Jovin's old prototype's flowChartProto", "Batch 2 circuits", etc. — which read like internal team notes rather than product code, and exposed the development trajectory (research handover → rewrite → packaging) to anyone reading the public repo. Replaced or trimmed the offending comments while keeping legitimate attribution (e.g., "author: Tong Li" in qshot/__init__.py docstring). No behavior change: docstrings + line comments only. Files touched: - qlib/qiskit_utils.py – module docstring rewritten - qlib/qucad.py – default-config attribution generalised - qlib/compvqc.py – "the original prototype did..." → factual - qlib/qshot/__init__.py – "handover snapshot" → "reference code" - app/services/workflow_service.py – Qshot docstring de-narrated - a…fa87757 -
Strip third-party PII from Qshot package
Yuchen YuanTwo leaks the prior meta-info sweep missed because they sat inside Qshot's bundled handover snapshot rather than QuAIM's own code: - backend/qlib/qshot/__init__.py docstring credited the upstream author with both name and @gmu.edu email. Drop the email; project convention (DevelopersPopover) is to use external profile links rather than raw academic emails. - backend/cache/qshot/data/noise_json/ibm_pittsburgh_representative_*.json carried "source_file" pointing at a third party's home directory on some lab server (/home/<user>/Shots/fid_idea/create_circuit/...). The marrakesh JSONs already used a bare basename; align the pittsburgh files to the same shape. The field is metadata only — not read by recommend_shots_v4 at runtime — so pipeline behavior is unchanged. Verified by greping qlib/qshot for "source_file": no matches. Both values are already public via prior commits/pushes; these edits just stop new git-blame hits and remove the strings from the live checkout.8844b54
-
Integrate Qshot (noise-aware shot-count recommender) as a pipeline block
Yuchen YuanNew research block from the JQub lab (handover from Tong Li). Given a QuantumCircuit + an IBM calibration snapshot + a target fidelity α, Qshot predicts the minimum shots needed to reach α × F_converged on that backend. Backend: * qlib/qshot/ — handover package (recommend_shots_v4, dual_gnn_model, show_dag, train_dual_gnn) + new __init__.py wrapping lazy singleton and NOISE_SNAPSHOTS registry. GNN-fallback lazy imports converted to package-relative so it works as a proper Python package. * cache/qshot/ — 12 dataset dirs (~3.3k records) + best_model.pt (LFS). * _handle_qshot in workflow_service: binds free circuit parameters to zero (Aer constraint), calls singleton.predict, surfaces shots / fidelity ± std / fit parameters / pilot measurements in summary. * NodeType += "qshot"; dispatcher wired. * requirements += hdbscan, torch-geometric, pylatexenc. torch-scatter / torch-sparse NOT pinned — PyG falls back to pure-Python scatter without them, far simpler on HF Spaces. Fr…fd88622 -
qlib: cleanup pass — docstrings, type hints, constants, logging
Yuchen Yuan +1: Claude Opus 4.7Non-behavioral changes aimed at making qlib/ less intimidating to new contributors picking up JQub algorithm code: - Add module-level logger and replace scattered print() calls with logger.info / logger.debug so the live service stops dumping to stdout and precompute runs can be tuned via logging config. - Hoist hardcoded hyperparameters to named module-level constants: HISTORY_WINDOW_DAYS, CONFIDENCE_LEVEL, LSTM_* in qbound; QUCAD_DEFAULT_*, TWO_QUBIT_GATES, COBYLA_MAXITER in qucad; DEFAULT_THETA_GRID, LAMBDA_PENALTY, DECISION_THRESHOLD in compvqc. These were previously scattered inside function bodies. - Add type hints + docstrings to public functions used by workflow_service (call_QuBound, run_qucad_training_noisy, get_LUT, admmOptimizedCompVQC, etc.) and to internal helpers. - Remove commented-out dead code: abandoned transpile variants, debug prints, old example circuits. - qiskit_utils: prune unused helpers (display_circuit, qasmFile_toCircuit, transpile_…0571b1a
-
Initial JQub Quantum Flow demo
Yuchen Yuan- FastAPI backend serving QuCAD / QuBound / CompressVQC as a topologically-sorted pipeline under /api/workflow/run - React + Vite + React Flow frontend with drag-and-drop node palette - 14-day offline cache of ibm_fez calibration so the demo runs without an IBM Quantum token - Two-stage Dockerfile targeting HuggingFace Spaces (port 7860) Algorithms by Jovin Antony Maria (JQub); web refactor by Yuchen Yuan.1ee2bb3