Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command line

qirc <input.ll | input.qasm> [options]
qirc diff <a> [b] [options]
qirc submit <input> [options]
qirc lsp
qirc explain <code>
qirc surface [--distance 3,5,7] [--error p | --calibration f] [--rounds n] [--shots n] [--seed n]

A file whose first statement is OPENQASM 2.0; or OPENQASM 3.0; is read as OpenQASM, and anything else as QIR in textual LLVM IR.

Commands

CommandDoes
qirc <input>compiles the input and runs it, or emits what --emit asks for
qirc diff <a> [b]checks that b, or a compiled with the options, behaves exactly like a at -O0, see Checking a compile
qirc submit <input>runs the program on IonQ, see Running on IonQ
qirc lspserves diagnostics to an editor over the language server protocol, see Editors
qirc surfacesimulates surface code memory and compares its logical error with the resource model, see Surface code simulation
qirc explain <code>explains an error code such as QIR0300, see Diagnostics

Options

OptionMeaningDefault
--emit <kind>what to produce, from the table belowrun
-O<n>optimisation level 0 to 3, see Optimisation1
--shots <n>sample n measurement outcomes
--seed <n>seed the random number generatorfrom the clock
--no-statedo not print the final state vector
-o <path>write the emitted output to a file
--color <when>auto, always or neverauto
--gates <set>target gate set: rz-sx-cx, rz-ry-cz or a list such as rz,sx,cx; --basis is the same
--exclude <list>leave gates out of the full QIR set, such as h,t
--resynth <n>replace runs of gates by at most n gates, 1 to 61 from -O2
--cost <model>what resynthesis minimises: gates, cx or ibmgates
--epsilon <e>approximate every gate the target set cannot express to within e, see Targeting hardware
--budget <p>total failure probability for --emit resources0.001
--coupling <map>route onto line:N, ring:N, grid:RxC, full:N or an edge list such as 0-1,1-2,2-3
--calibration <file>read a calibration
--relabelremove swaps near the end by renaming qubitson when routing
--reusereset measured qubits and reuse them
--noisysimulate with the calibration’s errors
--mitigateundo the calibration’s readout errors in the counts
--zneextrapolate --observable to zero noise
--ddfill idle windows with echo pulses, timed from the calibration
--observable <p>print the exact expectation of a Pauli sum such as 'Z0 Z1 + 0.5 X2'
--bind <list>values for OpenQASM 3 inputs, such as theta=0.3,phi=1.2, see Variational circuits
--gradientprint how the --observable changes with every input, by the parameter shift rule under --noisy or --zne
--minimizevary the inputs to minimise the --observable, by SPSA under --noisy or --zne
--bond <n>simulate as a matrix product state with bonds up to n32 above 30 qubits
--target <name>IonQ backend for submit and --emit ionq, such as qpu.aria-1simulator
--verify-eachrun the IR verifier after lowering and after every pass
-v, --verboseprint pipeline timings and pass statistics
-h, --helpshow the usage

Emit kinds

KindProduces
runsimulates the program and prints the state, counts and recorded output
irqirc’s own intermediate representation, block by block
qasm3OpenQASM 3
qasm2OpenQASM 2 with qelib1.inc gates, for straight line programs and simple feedback
qirQIR as textual LLVM IR, also spelled llvm
jsonthe program as JSON
stima Stim circuit, for Clifford programs
circuitan ASCII circuit diagram
quantikza LaTeX quantikz diagram, also spelled latex
svgan SVG circuit diagram
costT gates, two qubit gates, gates, depth and live qubits for every path
resourcesa surface code resource estimate, see Resource estimation
rotationsthe program as Pauli product rotations and measurements with its T depth, see Pauli product rotations
schedulethe program laid out in time from the calibration’s durations
pulseOpenQASM 3 with OpenPulse calibrations, also spelled openpulse
ionqthe job qirc submit would send to IonQ
checknothing, only the diagnostics

Exit codes

CodeMeaning
0success, or diff found the programs equivalent
1the program has errors, or diff found them different
2bad arguments, or diff was inconclusive