#settings
A program can set two things about itself: how its gates are scheduled into columns and how many qubits it has. Those are the only #settings lines Qubi accepts. Everything else (zoom, decimal places, sorting, visible rows, label units) is your own preference and lives in the Settings button.
Program settings
| Key | Default | Type | What it does |
|---|---|---|---|
Scheduling | "always" | enum | Gate packing mode. See Scheduling. |
MaxQubits | 12 | int (2-24) | Highest wire index is MaxQubits − 1. The state vector needs 16 bytes per amplitude, so 24 qubits use 256 MB; above about 12 qubits the probability panels list the most likely outcomes and the density matrix view keeps the first 10 wires. |
#settings Scheduling "compressed" #settings MaxQubits 16 H 0 CX [0,1]
Values in quotes are quoted in the file too. Leave a line out and the program uses the default. These two lines travel with the program, so whoever opens it gets the same circuit you built.
The NMR Analysis tab also reads its own #settings Nmr… lines for the sample, field and readout. Those are listed on #settings Nmr keys and don't change the circuit.
Scheduling
See the dedicated Scheduling page. Quick version: "always" packs gates aggressively; "never" puts every gate in its own column.
Angles need no setting
A bare angle is always a multiple of π, so RX 0 0.5 is π/2 in every program. Write 90deg, 1.5708rad or pi/2 when another form reads better. See Angles & Units.
Your settings (Settings button)
These change how the simulator looks and behaves for you. They are saved in your browser and never go into the program text, so sharing a file never changes someone else's view. Scheduling and Max Qubits sit at the top of the same window, because they edit the open program's two #settings lines.
| Setting | Default | What it does |
|---|---|---|
| Visible qubits | 2 | How many qubit rows the circuit builder shows. |
| Zoom | 100% | Circuit builder zoom: 50%, 1, 1.5, 2. |
| Auto-adjust visible qubits | true | Grow visible rows when code uses higher indices. |
| Decimal Places | 2 | Digits for amplitudes and probabilities. |
| Auto-run circuit after changes | true | Re-run the circuit when code changes. |
| Use optimized gates | true | Use optimized decompositions where available. |
| Use optimized sweep | true | Faster sweep runs when stepping combos or running the full sweep batch. |
| Step by step (circuit builder) | false | Circuit builder step scrubber and play controls. |
| Show gate parameters on circuit | true | Angle labels on rotation tiles. |
| Conditional branches on circuit | none | If/else markers on the circuit. none hides them, some shows branches that contain gates, all shows every marker. |
| Show evaluated values on circuit labels | true | Show evaluated LOOP counts and wire lists on blocks. |
| Gate parameter angles (circuit) | degrees | Unit for labels drawn on gates. |
| Symbolic notation (fractions & √) | false | Prefer √(½) style in state displays. |
| Hide negligible probabilities | true | Drop near-zero amplitudes from the state vector. |
| Order By | probability | Basis-state sort key. |
| Direction | desc | Sort direction for basis states. |
Older programs
Files written before this change may have other #settings lines, such as CodeAngleUnit, VisibleQubits or Zoom, or the old visible and visiblemax wire forms. They convert automatically when you open them. A program that read bare angles in radians or degrees gets a rad or deg suffix on each of those angles, so it gives the same results. Display lines are dropped, and your own settings stay as they were.