Spaces:
Sleeping
Sleeping
Commit History
-
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