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 sampled fidelity being frozen by the per-node step cache
Yuchen YuanThe SSE run path caches each step's StepResult+ctx snapshot keyed on the pipeline prefix. For deterministic blocks (statevector fidelity, QuCAD output, etc.) that's a feature: re-runs reuse the trained model or computed metric. For sampled fidelity it was a silent scientific bug — the first shot draw got frozen and replayed forever. Reproduced live: 5 SSE runs of bell + FakeFez + fidelity(method=sampled) returned identical 0.5938 with from_step_cache=true after the first run. Fix: handlers can mark a StepResult as nondeterministic. The stream loop carries a sticky flag — once a nondeterministic step is emitted, both cache lookups AND cache puts are disabled for the rest of that run, including all downstream steps (their ctx depends on the fresh draw, so a lookup hit would restore a contradictory state). Frontend renders a 'live' chip on those steps so users know the cache is intentionally bypassed. Statevector fidelity is unchanged (still cacheable). QuBound / Qshot / QuCAD are als…b3ebd47 -
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 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
-
Canvas becomes data-aware: shapes, headline metrics, perf tint, pre-flight
Yuchen Yuan +1: Claude Opus 4.7 (1M context)After a Run, the canvas itself shows what's happening at every node and every edge — instead of just being a connection diagram with the real numbers banished to a sidebar. circuit_shape on every StepResult (backend) StepResult schema gains a CircuitShape sidecar field ({num_qubits, depth, size, num_parameters}). workflow_service snapshots ctx["circuit"] AFTER every successful handler and attaches it to the step. Built-in handlers and plugin steps both populate; ctx-less steps (source plugins with no upstream, errored steps) leave it as None. Edge data-flow labels (frontend) styledEdges memo in FlowCanvas reads the SOURCE node's circuit_shape and attaches a tiny monospace label to the React Flow edge: "5q · d8 · 17g". Falls back to no label when the source step doesn't have a shape (no run yet, or source errored). Drop-target highlight during drag-to-insert composes on top. Per-node headline metric + duration chip + tone (frontend) New lib/headlineMetric.ts table picks the most r…33e7bee -
Global code-quality polish: DRY + named constants + leak cleanup
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Targeted refactor pass based on a structured audit. Pure maintainability wins; no behaviour changes. Frontend: collapse 8 popovers into one hook 8 components (AuthButton, ThemeSwitcher, MoreMenu, PapersPopover, SupportPopover, DevelopersPopover, BlockPicker, PresetPicker) each carried an identical 16-line "close on mousedown + Escape" effect block. Extracted to lib/useDismissOn.ts; ~150 lines deleted, one hook to audit instead of eight. useDismissOn(open, rootRef, useCallback(() => setOpen(false), [])) Behaviour is intentionally identical to the inlined block so older git-blame on the call sites stays coherent. Backend: consolidate effective-user-id resolution routes/plugins.py and routes/workflow.py each carried a subtly different implementation of "session cookie wins over query_user_id, anon hf_ prefix is reserved". Pulled into auth_service.resolve_effective_user_id(request, query, *, required). - required=True path raises ValueError → routes/plugins maps to 400 - required=…57f0b3e -
Mobile + large-touchscreen UX overhaul
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Addresses a 15-finding audit covering viewport handling, safe areas, touch behavior, hit-target sizing, and iOS Safari quirks. Viewport + PWA chrome - viewport meta gains viewport-fit=cover + interactive-widget= resizes-content so safe-area-inset(*) applies and the iOS keyboard triggers layout reflow instead of just overlaying content. - theme-color set for light + dark via prefers-color-scheme media queries — browser chrome now blends with our surface instead of flashing white. apple-mobile-web-app-* meta + apple-touch-icon let the app feel native if added to home screen. - New /public/manifest.webmanifest registered, minimal but sufficient for installable-PWA detection. Dynamic viewport (100dvh) - App.tsx root: h-screen → 100dvh inline (with fallback). Was clipping ~80px under iOS Safari's collapsing address bar on first paint. - UploadPluginModal max-h moved from calc(100vh-2rem) to calc(100dvh-1rem) + safe-area-inset-bottom padding so the modal fits even whe…5c7eb51 -
Display fix + focus trap + mobile touch drag-to-edge-insert
Yuchen Yuan +1: Claude Opus 4.7 (1M context)DevelopersPopover layout fix When Yuchen Yuan's row gained a second link chip (LinkedIn), the single-row "icon + truncated name + chip + chip" layout squeezed the name down to its first letter ("Y") inside the 320px popover. Restructured to two rows per person: name on top (full width, no truncation), link chips below with flex-wrap. Single-link entries still look natural — the chip row simply contains one chip. Focus trap for modals + drawers New lib/focusTrap.ts useFocusTrap hook implements WAI-ARIA Authoring Practices for dialog focus management: - On open, focus moves into the container (prefers the container itself if tabIndex=-1, else first focusable child). - Tab from the last focusable wraps to first; Shift+Tab from first wraps to last. - Defensively re-routes focus into the container if something else steals it (e.g. async overlay). - Caller restores focus on close — we already do this for the upload modal and auth dropdown via their existing openerRef pattern. App…defa0ba -
Plugin output: typed figures (markdown / table / bar / svg / png)
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Plugins can now emit a list of typed visual outputs beyond the flat summary dict. Each figure is a small JSON object with a `type` field; the result card renders them inline below the summary table. Five types ship today - markdown — headings, lists, bold/italic/code, fenced code blocks. Raw HTML is rejected by the backend; the frontend renderer never reaches for dangerouslySetInnerHTML on this path. - table — headers (≤ 12 cols) + rows (≤ 100 rows), primitives only. - bar — inline SVG bar chart, up to 50 bars, zero JS deps. - svg — escape hatch with sanitisation: rejects <script>, javascript:, <foreignObject>, <iframe>, <object>, <embed>, and any on*= event-handler attribute. Up to 256 KB. - image_png_b64 — base64-encoded PNG, ≤ 1 MB decoded, must have the PNG magic bytes (JPEG/GIF/other formats rejected). Each figure also accepts an optional `title` (≤ 120 chars) rendered as the panel header. Total `figures` list capped at 10 entries. Backend - New plugin_run…725a720
-
Drag-to-insert + plugin lifecycle UX fixes
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Drag-to-insert (new feature) When the user drags a block from the palette and the cursor passes within ~60 flow-units of an existing edge, that edge lights up with an accent-coloured dashed animation. Dropping the block onto a lit edge splices it in: the old edge is removed and replaced by two new edges (upstream → new node, new node → downstream). Implementation: - New _findClosestEdge_ helper does line-segment-distance hit testing against every edge's source-right-center → target-left-center approximation. Threshold is in flow coordinates so it scales with zoom. Falls back to default 200x56 node footprint when React Flow hasn't measured yet. - _onDragOver_ checks for the palette's `application/reactflow` data type and computes the closest edge each frame, setting dropTargetEdgeId. - _onDragLeave_ clears the target so the dashed highlight doesn't linger if the user abandons the drag outside the canvas. - _onDrop_ captures dropTargetEdgeId, clears it, then either splices…dca3016 -
Multi-user: HF OAuth login + per-user plugin persistence
Yuchen Yuan +1: Claude Opus 4.7 (1M context)What this lets users do - Anyone can click "Sign in" in the top bar and authenticate with their Hugging Face account (OpenID Connect via the HF OAuth flow). No account creation, no password management on our side. - Each signed-in user gets their own private namespace for uploaded plugins. Other users (and other browsers from the same person) cannot see them. - Plugins uploaded while signed in are mirrored to a private HF Dataset repo (qudastudio/quda-user-data) so they survive container restarts and follow the user across devices. - Guest (anonymous) mode is fully preserved: visitors can still drop a .zip without signing in; those plugins continue to live in /tmp and are per-browser, exactly as before. Architecture Browser ──cookie──▶ FastAPI ──HfApi──▶ HF Dataset (private) │ └──▶ /tmp (volatile cache) Identity = session cookie's hf_<username> (when signed in) ∥ anon UUID query par…b6faf15 -
Polish pass on plugin Upload modal
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Detail review surfaced four small but meaningful items. Storage listener over-fires (App.tsx) - Was triggered by any quda.* key — included pane widths, theme, live-IBM toggle. Tightened to e.key === "quda.pluginsRev" so only actual plugin upload/delete events refetch. bumpPluginsRev() already writes that exact key. Duplicate-install regex collision (UploadPluginModal) - /already have a plugin/i matched both the per-kind duplicate AND the 5-plugin cap message, so a user at cap who clicked Install on a sample saw a green success banner. Tightened to /already have a plugin with kind=/i so only the idempotent case surfaces as a friendly hint; the cap is now an honest error. - Added a Content-Type guard after the example zip fetch so a captive portal serving an HTML 200 surfaces "got <type>, not a .zip" instead of the confusing manifest-parse error from the backend. Modal UX restructure - Examples-first ordering when installedPlugins.length === 0 — a first-time visito…4d0158a -
Bundled example plugins + UX polish from second audit pass
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Lets users try the plugin upload flow end-to-end without writing one from scratch: the Upload modal now shows a "Try with a sample" section that fetches /api/plugins/examples and offers per-example Install + .zip download buttons. Backend: - New read-only GET /api/plugins/examples returns minimal metadata parsed from each bundled zip's manifest.json (label, family, tagline, color, size). Catalog is empty if the examples dir is missing. - New read-only GET /api/plugins/examples/{name}.zip returns the raw zip bytes. Name is constrained to `^[a-z][a-z0-9_]{0,30}$`; resolved path must stay inside the examples dir (defence in depth against symlink shenanigans). 400 on bad name, 404 on missing or escaped path. - manifest.json read inside the zip capped at 64 KB so a malformed bundled example can't allocate unboundedly. - Defensive comment about route ordering vs the path-param DELETE. - Dockerfile COPYs example_plugins/ into the runtime image so the endpoints have content to s…ef8bb5f -
Plugin protocol Phase 4: full UI integration
Yuchen Yuan* lib/nodeCatalog.ts — `synthesizePluginSpec(manifest)` builds a NodeSpec on the fly from a backend-served PluginManifest. `resolveNodeSpec(kind, plugins)` is the new single source of truth for spec lookups: returns the built-in spec if available, otherwise the synthesized plugin spec, otherwise undefined. Adds PluginNodeSpec (NodeSpec + isPlugin/initials/pluginColor). * UploadPluginModal.tsx — drag-drop or click-to-pick .zip, posts to /api/plugins/upload with the browser's anonymous user_id, surfaces backend validation errors verbatim, refreshes the in- store plugin list on success. Inline docs spell out the manifest + handler.py contract. * NodePalette — new "Upload" button next to "Add blocks"; merges plugin specs with NODE_CATALOG before filtering by search / family chips. Plugin tiles render with the manifest's color + first-letter badge instead of a Lucide icon, and grow an X delete affordance on hover (with confirm dialog). * BlockPicker — same merge…74b7708 -
Plugin protocol Phase 3: frontend foundation
Yuchen Yuan* lib/userId.ts — anonymous browser ID stored in localStorage. Uses crypto.getRandomValues for a 16-byte hex string; falls back to Math.random if Web Crypto is unavailable. Matches the backend regex [a-zA-Z0-9_-]{8,64}. * lib/api.ts — three new endpoints (listPlugins / uploadPlugin / deletePlugin) and a PluginManifest type. RunRequest gains an optional user_id field so workflow runs can address the right user's plugins. * lib/store.ts — Zustand state for the current user's plugin list (refreshed on App boot, after upload, and after delete). * App.tsx — on boot, fetch this browser's plugin manifests in parallel with the health probe. Silent failure (just no plugins shown if /api/plugins is unreachable). * FlowCanvas.tsx — include getUserId() in the run-stream request payload so the backend can dispatch unknown node types to this user's plugins. No UI for upload yet — that's Phase 4. After this commit, refresh the live Space and a plugin uploaded directly via curl …10b580f -
Remove Parameter Sweep feature
Yuchen YuanReverts all 8 files involved in the sweep feature (per user request): - Delete SweepDialog.tsx - Remove Sweep button + state + dialog mount in FlowCanvas - Remove Sweep entry + props from MoreMenu (mobile) - Drop Sweep mention from TrySlide power-features strip - Drop Sweep mention from NextStepsHint in ResultsPane - Remove SweepConfig/SweepRequest/SweepRunResult types + sweepStream method from api.ts - Remove /api/workflow/sweep endpoint from backend routes - Remove SweepConfig/SweepRequest/SweepRunResult/SweepResponse from backend schemas The per-node intermediate cache stays — it was originally built as groundwork for sweep but is independently useful for re-running modified pipelines.44acddd -
Polish: unified value prop, error-message location hints, next-steps guidance
Yuchen YuanFour UX-audit follow-ups: 1. **Value-prop consistency**: WelcomeSlide's opening paragraph replaced. Was "A visual playground for research algorithms" — conflicted with README's "Interactive workflows for quantum system deployment" and TopBar's "Quantum Design Automation Studio" subtitle. Now leads with the QuDA acronym expansion + the canonical "interactive workflows" tagline, then explains the lab context underneath. All three surfaces (TopBar / WelcomeSlide / README) now agree. 2. **Error messages point at UI**: "Pick a circuit first" now also bumps a Zustand counter that App.tsx watches; the left CircuitPicker pane auto-expands (desktop) or its drawer slides open (mobile) so the user can SEE where to act. The message itself names the pane explicitly. "Canvas is empty" now mentions all three ways to add blocks (drag / Add blocks dropdown / preset). 3. **Cross-feature guidance**: After a successful run, ResultsPane shows a subtle "Where to …974ac89 -
Tour + mobile parity: address UX audit findings
Yuchen YuanUX audit found: 1. Tour didn't mention Export .py, Sweep, or BlockPicker (all shipped after the tour was last updated). 2. Sweep & Export were hidden on mobile (toolbar md+ only, not in MoreMenu). 3. TrySlide "What to try first" list was static text — users had to manually find samples + presets. Fixes: - MoreMenu: add Sweep entry alongside Auto-connect / Share / Export / Clear so mobile users can reach the parameter-sweep feature. - TrySlide: the 4 "What to try first" lines are now clickable buttons. Each loads its (preset, sample) combination via a new Zustand quickStart bridge and closes the tour. The bridge mirrors the existing pendingBlockKinds pattern. - TrySlide: new "Once you've got results" strip explicitly introduces Sweep and Export .py as the power-user features — these were completely undocumented before this commit. - TrySlide: "Build your own" now mentions Add blocks (multi-select dropdown) alongside drag interaction. - FlowCanvas.loadPreset: acce…82f6435 -
Feature: parameter sweep with comparison chart
Yuchen YuanBackend: - New POST /api/workflow/sweep SSE endpoint. Accepts a base pipeline + SweepConfig (target node_id, param_key, list of values up to 50). For each value, patches the target node's data and runs the full pipeline. Yields one SweepRunResult per value. - Schemas: SweepConfig, SweepRequest, SweepRunResult, SweepResponse. - Leverages the existing per-node intermediate cache: prefix steps upstream of the swept block are reused across all sweep iterations. An N-value sweep of the last block's parameter costs roughly N * (last-block runtime) instead of N * (full-pipeline runtime). Frontend: - New SweepDialog modal. UI flow: 1. Picks the target: auto-discovers all numeric NodeParamSpec entries on the canvas (QuCAD iters/lam/rho, Qshot alpha, etc.) 2. User sets start, end, steps (2-20) → preview of computed values 3. Click "Run sweep" → streams results from /workflow/sweep 4. Renders a line chart (param value on X, output metric on Y) plus a data table. Met…fead27e -
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 -
Feature: per-node intermediate result cache
Yuchen YuanBackend: - In-memory LRU cache (200 entries) keyed by pipeline-prefix hash. The prefix hash covers (circuit QPY + all node types & params up to the current step). If the user changes only the last block, all preceding steps return instantly from cache (~0ms) instead of re-running (saves minutes for QuBound LSTM / Qshot HDBSCAN). - After each step, a shallow copy of the ctx dict is cached alongside the StepResult. On cache hit, ctx is restored so subsequent steps can pick up where the cached prefix left off. - Cached steps are flagged with from_step_cache=True (new optional field on StepResult) so the frontend can distinguish them. - Cache is process-scoped and resets on container restart. LRU eviction at 200 entries prevents unbounded memory growth. Frontend: - StepResult type extended with optional from_step_cache. - Results pane shows a small "cached" chip on steps served from the intermediate cache, so users can see which steps were instant. Works with the SSE st…1e3019d -
Fix build: remove unused vars in exportPython; fix setRun functional updater
Yuchen Yuan22b441d -
Feature: SSE streaming for real-time pipeline progress
Yuchen YuanBackend: - Add run_pipeline_stream() generator in workflow_service.py that yields each StepResult as it completes instead of collecting all. - Add POST /api/workflow/run-stream SSE endpoint in workflow.py. Cache hits emit the full RunResponse as one event + [CACHED] sentinel. Cache misses stream individual step events + [DONE]. Frontend: - Add api.runStream() in api.ts: uses fetch + ReadableStream to parse SSE events incrementally. - FlowCanvas.runPipeline() now uses the streaming endpoint. Each step appears in the Results pane as soon as it finishes, so the user sees "Step 1: Input circuit... done" while Step 2 is still running, instead of staring at a blank spinner for 2+ minutes. - On cache hit, the full response arrives instantly (same UX as before). On stream error, falls back gracefully with an error toast. The old POST /api/workflow/run endpoint is unchanged for backwards compatibility and the precompute script.02d0eb5 -
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 -
Polish pass: brand cleanup, popover consistency, mobile safety
Yuchen YuanAudit-driven fixes: 1. Branding: - Dockerfile comment: QuAIM → QuDA Studio - package.json name: jqub-quantum-flow-ui → quda-studio-ui - All localStorage keys: jqub.* → quda.* (theme, pane widths, collapsed state, IBM toggle, tour flag). Existing users will see fresh defaults on first visit (acceptable — the old Space URL is gone anyway so there's no continuity to preserve). 2. Popover consistency: - All 4 popovers (Papers, Developers, Support, BlockPicker) now share z-40 instead of a mix of z-30 and z-50. - BlockPicker gets the same mobile-safe positioning as the other three: fixed left-3 top-14 on narrow screens, absolute on ≥sm. - BlockPicker width clamped with min() so it can't overflow on narrow viewports. 3. Pre-hydration script in index.html updated to read quda.theme instead of jqub.theme.95967ab
-
NodePalette: checkbox multi-select + batch add to canvas
Yuchen YuanThree ways to add blocks now: 1. Drag a tile onto the canvas (unchanged). 2. Click the checkbox (top-left corner of tile) to select, then hit the "Add N to canvas" button that appears in the header. All checked blocks are created on the canvas in family order and auto-connected in one shot. 3. Hover a tile and click the + icon (top-right) to add just that one block instantly. Implementation: - NodePalette tracks a `checked: Set<NodeKind>` state. Checked tiles get an accent border + filled checkbox. - On "Add to canvas", NodePalette pushes the ordered list of kinds to `useApp.addBlocksToCanvas(kinds)` (new Zustand store field). - FlowCanvas watches `pendingBlockKinds` via useEffect: creates nodes positioned to the right of existing ones, merges them into the canvas, auto-connects the whole graph, shows a toast with any warnings, and fitViews to show all nodes. - Zustand bridge avoids restructuring the component tree (NodePalette and FlowCanvas are siblings, not …d9a330d
-
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 -
Auto-connect: per-algorithm backend warnings; tour drift fixes
Yuchen YuanAuto-connect was using a single blanket "algorithms that need a noise model will error at run time" warning for any canvas missing a backend. That's only true for QuCAD; QuBound and CompressVQC silently fall back to FakeFez, and Qshot ignores ctx["backend"] entirely (uses its own bundled noise snapshots). Replace the blanket line with per-algorithm advisories driven by an ALGO_BACKEND_DEPENDENCY table: - qucad: "required" (hard error without backend) - qubound, compvqc: "optional" (soft fallback to FakeFez) - qshot: "ignored" (warns the OTHER way: backend wired in front of a qshot-only chain is dead weight) Also drop the misleading "noise profile" dashed-edge label on backend → qshot edges (the edge has no semantic meaning for qshot). Backend → qucad/qubound/compvqc still gets the dashed sidechain styling. Tour slides drifted relative to the current four-algorithm lineup: - WelcomeSlide named only QuCAD/QuBound/CompressVQC; add Qshot. - PipelineSlide split algorithms into "mutate c…2316315 -
Param hints: explain what each control does in plain language
Yuchen YuanEvery editable param now has a hint that tells the user (a) what the control actually means and (b) which way to push it for which effect. Previously fake_backend's dropdown showed 'FakeFez · 156q (Heron r2)' with zero context — a non-quantum reader had no idea Heron was a chip family or why three options exist; Qshot's snapshot dropdown was even worse, listing dates with no explanation of what a 'snapshot' is or why dates differ. New hints, all under one line: * fake_backend.backend_name → 'Each option is a simulated copy of a real IBM chip. The choice mainly affects which gate-error rates and qubit connectivity the noise model uses.' * qshot.noise_snapshot → 'A real IBM chip's calibration captured on a specific date — different days have different noise levels, so the recommended shot count shifts too.' * qshot.alpha (was 'fraction of converged fidelity to hit', a domain-of-art phrasing) → 'Fraction of the best-possible accuracy you want. 0.95 = aim for 95% — higher me…cadac03 -
Param editor collapses by default; misc review-driven cleanups
Yuchen YuanUser feedback: a tunable block shouldn't default to a fully expanded form on the canvas — that pushes the block visually big and clutters a multi-block pipeline. Default the param editor to a single-line disclosure with a chevron + a one-line summary of current values; the full editor only renders when the user clicks to expand. * QNode now owns local `paramsOpen` state (not in node-data — it's a pure UI affordance, shouldn't pollute share-links or auto-connect output). Header row shows `chev > params: <summary>`. Click toggles. * New `summariseParams()` helper builds the short summary from the schema: select values stay as their short keys (`pittsburgh_1`), numbers respect each param's `displayPrecision`. Kept under ~30 chars so it fits the block width. Three issues from an independent review of the recent Qshot work: * CRITICAL: workflow_service `_default_label()` was missing `"qshot"`, so step results in the right pane displayed lowercase "qshot" instead of "Qshot".…b89f3b2 -
Qshot preset: auto-load ry_chain_6q so default lands in 5-8q range
Yuchen Yuanbell_state (2q) is the global default circuit — perfect for QuCAD / QuBound demos but immediately trips Qshot's GNN-fallback path because it's outside the 5-8 qubit training distribution. New users picking the Qshot preset would see the warn-banner version of the result and think 'is this thing actually working?'. Add an optional `defaultCircuit` field on PipelinePreset that, when present, triggers a sample-load alongside the node/edge swap. Set it to `ry_chain_6q` for the Qshot preset only — every other preset keeps the user's current sample, since QuCAD / QuBound / CompressVQC are happy with whatever's loaded. Skip the round-trip when sampleKey is already on the target.088ad4b -
Generalise inline param editor; tunables for QuCAD + fake_backend
Yuchen YuanThe Qshot block had a hand-written inline editor; promote it to a schema-driven component so other blocks can opt in by listing `params: NodeParamSpec[]` in their NodeSpec — no per-block wiring. The single rule for what becomes user-tunable: it has to be an actual function argument on the algorithm's public API (Qshot.predict args, QuCAD's run_qucad_training_noisy args, fake_backend handler's backend_name lookup). Module-level constants the original author tuned during training stay locked — exposing them would invalidate bundled state. What's now tunable from the canvas (in addition to Qshot): * QuCAD — three ADMM hyperparameters: - `iterations` (1..20, default 3) — more = sparser pruning, slower - `lam` regularisation strength (1e-4..0.05, default 0.005) - `rho` ADMM penalty (10..5000, default 500) Inline hints flag the trade-off direction. * fake_backend — 3-way dropdown over the Heron-family fakes the backend handler can actually load: FakeFez (default) / FakeMarrak…94039f2 -
Qshot copy: tighten 4 claims an independent fact-check flagged
Yuchen YuanIndependent review against author source code + README found no hallucinations but four phrasings that a quantum researcher would read as imprecise marketing-speak. Tighten each: * nodeCatalog description — "minimum number" is misleading because Qshot's solver targets `mean − z·σ ≥ α·F_conv` with z=1.645 (≈90 % CI), not an unconditional minimum. Replace with "smallest shot count that meets a target fidelity bound (with statistical confidence, z=1.645)". * AlgorithmsSlide detail — "pre-measured records" was ambiguous about provenance. The 3.3k records were measured on AerSimulator under bundled IBM noise models, NOT on real IBM hardware. Replace with "simulator-measured fidelity curves (under bundled IBM noise models)". Also "hits a target fidelity" → "achieves a target fidelity bound" (matches the >= comparator). Also generalise the GNN-fallback trigger from "outside 5-8 qubit range" to "no cluster matches — typically outside 5-8q OR unusual structure" (the READ…9a9b067 -
Qshot UI surface: in-block param editor + tour slide card
Yuchen YuanUser-tunable knobs the author exposes via QshotRecommender.predict(): - noise_snapshot — six bundled IBM calibration snapshots - alpha — target fidelity fraction, clamped [0.50, 0.99] Everything else in predict() (k_struct, k_pf, pilot_points, pilot_reps) is a model hyperparameter the author tuned during training; touching those would invalidate the bundled clusters, so they're deliberately NOT exposed. Frontend: * New `frontend/src/lib/qshotSnapshots.ts` mirrors the backend registry. Six entries, ordered Pittsburgh × 3 → Marrakesh × 3, default `pittsburgh_1` (matches example_usage.py). * `QNode` gains a `QshotParamEditor` rendered in place of the static param read-out when `kind === "qshot"`. Dropdown for the snapshot, number input for alpha (HTML constraint min/max + JS clamp on the way in for safety). Wrapper carries the React Flow `nodrag` class so dragging the dropdown to make a selection doesn't get hijacked as a node-move gesture. Other node kinds (QuCAD / Q…f6e5d82
-
Qshot UX polish: flag GNN-fallback results, drop meaningless -1s
Yuchen YuanObserved on HF after first end-to-end run: bell_state (2q) was out of Qshot's 5-8q training distribution, so it took the GNN fallback path. The UI then showed the user 'Cluster: -1 / Tier: -1 / PF-matched neighbours: 0' — correct Qshot internals but unintelligible to a user who doesn't know that -1 is the outlier sentinel. * When method==='gnn_fallback', suppress the cluster/tier/neighbours line entirely and surface a warn-toned banner that says 'extrapolated via GNN because the circuit is outside the validated 5-8 qubit range — treat as a best guess'. * Update the Qshot preset tagline to 'try ry_chain_6q' so new users load a 5-8q circuit by default instead of hitting bell_state and getting surprised by the fallback warning.dca9772 -
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 -
Extract MoreMenu into its own file; make Light the default theme
Yuchen YuanTwo unrelated cleanups rolled into one commit. --- 1. Extract MoreMenu into components/MoreMenu.tsx FlowCanvas.tsx had crept to 626 lines after the toolbar responsive pass, overshooting the ~350-line ceiling the Wave 2 handover cleanup set. The inline MoreMenu component was the biggest blob (~130 lines including its own outside-click/Escape effect and menu-item data table), and it has nothing to do with React Flow state or pipeline execution — it's a self-contained mobile overflow menu. New file: `components/MoreMenu.tsx` (172 lines, includes new responsive guard — see point 2). FlowCanvas drops to 487 lines; still a little fat (CanvasToast is the next candidate), but back in the reasonable range. Also slipped in: a matchMedia guard for the case where the user opens the menu on mobile, then stretches the viewport past the `md` breakpoint (768px). Before this commit the React `open` state stayed true while the menu's wrapper became `display:none`; if the user later shrank the viewpo…8f72426 -
Toolbar responsive pass + Jovin-style noise-profile sidechain styling
Yuchen YuanThree interrelated fixes to the canvas toolbar and auto-connect output. --- 1. Three-tier responsive toolbar so the row never runs out of space. Previously the toolbar was a flat row of buttons whose labels started disappearing below 640px (`hidden sm:inline`) while other labels stayed, producing the inconsistent look in the earlier screenshot ("Clea" half- truncated, Auto-connect/Share icon-only, Load preset still full text). Worse, on a real phone (~390px) the row was just over-wide. New tiers: * ≥ lg (1024px) - every button shows icon + label. * md – lg - Auto-connect / Share / Clear collapse to icon-only. Load preset + Run pipeline keep their labels. * < md - Auto-connect / Share / Clear fold into a single "⋮" More menu (new inline MoreMenu component). Run pipeline also drops its label, becoming just the play icon. Load preset shows Layers icon only (text …4f6e441 -
Add Auto-connect button: one-click sensible wiring
Yuchen YuanA user drops a handful of blocks onto an empty canvas and often has no idea which handle connects to which. Clicking "Auto-connect" bucket- sorts the blocks by their family (source / backend / algorithm / metric / sink), sorts each bucket left-to-right by x-position (so hand-ordering still wins), and strings them into a single main chain: source(s) → backend(s) → algorithm(s) → metric(s) → sink(s) This is the pattern every existing preset already follows, and it matches the research workflow the three algorithms are designed around. Edge semantics in workflow_service.py are just topological ordering with shared ctx, so no side-channel routing is needed. The heavy lifting is a pure function in lib/autoConnect.ts so it's trivial to unit-test later. Corner cases covered: * Empty / single-node canvas → no-op with advisory notice. * Missing source / sink / backend → still wires what we have, surfaces a human-readable warning alongside the "Connected N blocks" confirmatio…ea5983b -
frontend: rename light theme "Paper" → "Light"
Yuchen Yuan"Paper · print-ready" was cute but non-obvious; people looked at it and wondered why the app wanted to print. Rename to the plain "Light" label most users expect, with a matching tagline. The data-theme key (and all CSS selectors) stay "light" — no runtime behaviour change, no localStorage migration needed.96112b3 -
frontend: extract lib/clipboard.ts for copy helpers
Yuchen YuanDedup the 18-line navigator.clipboard + textarea/execCommand fallback that TopBar (copy bibtex) and FlowCanvas (copy share link) had both open-coded. Behaviour identical; saves ~20 lines across the two call sites and gives future copy-to-clipboard features a single entry point.baec961 -
Add BibTeX copy + share-link URLs
Yuchen Yuan +1: Claude Opus 4.7Two features in one commit (both pure frontend, short). BibTeX copy - Extend paper metadata in nodeCatalog with a bibtex string for QuCAD, QuBound, and CompressVQC. - Papers popover now renders each row as a link + copy button; clicking copy writes the BibTeX to the clipboard and shows a short check-mark confirmation. Share link - frontend/src/lib/share.ts packs canvas state (nodes, edges, positions, per-node params, selected sample key) into a compact base64url JSON on the URL fragment. - FlowCanvas hydrates from #s=... on boot, falling back to the default preset if no hash payload is present; loads the linked sample circuit so recipients see the same Input circuit. - New "Share" button in the canvas toolbar copies the current pipeline as a URL (with a clipboard fallback for non-HTTPS dev). - CircuitPicker tracks sampleKey in the Zustand store so Share can record "which sample was loaded"; uploaded circuits clear the key (they can't round-trip through a link). C…a2227a5 -
Copy audit pass: align timing/recommendation text with QuCAD default
Yuchen YuanAfter switching the default preset to QuCAD, several pieces of copy still framed QuBound-with-LSTM-training as the canonical first-run experience. Sweep them: - ResultsPane EmptyHint/RunningHint: lead with precomputed-cache instant behavior; QuBound's 2-min cold path is now a conditional footnote instead of the headline warning. - WelcomeTour TrySlide: same rewrite; reorder the 'what to try first' list so QuCAD (cache-hit instant) is the top recommendation, QuBound drops to second; upload hint covers .qasm too. - WelcomeTour PipelineSlide SVG: illustrative algo node shows QuCAD (accent2) instead of QuBound (accent3) so the diagram matches the default canvas; section titles use Blocks/Links to match the toolbar chip wording. - WelcomeTour WelcomeSlide: kbd label tracks the real button text ('Run pipeline', not 'Run'). - nodeCatalog: QuBound tagline 'predict fidelity bound' was mixing units vs the 'predicted error bound' label used in the cards and final metrics; uni…4087daa -
Default preset: switch from QuBound to QuCAD for faster first-run
Yuchen YuanQuBound's LSTM-based bound predictor can take tens of seconds on HF's shared CPU when the precomputed cache misses (which happens any time the user loads a circuit we didn't ship results for). That's a poor first impression for drive-by demo traffic. QuCAD's ADMM pass is sub-second on the small sample circuits, the fidelity check stays in place so the result pane still has something meaningful to show, and the shipped precompute cache covers QuCAD for all default samples. Only flips DEFAULT_PRESET_KEY. The QuBound preset is still available from the Load-preset menu and the intro tour still features it prominently as an algorithm.693d2b1
-
Add mobile layout: side panes become edge-swiped drawers below 768px
Yuchen YuanOn narrow screens the three-column desktop layout squeezes the canvas to zero (left 220 + right 300 + resizers ≈ 522px min), so on a 390px phone portrait the flow graph was unusable. New behaviour below the `md` (768px) breakpoint: - useMediaQuery / useIsDesktop subscribe to `(min-width: 768px)` and re-render on viewport changes. Initial match is read synchronously so the first paint is correct. - MobileDrawer: full-height fixed panel with scrim, slides from the chosen edge. Esc closes. Body scroll locked while open. Transform-based animation so it stays cheap. - App.tsx branches: desktop keeps the existing three-column + PaneResizer story; mobile renders only <main>, with CircuitPicker and ResultsPane mounted inside two drawers. Switching to desktop auto-closes any open drawer. Running a pipeline auto-opens the results drawer on mobile (same as auto-expanding the right pane on desktop). - TopBar: accepts `mobile`, `onOpenLeftDrawer`, `o…1be2846 -
Add Light (Paper) and GMU (Mason) themes, runtime-switchable
Yuchen Yuan +1: Claude Opus 4.7Groundwork: * Colors migrated from hard-coded hex in tailwind.config.js to CSS variables (RGB triplets so `/<alpha-value>` slash syntax still works, e.g. `bg-canvas/80` -> `rgb(var(--color-canvas) / 0.8)`). * React Flow overrides and MiniMap/Background colors in FlowCanvas now read from the same variables, so theme swaps carry through to the canvas widgets too. * Body background gradient, scrollbar thumb, and edge-stroke color are per-theme via --body-bg, --scrollbar-thumb, --rf-edge-stroke. Themes registered in src/lib/theme.ts: * dark -> :root default (deep navy + cyan — unchanged) * light -> white paper background, deep sky/violet/pink/emerald accents. Good for slides / screenshots / print. * gmu -> Mason green canvas + Mason gold primary (#FFC72C), green secondary (#006633), teal/red algo accents. UI: ThemeSwitcher dropdown in TopBar (next to the Tour button), shows preview swatches and tagline, persists …a4eeda5 -
Add preset pipelines dropdown and paper links
Yuchen Yuan +1: Claude Opus 4.7The canvas used to boot into one hardcoded 4-block demo and the only way to get back to it was a Reset button. Replaced that with a named preset registry (QuBound / QuCAD / CompressVQC / Full stack) exposed via a "Load preset" dropdown in the canvas header. Each preset is a pure-data graph spec; buildPresetGraph turns it into React Flow nodes/edges with a simple left-to-right layout. Adding new presets is a one-file edit. Also surfaced the underlying research papers: - QuCAD arXiv:2304.04666 (ICCAD 2023) - QuBound arXiv:2507.17043 (IEEE TCAD 2025) - CompressVQC arXiv:2207.01578 (ICCAD 2022) A NodeSpec.paper field carries url/title/venue. The algorithm node cards show a small paper icon on hover (top-left, mirroring the delete × on top-right), and the WelcomeTour AlgorithmsSlide now links each card's venue back to arxiv so the papers are discoverable without hovering. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>d9de684 -
Add client-side live IBM toggle and wrap palette to two rows
Yuchen YuanLive mode toggle: - TopBar chip becomes a button: cache (default) <-> live. State is persisted to localStorage as jqub.useLiveIbm and passed through on every run via use_live_ibm in RunRequest. - When the server itself cannot go live (no IBM_QUANTUM_TOKEN or ALLOW_LIVE_IBM=false) the chip greys out and the tooltip explains exactly what secret to set. - Tooltip copy now tells the user the cache is real IBM Fez data just frozen 14 days back, so off is not a downgrade for demo usage. Palette layout: - Block tiles now flow in two rows: setup blocks (input + backends) on top, processing/metric/sink on the bottom. This mirrors the pipeline flow and removes horizontal overflow on narrower viewports. - Tile height trimmed from 68 to 64 px to keep the two-row strip from eating too much canvas space.7fbd0c7 -
Add sample diagram preview, upload hints, and block taglines
Yuchen YuanSample circuit preview: - Backend SampleCircuit now carries depth/size/params/diagram_text so the sample list exposes enough metadata to preview without a second round trip. - Each sample button has an eye-toggle that expands an ASCII circuit diagram inline. The Loaded card has a matching toggle. Upload affordance: - Button label is now 'upload .qpy / .qasm' with a descriptive title. - Empty Loaded card explains what formats are accepted and offers a 'download a sample' link so new users can try the upload flow with a known-good file. - New GET /api/circuits/samples/{key}/download serves the raw .qpy. Block discoverability: - Added NodeSpec.tagline (3-5 word human-friendly caption). - Palette tiles show the tagline under the label (tile height grew from 52px to 68px, width 92px -> 108px). - Canvas QNode also renders the tagline so users don't need the tooltip or the tour to recall what each block does.bd3a155