Spaces:
Sleeping
Sleeping
Commit History
-
Polish pass: dedupe pipeline runners, shared chip component, emitter map
Yuchen YuanThree concrete refactors that reduce surface area for future bugs and make the codebase easier to maintain by hand or by LLM. 1. backend/app/services/workflow_service.py — run_pipeline and run_pipeline_stream used to be two 100+ line copies of the same dispatch loop. Extract a single _execute_pipeline generator and make both functions thin wrappers (one collects into a list, the other yields). Per-node dispatch (input / built-in / plugin / skipped) and the post-step circuit_shape stamping are factored into _dispatch_one_node. Plugin hydration becomes a named helper instead of an inline block duplicated on both paths. Also pulled out _clamp_shots and _set_backend_ctx so the two backend handlers share their shots-clamping and ctx-writing patterns; _cache_put's prefix_types argument becomes required (all call sites pass it; the dead 'None means skip sidecar' branch is gone); the run_cache.qpy_dump_bytes import moves to the top of the file with the …4ee621f -
Fix exported script header URL: point to jqub21-quaim space
Yuchen YuanThe exportPython header was still referencing the qudastudio-app mirror. Since we now only maintain jqub21/quaim, point users at the canonical URL.50e62eb
-
Second-order checks: export gaps, pre-flight rule, backward compat
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Audit pass after Fidelity/QuBound/Backend changes to catch the downstream code that wasn't updated. exportPython.ts — 4 gaps fixed - fake_backend + ibm_backend export: now writes the user-set shots into the generated script. - qubound export: now writes the threshold + pass/fail check + margin printout so the exported script matches the canvas's behaviour. - fidelity export: the call signature changed (returns tuple, takes unbound_param_policy). Previously called the old signature, which would have crashed on every exported pipeline. Now branches on method: * statevector: calls simpleFidelityEstimator(qc, unbound_param_policy=...) * sampled: calls sampledFidelityEstimator(qc, backend, shots=shots, unbound_param_policy=...) Tuple unpacking captured both fidelity + meta. Print line identifies which method is in use. Pre-flight rule added Fidelity in `sampled` mode needs a backend upstream — that's where the noise model and shots come from. Without a backen…adb5d6a
-
Fix 3 audit findings: export signatures, cache safety, accessibility
Yuchen Yuan1. CRITICAL — exportPython.ts CompressVQC template had 3 wrong function calls: - quadraticProgram_luttoqp(lut) → (qc, lut) - admmOptimizedCompVQC(qp, lut) → (qp) - resultsCompressVQC(qc, result, lut) → (result, qc) All verified against backend/qlib/compvqc.py actual signatures. Users who exported and ran pipeline.py would have hit TypeError. 2. MEDIUM — Step cache _cache_put now deep-copies QuantumCircuit objects via qc.copy() instead of storing references. Prevents a future handler that mutates circuit in-place from silently corrupting cached snapshots. Current handlers all reassign, so this is defensive, but the cost (one .copy() per step) is cheap. 3. MEDIUM — BlockPicker button now has aria-haspopup, aria-expanded, aria-label. Dropdown div has role="menu" and aria-label. Screen reader users can now navigate the block catalog.51365eb -
Fix build: remove unused vars in exportPython; fix setRun functional updater
Yuchen Yuan22b441d -
Feature: Export pipeline as runnable Python script
Yuchen YuanNew "Export .py" button in the canvas toolbar (Code2 icon). Generates a flat, readable Python script that reproduces the current pipeline: - Topologically sorts the canvas nodes using the edge list - For each block, emits the corresponding Python code with the actual parameter values from the canvas (iterations, lambda, rho, noise_snapshot, alpha, backend_name, etc.) - Includes import statements, parameter binding for parameterized circuits, and print statements for each step's output - Downloads as pipeline.py with a browser file-save dialog Supports all 9 block types: input_circuit, fake_backend, ibm_backend, qucad, qubound, compvqc, qshot, fidelity, output. IBM live backend generates commented-out code with instructions + a fake backend fallback. Also added to the mobile MoreMenu so the feature works on phones.90bf6ec