Parametric Sweep
Run every combination of sweep variables declared in your Qubi program and plot how often the circuit lands in a target computational basis state. The combo bar in Circuit Builder steps one combo at a time; this tab runs the full Cartesian product.
Controls
| Control | Description |
|---|---|
| Target state pattern | Bit string over visible qubits: 0 and 1 for required bits, x for don’t-care. Rightmost character is qubit 0. Examples: 101, 1x111, 0 for single-qubit |0⟩ probability. |
| Plot vs | Horizontal axis: Combo (flat index through all combinations) or any single sweep dimension from your code (e.g. a numeric range or gate sweep). Changing this re-renders the chart from cached results. |
| Run Full Sweep | Executes all combos sequentially, updates progress in the status line, draws the chart, and fills the results table. Respects UseOptimizedSweep from settings when the optimizer applies. |
When Run is disabled
- Qubi editor has validation errors (fix compilation log issues first)
- No sweep dimensions detected in the program (add something like
a = <1..5>orH <0..2>)
The sweep UI listens for editor error state changes and refreshes the button automatically.
Chart and table
After a run, the canvas plots target-state probability vs the chosen axis. Hover for exact values and combo labels. Click to pin a point; pinned combos can be inspected back in Circuit Builder via the shared combo index.
The table below lists each combination with probability (and dimension values where space allows). Large sweeps throttle progress updates (~50 status ticks) so the UI stays responsive.
Relation to syntax sweeps
Sweep declarations, derived variables (k = j+2), gate sweeps, and LOOP headers with sweep brackets are documented under Parametric Sweeps. This tab does not define sweeps; it only executes what the compiler already extracted from your source.