Qubi Code Editor

Right-hand panel: multi-file source editing, three compilation layers, syntax highlighting, and the compilation log. This is the source of truth; the circuit builder and simulators consume what validates here.

File tabs

  • + opens new .qubi buffers in the session.
  • #import / #include resolve against open tab filenames (case-insensitive), then cached fetches, then /simulator/libraries/ on the server.
  • Missing imports error on the import line and clear the circuit instead of showing a broken diagram.

See #import for resolution order and autocomplete behavior.

Layer tabs

  • Prepended: default gate library (H, X, CX, SWAPSEQ, …). Editable per session; errors on built-in lines may point here.
  • Main: your program. Circuit Builder edits rewrite this layer.
  • Appended: optional trailing snippet (experiments or temp overrides).

See Editor Layers.

Editing features

  • Syntax highlighting for gates, #settings, #import filenames, gate-block properties, loops, and conditionals.
  • Autocomplete for gates, settings keys, import paths (existing tabs only), and sweep-friendly registers.
  • Inline error markers; compilation log lists the same messages with line links.
  • Fix with QubiAI when enabled and errors block Run.

AutoRun and manual Run

AutoRun (default on) re-syncs code to the circuit after validation settles on each edit. Turn it off for very large files and use header Run Circuit manually. Run always executes simulation and refreshes the visualization panel and analysis tabs.