Documentation
QRosetta
QRosetta (Quantum Rosetta) runs one quantum circuit on many quantum simulators and compares their outputs pair by pair.
On this page
- Overview
- Quickstart: your first run
- Reading results
- Circuit sources
- Run modes
- Circuit preprocessing
- Run options
- Several circuits and experiments
- Command-line tool
- Accounts, history & autosave
- Reports and exports
- Agreement classification
- Bit order per backend
- Shot-noise test
- Metric formulas
- Reproducibility
- Self-test
- Timing/memory methodology
- Resources, queueing, timeouts
- Compile-only services
- Limitations
- Adding a simulator
- Citing
- Glossary
- FAQ
Overview
The input is a circuit in OpenQASM 2.0. QRosetta sends it to each selected simulator
backend: Qiskit (Aer), Cirq, qsim, Qibo, PennyLane (lightning and default.qubit),
Qulacs, QuEST, quimb, myQLM, PyQuil, Qrisp, cuQuantum and TorchQuantum.
GET /runners lists the backends a server offers. Because of their licence
terms, the published release images leave out the myQLM and cuQuantum backends and
the BQSKit compiler; qrosetta build myqlm cuquantum bqskit builds them on
this computer, from the build files the package carries or from a checkout of the
repository, and cuQuantum also needs an NVIDIA GPU. qrosetta start gives
cuQuantum the GPU when the host has a CDI specification for nvidia.com/gpu
(sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml; Docker reads it
only with CDI enabled), and qrosetta doctor says whether it found one.
A server runs in one of two execution modes. In local mode (a Docker Compose
or podman stack, as qrosetta start creates) each backend is a
long-running service that the API sends its runs to. In Kubernetes mode the
API starts a Kubernetes Job for each run of each backend, and the Job ends when the
run does. The operator sets the mode with EXECUTION_MODE.
Every backend receives the circuit in the same request format and answers in the same
result format. Several adapters parse the QASM text with pytket. The Qiskit adapter is
one of them: it converts pytket's circuit with tk_to_qiskit, and its
preprocessing_applied list records the pytket parse. The cuQuantum
adapter, also built on Qiskit Aer, parses with Qiskit's own
QuantumCircuit.from_qasm_str, so the two Aer-based backends can read the
same text differently.
QRosetta compares the backends in pairs. For each pair it reports whether the outputs agree and, if they do not, whether a declared convention such as bit order accounts for the difference (Agreement classification).
The comparison is relative: apart from the self-test, which uses fixed circuits with precomputed answers, QRosetta has no reference result. A disagreement shows that at least one backend of the pair is wrong and does not say which. To decide, check the circuit against an independent reference, such as an exact calculation of your own.
A run can also send the circuit to compile-only services: eight circuit compilers, seven of them in the published images and BQSKit built on this computer. Their output circuits are recorded and shown, but neither simulated nor compared; see Compile-only services.
Quickstart: your first run
Start a local server
The README in the repository lists the host requirements (Linux on x86_64, rootless podman 4.7 or later or Docker Engine, Docker Compose v2, Python 3.11 or later) and the packages to install on Fedora, Ubuntu, Debian and RHEL, AlmaLinux and Rocky Linux. With a published release:
pipx install qrosettainstalls theqrosettacommand.qrosetta doctorchecks the host and gives the fix for each problem it finds.qrosetta pull --profile minimalfetches the API, nginx and the Qiskit, Qulacs and Cirq runners.--profile fullfetches every published image.qrosetta start -dstarts every service whose image is present and returns when the API is ready and the runners answer. Its last lines give the address, for exampleQuantum Rosetta is running at http://localhost:8080 (this computer only), followed by the addresses of this manual and of the API reference.- Open that address in a browser.
qrosetta build builds the images on this computer instead of pulling them,
from the build files the package carries or, in a checkout of the repository, from
the working tree (./qrosetta build); the other commands are the same.
By default nginx is published on 127.0.0.1:8080, so only this computer
can reach the page. When another program holds port 8080 and no address has been set,
qrosetta start takes the first free port from 8081 to 8089, prints the
address and keeps it until qrosetta remove. When another Quantum Rosetta
project on this computer publishes the port, start refuses and prints the
command that stops that project: only one project runs at a time. --bind ADDRESS:PORT,
or QROSETTA_HTTP_BIND in .env or the environment, sets the
address, for example 0.0.0.0:8080 for every interface. Publish the page
beyond this computer only on a trusted network: on a local server any client may
lift the circuit-size, gate-count and experiment-size limits.
A backend or compile-only service that the stack does not run, for example after
--profile minimal, is struck through in the Backends and Compile-only
services popovers. The first line of each popover says how many services run and
gives the commands that add the ones not running; the row of a service that is not
running gives the commands that add that one, for a backend when the pointer rests on
its row (qrosetta build when the stack runs images built on this
computer, else qrosetta pull, then qrosetta start -d with its
name). A service unavailable for another reason, such as one the release does not
include or cuQuantum without a GPU, says so on its row.
Run a circuit
- On the first visit the editor holds a three-qubit GHZ circuit, Statevector is
ticked under Mode, and every backend the server offers is selected. To run your own
circuit, paste its OpenQASM 2.0 text into the Editor, or press
Import QASM above the editor to read a
.qasmfile. To start from a ready-made circuit, choose it in the Quantum Algorithms menu under Generate Circuits and press Load (see Circuit sources). - Press the run button at the bottom of the left column. Its label states what will run, for example "Run Editor Code · Statevector · 14 backends". The Run choice, Mode, Run Name and the settings chips stay in view above it. During the run the results area shows the table the result will fill, with each backend's state in its Status column.
- Read the Summary tab. Its first line says how many backends returned a result. The next line names any backend that differs from the others, with how many of them it differs from, and says whether the rest agree with each other; when no pair differs, as for the GHZ circuit, it reads "Every comparable pair of backends agrees." The Backends table has one row per backend: status, the backends it differs from, bit order, precision, total time and peak memory. Evidence, below the table, lists the pairs by verdict.
- For a measured run, tick Measured. A Shots field (default 8,200) appears beside the settings chips. To make a rerun draw the same shots, open the Seed chip and enter a sampling seed, for example 42. On a circuit with many outcomes the full-distribution test may call pairs inconclusive; the Summary then gives the number of shots the test needs.
- The other tabs hold the detail: Agreement (a heatmap of every pair, the evidence per pair, the divergence matrices), Performance (times and memory), Circuits (the submitted, dispatched and executed text) and Exports (figures and tables, the RO-Crate and the report files).
From the command line, qrosetta run FILE.qasm runs a circuit file in
statevector mode on the server's default backends, follows the job, saves the report
and summary (and, on a local stack, the RO-Crate) under ./qrosetta-results and prints the page link of the job.
-m measured --shots 8200 runs it measured, -b qiskit,cirq
picks backends and --seed 42 fixes the sampling seed; qrosetta run
--help lists every option (Command-line tool).
Before and during a run
The page checks the inputs before it submits a run. If a value blocks the run (shots, timeout, seed or a threshold out of range, a Run Name holding a control character, an invisible formatting character or a line separator, more circuits than the server accepts), nothing is sent: a red box above the run button, headed "Not submitted. Fix these inputs first:", lists every problem, and the field concerned is outlined in red inside its chip. The list is updated whenever the workspace changes. A request the server refuses is shown with the server's message.
While a run is in progress the Status column shows each backend's state: QUEUED (not
started; no time shown), SENT, then DONE, ERROR, TIMEOUT or OFFLINE with the seconds
it took. While the server compares the results (the job's phase is
analysing), the progress line reads analysing results and a
playlist's current circuit reads ANALYSING. For measured runs with many outcomes this
step can take tens of seconds.
Stop waiting, beside the elapsed time, stops the page from waiting; the job continues on the server. The results area then reads Stopped waiting, gives the job ID and offers Show results, which waits for the job again.
If the server stops answering while the page waits (the API is restarting, or the proxy reports it unreachable), the page says it is waiting for the server and asks again after 3, 6, 12 and 24 seconds, then every 30 seconds, for up to 5 minutes. A restart of the API loses every job in progress: when the server answers without the job, the page says so, and the run has to be submitted again. After 5 minutes without an answer the page stops waiting; the job stays in this browser's list, so a reload after the server is back offers it again.
Returning to a run
The browser records every job it submits. When the page is opened again (reload, Back and Forward, a new tab), Earlier runs from this browser above the results lists the jobs whose results were not shown and the finished jobs the server still keeps (for its retention time after they finish), each with Show results and Dismiss. A job the server no longer has is dropped from the list. The list follows jobs started or dismissed in other tabs. When you are not signed in, Recent runs in the header opens and closes the list at any time. Logging out forgets the jobs submitted while signed in and clears their results from the screen.
A link of the form /#job=<job ID>, which qrosetta run,
wait and selftest print, opens that job's results. The page
waits for the job as Show results does, without adding it to this browser's list or
saving it to an account. If the server no longer has the job, the results area says
so.
Each browser tab keeps its own editor circuit, ticked modes and Run Name across reloads; a new tab starts from the values last used. The playlist, the backend selection and the export preset are shared by all tabs. The other settings (preprocessing, Bypass API Safety Limits, timeout, thresholds, seed) return to their defaults when the page loads. Below 1024 pixels of width the workspace, the Run footer and the results follow each other in one column. A table wider than the results panel scrolls sideways, with a shadow on the side that has more columns.
Reading the results
A finished run shows five tabs.
| Tab | What it shows |
|---|---|
| Summary | A headline, a Backends table, then the evidence per pair. |
| Performance | Times, then memory: ranked successful runs, then unranked runs with their status and reason. |
| Agreement | Counts per label, a heatmap with one cell per pair, the evidence per pair, and the divergence matrices. |
| Circuits | The circuit texts the run recorded, with a line diff between any two. |
| Exports | Figures and tables of the run, and the RO-Crate export. |
The first Tab stop of the page is Skip to the workspace. Login, History, Auto-Gen and the Quirk view open as dialogs that keep the keyboard inside them until they close (Escape, or their Close or Cancel button), and focus then returns to the button that opened them. When a run finishes, focus moves to the heading of its results and a screen reader reads the first lines of the headline, or the error. Badges and labels with a tooltip take one Tab stop per table row; Left and Right arrows move between them, and a tooltip stays open while the pointer is on it. The Backends table and the tables of this manual take a Tab stop of their own; when one is wider than its box, Left and Right arrows scroll it.
Summary
The headline says how many backends returned a result, names failed ones as Offline, Error or Timeout, and names the backends that differ from the others. It is built from the pairs that differ; an inconclusive pair counts as neither agreement nor difference. A statevector pair differs when it disagrees (Agreement classification); a measured pair differs when it is distinguishable beyond shot noise or a single-bit marginal differs. The headline takes the first of these forms that fits:
- Named backends. One set of at most four backends, fewer than half of those with a result, is the only set of that size present in every differing pair. Those backends are named with how many they differ from ("Backend A differs from all 13 other backends"; "Backend A differs from 7 of 13 other backends"), backends in the set that agree with each other together ("Backends A and B agree with each other and differ from every other backend (12)"), followed by a sentence about the rest, among which no pair differs.
- Groups. The backends that differ from at least one other split into two to four groups, at least two of them with two or more members, with no differing pair inside a group and every compared pair between groups differing. The groups are listed as differing from each other; a backend that differs from none is named apart.
- Pairs. Up to four differing pairs are listed by name. In measured mode, when each backend of these pairs differs from no other, the headline suggests rerunning with another seed, since a single flagged pair can be a chance result.
- Spread. The backends that differ from more than half of those they were compared with are named, those that agree with each other together and the groups with the largest difference first, up to four, and the rest in a sentence of their own ("Backends C and D also differ from more than half of the backends they were compared with"); then the differing pairs among the others.
Each named backend or group carries the size of its difference, measured against the backends the headline does not name, so a pair of two named backends does not set it: the lowest label-aligned fidelity (statevector), or the median and range of the total variation (measured). When groups differ, the size is taken over the pairs between groups. In measured mode, a named backend that differs from fewer than half of the others and is consistent with all the rest gets a caveat: with many pairs tested, one backend's unusual sample can differ from a few others by chance. In simulation with every backend correct at 8,200 shots, the full-distribution test flagged a pair in 0.6–1.1% of 14-backend runs, and with the single-bit marginal tests 3.9–4.8% of runs showed a flag. A multi-run report counts runs in the same sentences ("all 4 Backend A runs").
A measured pair that is distinguishable under Benjamini–Yekutieli but not under
Holm's family-wise correction, with no differing single-bit
marginal, is listed on its own line as significant under
BY only and does not shape the headline. When one backend is in
every such pair (two or more), the headline names it. "No single-bit marginal differs"
appears only when the marginal test ran, which needs keys of two or more bits. In
measured mode the full-distribution and marginal counts are given separately, with the
number of inconclusive pairs and the shots the power model asks for ("at least" when the
recommendation is a lower bound, recommendation_is_lower_bound). When
backends timed out, the next step suggests raising the timeout unless the run already
used the server maximum. A pair that differs shows that one of the two is wrong; the
report does not decide which.
The Backends table gives per backend its status; how many backends it differs from (hover for the names and the size of the difference; red for the backends the headline names, gray for the others; pairs significant under BY only added as "+N BY only"); in measured mode how many it is inconclusive with; its declared bit order, precision, total time and peak memory. Red in the table marks exactly the backends the headline names.
Evidence follows, with a legend for the mode. Statevector pairs are
grouped in the three label groups. Measured pairs are grouped by
measured_assessment only, each pair once with its JS/Hellinger distance label
as detail; pairs whose single-bit marginals differ have their own block; inconclusive
pairs are split by cause; not comparable pairs carry the reason. Lists of differing pairs
are never folded and are ordered by the backend they share; lists of agreeing pairs over
twelve items are folded. Power is shown to three decimals with the
α/(m·c_m), m and c_m it was computed at. A collapsible section lists the analysis version and git commit,
then per-backend run details.
A compile-only run (simulated: false) shows a headline naming the compiles
that were refused, rejected by their output check, not run, timed out or failed, then its
compile records. A compile-only playlist shows one row per circuit with the compiles that
returned a circuit and those that did not.
Performance
A run on a GPU carries a GPU tag under its name (hover for the GPU), and the header says so when any run was on a GPU. Each column uses one number format: fixed decimals chosen so its smallest value shows three significant digits, or scientific notation throughout when a value is below 1e-6 or at least 1e9. After "Caveats", the header names conditions in this run that can bias a comparison (backends ran at the same time, other jobs on the server, throttling, unstable repetitions, CPUs of different speeds, one timed run per backend); "Measurement notes" gives the details. With Timing repeats above 1, each time cell shows the median with ± the sample standard deviation below it; the header gives the number of timed runs when every backend had the same, and each cell gives n when they differ. Process Peak RSS includes interpreter start, SDK imports and the warm-up run, so for small circuits it is mostly the SDK footprint. Each column's tooltip gives its measurement window.
Agreement
The heatmap colours each pair by the same verdict as the Summary, with a symbol per class that the key below repeats: = agree or consistent within shot noise, φ agree up to a global phase, ↺ agree after the declared bit reversal, P agree only after a qubit permutation, N agree after normalisation, ≠ disagree or distinguishable, ? inconclusive, – not comparable. Click a cell to open its evidence: label, metrics, tolerances, statistical test and provenance (seeds, ordering, SDK versions, preprocessing). Labels are shown in words with the recorded code in the tooltip; the pair list can be filtered by verdict and by backend.
Each statevector row shows the fidelity under the transform its label names. For a pair
that disagrees it is the fidelity in the basis the declared orderings imply (F(bit-rev)
for an lsb×msb pair), with the other basis' value added when
the pair matches only there. A pair that agrees up to a global phase shows that phase.
Agreement after the declared bit reversal is blue on badges, legends, heatmap and export
charts. A measured row leads with its shot-noise assessment; its JS/Hellinger distance
label follows in gray after "distance:" and does not decide agreement.
Divergence matrices (collapsed) hold the N×N fidelity, global phase
offset arg⟨a|b⟩, JS divergence (nats) and Hellinger values. Each number is the direct
value, before any bit reversal; for a pair compared after the bit reversal its declared
orderings imply, the value in that basis is shown below it with ↺. Cells are coloured by
the pair's verdict, not by the number, so an lsb×msb pair that
agrees after the declared reversal is coloured as agreeing although its direct fidelity
is low. OFF, ERR and T/O mark failed runs, n/c a pair that is not comparable. Cells show
four decimals, more for a fidelity that would otherwise round to 1, and three significant
digits in scientific notation below 1e-3; hover for the unrounded value.
Circuits
The table has one row per distinct circuit text: rows that list several backends hold
byte-identical texts with the same recorded gate count and depth. The texts are the
circuit as submitted, the circuit the API sent to each dispatch group (with the API's
changes), the circuit each backend executed (its transpiled_qasm, with the
backend's transforms, SDK versions, gate count and depth) and, when the run used
compile-only services, the compiler input and each compiled circuit. Each row gives the
lines, gates, depth, and the lines added and removed against the text it was derived
from. View shows that text below the table with its notes and sets the diff: side A is
the source text and side B the text itself (for the submitted circuit, A is the
submitted circuit and B the first text derived from it). The view opens on the first
row.
Gates and depth of the submitted circuit, the dispatched circuits and the compiler input
are counted in the browser as for compiled circuits (top-level gate statements; barriers
and measurements not counted), so a compiler's reduction can be read against its input.
Each executed pane says where its gate count and depth come from
(gate_metrics_basis): the text for most backends, the executed tape for
PennyLane. The line diff compares any two texts, raw or ignoring whitespace and line
breaks, comments, or the OPENQASM and include lines, and stops at about 4,000 changed
lines. pytket writes angles as multiples of π, so one angle can appear as
pi/4, 0.25*pi or 0.7853981633974483;
Compare angles by value evaluates every gate parameter without variables
and compares it in radians to 12 significant digits (parameters with variables, as in gate
bodies, are compared as written).
The Cirq pane holds pytket's serialisation of the circuit the Cirq adapter built, so
include "hqslib1.inc" and U1q come from pytket's gate set.
Texts written with Qiskit (the Qiskit, cuQuantum and TorchQuantum panes, QMAP's input and
Q-Synth's output) give every angle as the shortest literal that reads back as the same
double. The qsim pane is Cirq's to_qasm with angles as multiples of π to 16
decimal places. The tab shows text only and draws no conclusion from a difference: two
texts can differ line by line and describe the same unitary. A saved run opened from
History also offers a read-only link (see Accounts, history and
autosave).
Exports
On the left are the views of the run, grouped as Agreement,
Statistical, Divergence, Performance, Resources, Metadata, Circuits and Reference (a
narrow results column shows them as a menu above the view). In the middle is the
selected view: its preview (Chart, Table and Data tabs; Data holds the CSV of the numbers
and, for a figure, the spec saved beside it), its caption, and its settings, with the
less used ones under More. The caption states every choice that shapes the
figure: outcomes shown, what is summed into 'other', key order, reference and shot-noise
band. On the right, the Export panel lists what the RO-Crate will
contain. The report (results.json), circuits and provenance are always
included; Add to export adds the view with its settings and its own formats, and
the pencil reloads an added view to change it. A figure is exported as SVG by default,
and as PDF or PNG; a figure view that also has a table adds LaTeX and CSV of its data.
A table view offers LaTeX and CSV by default, and Markdown, HTML and XLSX; the glossary
view offers Markdown (default) and Text. One export
holds at most 60 items
(limits.max_export_items). Presets (Paper figures, Data for analysis,
Everything, Nothing extra) fill the list; the preset and the author and affiliation under
Credits are remembered in this browser. Files from your selection lists
the paths the crate will hold.
Every figure view takes Backends (any subset; with two selected the count comparison is a one-against-one histogram), a Figure size (automatic, single column 3.5 in, double column 7 in, slide) and a title on or off. The automatic and column sizes are cropped to what is drawn; a slide keeps its 13.33 × 7.5 in (16:9) canvas. Measured runs add views that stay readable at many qubits:
- Count comparison: overlay, small multiples, difference from a reference backend with a ±2σ shot-noise band, or an outcome × backend heatmap; the top n outcomes, those above a probability, or the marginal distribution over up to 6 chosen classical bits; sorted by probability, bitstring or Hamming weight; keys in msb or lsb order.
- Single-bit marginals P(c[j] = 1), the quantities the single-bit marginal tests compare.
- Hamming weight (n + 1 bins) and Rank–probability.
The four measured views have a Colour setting under More:
By backend (the default) gives each backend its own colour, and
Highlight disagreeing colours the backends whose pair with the reference is a
disagreement and greys the rest. Figures are drawn on the server: from its copy of a run
made in this session while the copy is kept, otherwise from the fields of the browser
copy that figures read (subject to the 1 MiB request-body limit). Titles and captions name
the circuit as the caption on screen does (the circuit's name, else the playlist entry's,
else the run name); the browser sends that name with each request, since the server's
copy of a run records none. Figure legends, axis labels and captions name backends as the
Backends table does ("Qiskit (IBM)", "qsim (Google)"); tables keep the runner ids used in
results.json. Tables are built in the browser as LaTeX, CSV, Markdown or
HTML, and on the server as XLSX. A LaTeX table needs
\usepackage{booktabs,adjustbox,longtable}: it is scaled to the line width
when wider, set as a longtable above 40 rows, and carries its explanation as
a note below; LaTeX document downloads a complete document that compiles as it
is. Report JSON only downloads or copies the full report from the server or the
browser copy.
Playlists and experiments
A playlist run shows a suite summary and the Exports tab. The suite summary gives each
circuit an agreement badge, one badge per failed-run status, and the fastest and lightest
successful backends, each tagged with its device. A measured circuit is badged by
measured_assessment: Differs, naming the backends, when any pair is
distinguishable or a single-bit marginal differs; All pairs consistent when every pair is
consistent within shot noise; otherwise Inconclusive. A statevector circuit is badged
Differs (naming the backends) when any pair disagrees, All pairs agree, or All pairs
agree (bit order as declared) when some pairs agree after the declared bit reversal. Not
compared means fewer than two backends returned a result; Compile only marks a circuit
of a compile-only run. An experiment shows its pair counts, by assessment in measured
mode and by label group in statevector mode, and the bundle download.
When backends disagree
A differing pair shows that one of the two backends is wrong, that they read the circuit differently, or, in measured mode, that one sample differs by chance (the Summary says when a flag may be chance). To find which:
- On the Agreement tab, click the pair's cell and read its label, metrics, tolerances and statistical test (Agreement classification, Metric formulas).
- On the Circuits tab, compare the submitted circuit, the circuit the API dispatched to each backend and the circuit each backend executed, with the line diff and Compare angles by value.
- Read each backend's
preprocessing_appliedlist, in the pair's evidence or under the per-backend run details at the end of the Summary (Circuit preprocessing). - Rerun with Apply SDK Preprocessing off, with another sampling seed, or with more shots; for an inconclusive pair, use the shot count the Summary recommends (The shot-noise statistical test).
- Check the circuit against a reference computed independently of the backends, for example by hand for a small circuit; the self-test does this for its own circuits.
Circuit sources
The left column has three panels: Generate Circuits offers ready-made circuits, the Editor holds the circuit you are working on, and the Playlist holds circuits to run together.
- Generate Circuits. The Quantum Algorithms menu
lists four groups: the generated algorithms (GHZ, Bell, QFT, Bernstein–Vazirani,
Grover, VQE ansatz, random, bit-order probe), the bundled Examples
(
GET /examples), MQT Bench algorithms and QASMBench circuits. Typing in the menu searches all four. For an algorithm or an MQT Bench algorithm, Qubits sets the size; an MQT Bench size moves to the nearest size the suite has. Load refuses a size above the limit of the ticked modes: 18 qubits while Statevector is ticked and 24 otherwise, so untick Statevector to load a larger circuit for a measured run. Examples and QASMBench circuits have a fixed size. The line under the menu describes the selection, and for an example names the mode it is meant for. Load puts the selection in the editor, asking first if that would replace your edits; loading an example also ticks its mode. + Add adds the selection to the playlist. - Editor. Type or paste OpenQASM 2.0. Import QASM reads a file into the editor and Export QASM saves its text. + Add to Playlist adds the editor's circuit to the playlist under the name above the editor.
- Playlist. Quick Load is a list of ready-made
sets; choose one and press Apply to replace the playlist with it,
after a question if the playlist is not empty (Sanity Check: every algorithm at 5 qubits; Scaling Test: GHZ from 5 qubits to the
statevector limit; Memory Stress: random, Bernstein–Vazirani and VQE circuits at
the statevector limit; the sets come from
GET /quickload). Auto-Gen adds circuits of the chosen algorithms at random qubit counts, up to the limit of the ticked modes (the statevector limit while Statevector is ticked) and each algorithm's own maximum, and says when it lowered a count. Clear asks before it empties the playlist. Bench opens a list of MQT Bench or QASMBench circuits with a name filter and a qubit cap; tick circuits and add them, or add every circuit the list shows (with no filter and no cap, the whole suite). Escape or a click elsewhere closes the list. The playlist can be exported to a JSON file and imported again.
Run, in the footer of the left column, switches between Editor code and Playlist. Loading a circuit into the editor selects Editor code; adding to the playlist selects Playlist. A warning appears in the footer when the circuit that will run (the editor's, or the largest in the playlist) has more qubits than a ticked mode allows, and when a measured circuit has more than 22 qubits, where several backends are likely to reach the timeout. A 24-qubit QFT of 340 gates did not finish within 300 s on 7 of 14 backends; a 24-qubit circuit of 94 gates finished on all 14 within 300 s, 3 of them after more than the default 60 s.
Run modes
| Mode | What each backend returns | How QRosetta compares |
|---|---|---|
| Statevector | The amplitudes of the final state, without sampling. | Fidelity and global phase offset arg⟨a|b⟩ of each pair of normalised states. No seed is used. |
| Measured | A histogram of measurement outcomes over a given number of shots. | A shot-noise test of each pair, with the Jensen–Shannon divergence (in nats) and the Hellinger distance of the two distributions, each normalised by its observed total, as descriptive distances. |
Statevector runs are limited to 18 qubits and measured runs to 24, because a full
statevector grows as 2n; a compile-only run builds no statevector and has
a limit of 24 qubits. GET /config reports the limits. Each backend's run
ends with one of four dispatch statuses: ok, error (the
backend rejected the circuit or failed), timeout (the run exceeded the
timeout, or never left the runner's queue; see
Resources, queueing and timeouts) or offline
(the runner could not be reached). The timing and memory fields of a failed run are
null, and every pair that includes it is not comparable.
Circuits the API refuses
Before a run starts, the API checks the text and refuses it with HTTP 400, giving the line, when it finds any of the following:
- a header other than
OPENQASM 2.0;(the short formOPENQASM 2;included) - a non-ASCII character outside a comment (the message gives its column and Unicode name, for example a non-breaking space), or a control character other than tab and line break
- a semicolon with no statement before it
- a name declared twice among registers, gates and opaque gates, which share one set
of names; with
include "qelib1.inc";the qelib1 gates belong to that set, soqreg x[1];orcreg h[1];is refused - an index outside its register, an operand that is not a declared register, or a classical register given to a gate
- a call of a gate that neither the circuit nor an included
qelib1.incdefines (names are case-sensitive:Handcnotare not qelib1 gates) - a call with the wrong number of parameters or qubits, such as
cx q[0];orrx q[0];, or one that names a qubit twice, such ascx q[0],q[0];orcx q,q[0]; - a broadcast over registers of different sizes, such as
cx a,b;witha[2]andb[3], or ameasurewhose two sides differ in size, such asmeasure a[0] -> c;withc[2] - a register name that does not start with a lowercase letter, such as
qreg Q[1];, and a gate or register used before its declaration - a name in a parameter inside a gate definition that is not one of that gate's
parameters, such as
gate g a { rz(t) a; } - a
/* ... */comment (OpenQASM 2.0 has only//comments) - a top-level call that reaches an
opaquegate, directly or through gate definitions. An opaque gate has no definition, so no simulator can apply it; declare it withgateand a body instead. An unusedopaquedeclaration is accepted, and the pytket round-trip drops it.
Spaces between a register and its index (q [0], q[ 0 ]) are
legal. The pytket round-trip does not accept them, so with SDK preprocessing on the API
removes them, together with the circuit's comments, and records an
API: entry. Gate parameters may have any name,
including lambda, as in qelib1.inc.
Input limits, under Run options, lists the size limits.
Measurements, reset and classical control
In statevector mode the API removes the measurements at the end of the circuit and
records an API: entry in preprocessing_applied. A circuit
with a measurement followed by further operations, a reset or an
if has no single final statevector, so statevector mode refuses it with
HTTP 400; run it in measured mode. A compile-only run accepts such a circuit and
records each requested compile as skipped.
In measured mode these operations go to every backend, and an adapter that cannot
simulate them returns an error for its backend. Qiskit and cuQuantum (Aer) run
mid-circuit measurement, reset and if; Qrisp runs mid-circuit
measurement and if; Cirq and qsim run mid-circuit measurement. The other
backends refuse all three.
Device and precision
A result can report device (CPU or GPU), simulator_backend
(the library that executed the circuit) and simulation_method; the
Summary's Run details per backend and the Performance tables show them as
tags. Qiskit runs on qiskit-aer's AerSimulator with
method="statevector". The cuQuantum backend is qiskit-aer-gpu 0.15.1 with
cuStateVec enabled, on an NVIDIA GPU; its results also carry gpu_name and
custatevec_enabled. On a server without a usable NVIDIA GPU, cuQuantum is
listed as unavailable in the Backends popover, with the reason the server gives, and is
not dispatched; it never falls back to the CPU. Its kernels run on the GPU, and its
host-side work (parsing, kernel launches, copying results back, sampling) runs under
the same CPU quota as the other runners (Resources, queueing and
timeouts). A time comparison between cuQuantum and a CPU backend therefore
compares different hardware.
Each backend reports the precision of its amplitudes. qsim, Qrisp,
TorchQuantum and Cirq's measured path compute in complex64, the others in
complex128; cuQuantum reports the precision its simulator was configured
with. The report tabs show a precision badge per backend. The fidelity of a
complex64 backend against a complex128 one includes
single-precision rounding error.
Circuit preprocessing
The circuit can be changed in two places, the API and the runner. Every change is
recorded in each backend's preprocessing_applied list.
In the API (entries beginning API:, tagged API on the
page). The API prepares one circuit for each dispatch group, a set of backends that
receive the same text. Statevector mode has one group. Measured mode has two:
measured_native, backends that sample with their own sampler, and
measured_sampled, backends whose final statevector is sampled. In
statevector mode the API first removes the final measurements. With Apply SDK
Preprocessing on, it then makes these changes in order:
- When a register and its index are separated by spaces (
q [ 0 ]), it removes the spaces, and with them every comment. - It merges several quantum registers into one in declaration order.
- A parameter of a top-level gate call that contains
^orexp(), which pytket's parser does not accept, is replaced by its value in double precision; the text is then rebuilt without comments. A^orexp()inside a gate definition is refused with HTTP 400; write the power as a product or run with preprocessing off. - It passes the circuit through pytket (parse, then write), which removes comments, barriers and the calls of a gate whose definition has an empty body.
- pytket writes every multi-controlled X as
c4x; the API renames each such call by its number of operands tocx,ccx,c3xorc4x.
Each of these changes, when it applies, adds an API: entry.
The pytket round-trip inlines custom gate definitions, expands register
broadcasts and writes the gates in pytket's QASM gate set, with angles as multiples of
π. pytket 1.33 writes u as u3, p as
u1 and u0 as u3(0,0,0); it decomposes
cp into three u3 and two cx, cu into
five u3 and two cx, and rccx, rc3x and
c3sqrtx into u3 and cx. It keeps cu1,
crz, crx, cry, cu3, ch,
cy, csx, rxx, rzz, ccx,
cswap, c3x and c4x as written, the
multi-controlled X gates through the renaming above. tket sets a
parameter within 1e-11 half-turns of a multiple of π/4 to that multiple; the
API: entries list each parameter moved in this way.
In measured mode the native group also receives a measurement of every qubit when the
circuit has none (see Counts keys); this happens with
preprocessing off too. With preprocessing off there is no register merge and no pytket
round-trip in any group, and statevector mode still removes the final measurements.
The report's dispatched_circuits lists which runners were in which
group.
In the runner. Each backend applies its own passes: gate rebasing,
barrier removal, and the SDK's default compilation pass at every optimization level. Passes
that the adapter applies in every case say so in their text. The Qibo and quimb
QASM parsers lack some qelib1.inc gates (ch,
cswap, c3x, c4x, rccx,
rc3x, c3sqrtx and u0 for Qibo; u,
p, ch, csx, cp, cu,
rccx, c3x, c3sqrtx, rc3x and
c4x for quimb). With preprocessing on, these two adapters insert the
qelib1.inc definitions (Qiskit 2.5.2's copy) of the gates a circuit uses
and list them; for quimb the built-in U in those definitions is written as
u3. With preprocessing off these gates are refused.
Which qelib1.inc. Gate names and their matrices follow
Qiskit's qelib1.inc (Qiskit 2.5.2's copy), the file the structure checks
read and the inserted definitions come from. The file published with the OpenQASM 2.0
paper defines 23 gates; Qiskit's copy adds 19 (u0, u,
p, sx, sxdg, swap,
cswap, crx, cry, cp,
csx, cu, rxx, rzz,
rccx, rc3x, c3x, c3sqrtx and
c4x). Of the gates in both files only cu3 has a different
matrix: Qiskit's copy also applies u1((lambda+phi)/2) to the control, a
phase on the control's |1⟩ branch. Qibo's parser follows the paper's
cu3, so on a circuit with cu3 Qibo's result can differ from
the other backends by that phase.
The RO-Crate stores the circuit as submitted (circuit.qasm), the circuit
the API sent to each runner (dispatched_circuits/<runner>.qasm;
<circuit>/<runner>.qasm in a playlist crate) and the circuit
each backend executed (transpiled_circuits/). A playlist crate or an
experiment bundle that includes bundled MQT Bench or QASMBench circuits also holds
that suite's licence under licenses/.
Run options
The settings chips above the run button (Backends, Execution, SDK Preprocessing,
Compile-only services, Agreement Thresholds, Seed) each show the current value, are
filled in indigo when it differs from the default, and open their controls in a
popover. The
settings apply to single runs, playlist runs and experiments alike. Each has an API
field of the same meaning, listed in the Swagger UI at /docs.
- Global Optimization Level (
optimization_level, Backends popover, 0 None, 1 Light, 2 Medium or 3 Heavy, default 0) is the transpiler or optimization level asked of every backend. Each backend runs at the nearest level it supports, at most its own maximum (max_levelinGET /runners); each result recordsoptimization_level_requestedand the level applied,optimization_level. The Optimization level column of the same popover overrides the level for one backend (runner_config, for example{"qiskit": 2}); the API refuses a level above that backend's maximum with HTTP 400. Pointing at a backend's level menu shows what each of its levels does. - Timeout per backend (
timeout_seconds, Execution chip, 10 to 300 s, default 60 s) covers start-up, warm-up and every timed run; Resources, queueing and timeouts describes its scope. - Timing repeats (
timing_repeats, Execution chip, 1 to 10, default 1) is the number of timed runs per backend after one discarded warm-up run. All of them run in one process and give one result per backend. With more than one, the result carriescompilation_time_samplesandsimulation_time_sampleswith their mean, median and standard deviation,timing_samples(the number of timed runs) andtiming_statistic: "median"; the Performance tab shows the median ± the sample standard deviation with n. The warm-up and all repeats share one timeout. To compare separate runs of one backend with each other, use multi-run mode (below). - Exclusive timing run (
exclusive, Execution chip, default off). The backends run one at a time, each in its own phase, and the job runs only while no other run is in flight on this server: it waits for running jobs, and jobs submitted meanwhile wait for it. Results recordexclusiveandexclusive_wait_sec. Every result recordsgate_wait_sec, so a job held back by another user's exclusive run shows how long it waited; its runners show as queued meanwhile. When an exclusive run ends, the jobs it held back start together and overlap each other (server_overlapping_runs). Ifrunner_phasesgives every backend a different phase, that order is kept; otherwise the backends run in order of their ids. Reports record the phases used aseffective_runner_phases. The option cannot hold back other programs on the host, and in Kubernetes mode it covers only this server's runner Jobs. Each client may have one unfinished exclusive job; a second returns HTTP 429. An exclusive circuit that cannot start within the server's wait cap (exclusive.max_wait_secinGET /config, default 600 s) fails with that reason.GET /configalso shows whether an exclusive run is running or waiting, and operators can turn the option off withQROSETTA_EXCLUSIVE_ENABLED=false. - Execution Environment (Execution chip) shows where this server runs the backends, as local runner services or as Kubernetes Jobs; it cannot be changed from the page, and the report records it.
- Shots (
n_shots, measured mode, 1 to 1,000,000, default 8,200; the field appears beside the chips when Measured is ticked). With 14 backends, 8,199 shots per backend give the power model 0.8 on circuits with up to 16 outcomes. Circuits with more outcomes need more shots, and the Summary recommends a count when it can. - Multi-run mode (self-comparison), in the Backends popover, runs
one backend several times, each run in its own process, at the same or different
optimization levels, and compares the runs with each other as if they were separate
backends. In the API a list in
runner_configruns that backend once per element, for example{"qiskit": [0, 0, 1]}. Each run gets the key<runner>~opt<L>~run<N>, which also enters its seed derivation. A request may ask for at most 16 runs of one backend and 48 runs in total; more is refused with HTTP 422. In the popover each count must be a whole number; while a count is not, or the counts exceed these limits, the popover and the Run footer say so and the run button is disabled. - Custom ordering (phases) (
runner_phases), in the Backends popover, gives each backend a phase number in a Phase column. Backends with the same number run at the same time, and phases run in ascending order. Two buttons fill the column: All concurrent sets every phase to 1, and Sequential numbers the selected backends 1, 2, 3, ... in the order of the list, so they run one after another. In measured mode the phases cover both groups of backends (sampled statevector and native sampling): phase 2 of either group starts only after phase 1 of both has finished. Without phases every backend runs at once. Phases decide which backends share the host at the same moment; the CPU quota of each runner stays the same. - Apply SDK Preprocessing (
apply_preprocessing, SDK Preprocessing chip): On, Off, or Both, which runs an experiment (Several circuits and experiments); a compile-only run takes On or Off. Circuit preprocessing describes what it changes. - Bypass API Safety Limits (
bypass_limits, SDK Preprocessing chip) lifts the playlist length limit and, for an experiment, the limit on circuits × preprocessing settings. On a local server it also lifts the QASM size limit and the statement-count limit. The request-body limit, the qubit limits, the expanded-gate and nested-gate-call limits (which protect the runners' memory), the preparation limits, the syntax checks and the measurement checks always apply. On a local server anyone may set the option. On any other server only a signed-in account may (bypass_limits_requires_accountinGET /config): a request without a valid sign-in is refused with HTTP 401, and the page disables the option while you are signed out. The report records the setting.
The bit-order probe
The Bit-order probe algorithm (2 qubits or more) applies
x to qubit 0 and a different ry angle to every other qubit,
so its output changes under every qubit permutation. It shows each backend's declared
bit order directly: an lsb backend and an msb backend agree
on it only after the bit reversal their declarations imply.
Input limits
- At most 18 qubits in statevector mode, 24 in measured mode and 24 in a
compile-only run, counted over every
qregdeclaration. - At most 1,000,000 characters of QASM text (HTTP 413 above). Separately, every
request body, including
POST /export, may hold at most 1,048,576 bytes (1 MiB,limits.max_request_bytes). That limit counts the JSON as sent, in which every line break and quote of a circuit takes two bytes, and a playlist sends all its circuits from the editor or from files in one request. The page checks both limits before it sends a run and names the circuit or request that is too large; split a large playlist and run the parts one after another. - Run, circuit, task and author names hold at most 200 characters
(
limits.max_label_length), without control characters, invisible formatting characters or line separators. The Run Name field takes at most 200 characters, and a Run Name holding such a character blocks the run until it is removed. From circuit, task and author names the page removes such characters, and it shortens longer names, before it sends them. - At most 10,000 operation statements (gates,
measure,reset,barrier,if;max_qasm_gatesinGET /config), counted at top level and inside gate definitions; a definition with an empty body counts as one. The header, theincludeline and register declarations are not counted. - At most 1,024 classical bits over all
cregdeclarations (limits.max_classical_bits). Every register holds at least one qubit or bit, and a gate parameter has at most 1,000 characters. OpenQASM keywords (gate,measure,pi,sin, ...) cannot name a register or gate. A//comment that contains/*needs a*/after it on the same line. - At most 200,000 gate applications after user gate definitions and register
broadcasts are expanded (
limits.max_expanded_gates), and at most 4,096 applications of user-defined gates made from inside gate definitions (limits.max_nested_gate_calls; top-level calls are not counted). The first limit stops a short circuit of nested definitions from expanding to millions of gates. The second exists because several parsers keep a copy of a nested definition for every application: eleven levels of definitions that each call the level below twice (4,094 nested applications) peaked at about 710 MiB in the PennyLane runners and twelve levels at about 1,090 MiB, while 8,192 top-level calls of one definition took about 340 MiB. The bundled benchmark circuits are exempt. - With
apply_preprocessingon, the API prepares each circuit (the pytket round-trip) in a separate process limited to 1,024 MiB and 120 s (limits.prep_max_mibandlimits.prep_timeout_sec; server settingsQROSETTA_PREP_MAX_MIBandQROSETTA_PREP_TIMEOUT_SEC). A preparation that exceeds either is stopped, and the run fails with a message naming the limit and its value; withapply_preprocessing=falsethe text is dispatched without the round-trip. The memory a preparation needs cannot be read from the circuit text, so only circuits whose preparation has been measured are refused in advance. Among the bundled circuits, the MQT Bench Grover circuits exceed the memory limit from 15 qubits: in a measurement of each circuit's preparation,grover-noancillaneeded about 1.5 GiB andgrover-v-chainabout 1.2 GiB at 15 qubits, both more than 2 GiB from 16 and 17 qubits respectively, and every other bundled circuit stayed under 400 MiB.GET /configlists the bundled circuits over the server's limit asbundled_over_prep_limit. A run that includes one of them with preprocessing on is refused with HTTP 400 naming the circuit, and the page says so before it sends the run. Written-out versions of these circuits are refused earlier, by the expanded-gate and nested-gate-call limits. - A playlist run holds at most 400 circuits (
limits.max_batch_tasks), enough for both bundled suites (269 MQT Bench and 55 QASMBench circuits) in one playlist. A longer playlist is refused with HTTP 400, and the page says so before it sends the run; split it and run the parts one after another. - A custom
gateoropaquename that a backend's QASM parser reserves for its own operations (pytket, Qiskit, myQLM, Qibo and quimb each have such names, for examplesleep,fsimandiswap) is refused with HTTP 400 in every mode, whichever backends are selected, so that every backend receives the circuit as written. The message names the gate and the line of its definition; rename the gate.
Quirk visualizer
The editor's Visualize button converts the editor's circuit to Quirk's
JSON format (POST /visualize/quirk) and opens it in Quirk-E at
https://quirk-e.dev, an external web page based on Craig Gidney's Quirk,
in a frame that covers the window. Open in
Quirk (the same page in a new tab) and Close sit above the
frame. Escape also closes it, except while the keyboard focus is inside the Quirk
frame, where Quirk receives the key; Tab out of the frame or use Close. On a phone or
tablet Quirk's page scrolls sideways inside the frame.
The circuit is checked as for a run, its registers are merged in declaration order,
and pytket parses it. Gates that have a Quirk symbol keep it: H, X, Y, Z, S and T (as
Z^½ and Z^¼) and their inverses, sx as X^½, rx, ry, rz, u1 and p as X^t, Y^t and Z^t
with the angle in half-turns, cx, cy, cz, ch, ccx, c3x and c4x as controls, swap and
cswap. Every other gate is drawn as cx and single-qubit Z^t and Y^t rotations with the
same matrix up to a global phase, and the response's notes name those
gates. Final measurements are drawn in a last column; barriers are not drawn. The
visualizer opens at most 16 qubits (Quirk's own limit) and 1,000 columns, and refuses
reset, if and a gate after a measurement of the same qubit,
with the reason.
Several circuits and experiments
One press of the run button can start more than one job:
| Choice under Run and Mode | Request |
|---|---|
| Editor code, Statevector or Measured | POST /compare or POST /compare_measured |
| Playlist | POST /run_batch_suite, one job for all its circuits |
| Statevector and Measured both ticked | Two jobs, run one after the other; compile-only services go with the first |
| Compile-only services chosen, neither Statevector nor Measured ticked | The same request with simulate: false: only the compile-only services run, and the report records simulated: false |
| SDK Preprocessing set to Both | POST /experiments (below); a compile-only run (neither mode ticked) needs On or Off and is not submitted with Both |
When one press starts two jobs, a row above the tabs switches between their results.
A playlist result opens on the Suite Summary tab. A playlist shares
one master seed, and because a backend's runner_seed depends only on the
master seed and its runner key (the backend's id, or
<runner>~opt<L>~run<N> in multi-run mode), each
backend receives the same
runner_seed for every circuit. Each circuit is named after its source
(name in the request, else the algorithm or file name) and its qubit
count; a bundled benchmark circuit adds its suite, as in ghz (4q) [MQT
Bench], to tell it from the generated algorithm of the same name.
Experiments: preprocessing on and off
With SDK Preprocessing set to Both, each circuit runs once with
preprocessing on and once with it off. The result is one ZIP bundle, in a top-level
folder named experiment_<label>, or
experiment_ followed by the first eight characters of the job ID when
there is no label. It contains:
inputs/<circuit>.qasm: the QASM of every circuit as it was at run time;results/<setting>/<circuit>.json: the report of each circuit and setting, with each statevector replaced by its sha256 and length unless the request setskeep_statevectors: true(an API field the page does not send);conformance_matrix.csv: whether each circuit ran on each backend. Every error row carries the markeruntriaged, for you to classify as an adapter issue, an SDK issue, by-design behaviour or a resource limit; the software does not classify errors.errors/<backend>.logholds the error texts;agreement_prevalence.csv: how many backend pairs fell in each class, bymeasured_assessmentin measured mode and by label in statevector mode;performance.csvand aREADME.txtthat explains the files;manifest.json: the git commit, the executed SDK versions, the seeds used and the effective configuration.config_sha256andeffective_config_sha256are the sha256 ofjson.dumps(config, sort_keys=True, default=str)in Python, encoded as UTF-8 (separators", "and": ", non-ASCII characters escaped);runners/<runner>/requirements.lock: each runner's pinned environment, under the same rule as in an RO-Crate.
In the API the experiment is POST /experiments with a list of
circuits and preprocessing_modes ([true],
[false] or [true, false]); the bundle is
GET /experiments/{job_id}/bundle. The bundle is written to the API's local
disk as the cells finish and is deleted with the job, at the latest after the job's
retention time. Experiments are not saved to the run history. One experiment runs at
most 200 combinations of circuit and preprocessing setting
(limits.max_experiment_cells in GET /config), so
Both takes at most 100 circuits; a larger request is refused with
HTTP 400 before it starts, and the page says so before it sends it.
Compile-only services chosen together with Both and at least one
ticked mode run with the first
experiment of the press of Run (the statevector one when both modes are ticked), once
per circuit and setting. That experiment's panel lists them, and its bundle holds the
outputs under compiled_circuits/<setting>/<circuit>/ and in
compiled_circuits.csv; the other experiment's panel says where they
are.
Command-line tool
qrosetta starts and stops a local stack and runs, follows and saves jobs on
any server. It needs Python 3.11 or later and uses the standard library only. Install it
from PyPI (pipx install qrosetta) or run ./qrosetta from a
checkout; the host requirements and setup steps per distribution are in the
README.
qrosetta help all lists every command and qrosetta help
command (or --help) gives its flags and examples. Commands
marked experimental print a notice and may change their behaviour and JSON in any
release. The other commands keep their names, exit codes and the flags not marked
experimental within major version 2; their JSON is stable only where its schema is at @1 (see
JSON output).
Global options, accepted anywhere on the line: --json, --server
URL|NAME (a URL, or a [servers.NAME] table of the config; default
local), --config FILE and --project-dir DIR (the
checkout whose compose file to use). In installed mode, pull fetches the release's
images by digest and build builds them from the build kit the package
carries; in a checkout, build builds them from the working tree. The
release does not publish the myQLM, cuQuantum and BQSKit images;
qrosetta build NAME builds them.
Local stack
| Command | What it does | Main flags |
|---|---|---|
doctor | Host checks (system, engine, Compose v2, podman socket, subuid, cgroup delegation, port, disk, job settings, stored credentials, server readiness, runners, compilers), each problem with a numbered fix. Exit 17 on a FAIL. | — |
pull | Pulls the release's images by digest (installed mode), checking digests, labels and, with cosign installed, signatures. | --profile P, --core, --all, --require-signature, --yes, service names |
build | Builds images on this computer: from the checkout, or in installed mode from the package's build kit. | --profile P, --yes, service names (default: every enabled service) |
start | Starts the stack, or adds services to a running one. Never builds; recreates a container whose image or compose configuration changed. Checks the engine, Compose, podman socket, cgroup and port before calling compose. In the foreground it follows the logs; -d returns when the API (GET /ready) and every started runner and compiler are ready, up to 180 s. Ends with the address the server runs at. | --profile P, -d, --bind ADDR:PORT, --on-exit standby|remove|ask, --no-cpu-quota / --cpu-quota, --yes, --allow-emulation, service names |
status | The address, then services, state, memory, the commit of each container's image, data disk use and the finished-job limits. Exit 0 whatever the state. | — |
stop | Standby: stops the containers and keeps containers, images and data. Refused while runs are in flight. | --force |
remove (rm) | Removes containers, pods and networks; keeps images and the data volume unless asked. Refused while runs are in flight. | --images, --data --confirm NAME, --all --confirm NAME, --force |
logs | Container logs, passed through. | --tail N (default 100), --no-follow, a service name |
images (images ls) | This stack's images: missing, pulled, loaded, built or unknown, with sizes. | --profile P |
images verify | Checks each image's labels, baked commit and build identity, and in installed mode its digest against the release manifest and its cosign signature. | --profile P, --require-signature, service names |
images save (experimental) | Writes the stack's images to a new directory of archives with an index, for a machine without registry access. | -o DIR, --profile P, --yes |
images load | Loads archives written by images save, checked against their index (and in installed mode the release manifest). | DIR, service names, --yes |
profiles | The profiles and their services. | — |
version | CLI version, install mode, release manifest and server version. | — |
config path, config show | The config file's path; the effective settings with where each comes from. | — |
config init, config edit (experimental) | Write a commented config template; open the file in $VISUAL or $EDITOR. | — |
help | Help for a command; help all lists every command. | — |
stop, remove, build, pull, images
save, images load, and start when it adds or recreates
services of a running stack, are refused while the server reports runs in flight
(exit 15); --force or --yes goes ahead, and runs that then lose
their runner are recorded as stopped by the user. stop, remove,
build and start open a host-load notice (see
Host load). The command acts only on containers, networks,
volumes and images that carry this project's compose and org.qrosetta
labels; for anything else in the way it prints the command instead of acting.
Runs and results
| Command | What it does | Main flags |
|---|---|---|
info | The server's version, API levels, features, mode, run gate, request defaults and limits. Exit 11 when no server answers. | — |
backends | The server's simulators: availability, default selection, levels, device, precision, bit order and profiles. | --ids, --levels, --fresh (needs a sign-in; 6 a minute) |
compilers | The compile-only services: availability, levels, profiles and versions. | --ids, --levels, --fresh |
circuits algorithms|examples|mqt|qasmbench | The circuit catalogs, with the reference form each takes (algorithm:ID:QUBITS, example:NAME, mqt:ALGORITHM:QUBITS, qasmbench:NAME). | --max-qubits N (not for QASMBench), --filter TEXT |
circuits get | One circuit's OpenQASM 2.0 text. | REF, -o PATH|- |
login, logout, whoami | Sign in and store the token for this server (the password from a prompt or --password-stdin, never an argument); sign out on the server and delete the stored token; show the account the token (or QROSETTA_TOKEN) signs in as. | --email, --password-stdin |
run | Plans the request through POST /plan, runs the jobs one after another, follows them and saves their results under ./qrosetta-results. Circuits are files, - for stdin, or catalog references; two or more make a playlist. | -m statevector,measured,compile, --playlist FILE, -b KEYS, --skip KEYS, --shots N, -O [KEY=]N, --timeout, --repeats N, --exclusive, --preprocessing on|off|both, --compiler KEY=L[,L], --threshold NAME=VALUE, --seed N, --name, --save LIST, --crate, --detach, --dry-run, --request FILE (replay), --fail-on LIST, --wait-timeout |
wait | Follows detached jobs and saves them where their run created their directories. While the server gives no answer, or a proxy answers 502, 503 or 504, it asks again after 3, 6, 12 and 24 s and then every 30 s, for up to 5 minutes, then exits 11. | job:ID or an id prefix, --all, --wait-timeout, --save, --fail-on |
jobs (jobs ls) | The jobs this machine submitted, with their server status. | --offline |
jobs status | One job's status, without its report. | job:ID |
selftest | The self-test with image probes; reports and crates saved (see Self-test). Exit 9 on a FAIL. | --backends KEYS, --no-images, -o DIR |
show summary | The server's summary of a result: outcomes, per-backend counts, caveats. | --result latest|job:ID|PATH, --task N, --job MODE |
export crate | Writes a result's RO-Crate ZIP. | --result, --job MODE (a result with several jobs), -o PATH|-, --statevectors, --author, --affiliation, --item VIEW=FMT, --allow-supplied (after the job expired, from the saved report, recorded as client_supplied) |
export report | Writes a result's full report JSON. | --result, --job MODE, -o PATH|- |
show circuits, show diff (experimental) | The circuit texts of a result (submitted, dispatched, executed, compiled); a unified diff of two of them. | --pane ID; --ignore comments,header,whitespace |
show artifacts, show views (experimental) | The figures and tables a result offers; the export views with their parameters, defaults and formats. | — |
export figure, export views (experimental) | Writes one figure or table of a result; writes the export views listing as JSON. | ARTIFACT, --format, --scale 1-4, --param K=V, -o |
api | One raw request to the server, with sign-in, envelope and exit codes. | METHOD PATH, -f KEY=VALUE, --input FILE|-, --anonymous |
A run never resends a request. Reads (GET and read-only POSTs) are retried three times,
after 1, 2 and 4 s, on a transient error, a 502, 503 or 504, or a 429 with
Retry-After of at most 30 s. Ctrl-C stops waiting and leaves the job running
on the server; qrosetta wait job:ID saves it later. A job the server
answers 404 for is lost (exit 14).
Each run creates one directory under ./qrosetta-results (or
--results-dir, QROSETTA_RESULTS_DIR, [results]
dir; -o DIR names it exactly), called
YYYYMMDD-HHMMSSZ-name after the UTC start time and
--name or the circuit's name. It holds:
plan.json: the plan request with the source of each setting, the server's versions and the planned requests, whichrun --requestreplays;- one directory per job,
mode-id8(statevector,measured,compileorexperiment-mode, then the first 8 characters of the job id), withrequest.json(the request as sent),job.json(the final job envelope without its results, the server and how the save went),report.jsonandsummary.jsonby default,ro-crate.zipon a local stack whose server offers gated saves or with--crate,circuit-texts.jsonwith--save circuits, an experiment'sbundle.zipin place of the report and summary, aSHA256SUMSover these files, andSTATUS, written last:complete,complete: minimal,partial:reasons,crate-deferred,job-failedorjob-lost; SHA256SUMSoverplan.json, written once every job is saved, when the parent directory'slatestlink is moved to this directory.
wait saves into the job directories run --detach created;
export crate and export report write
ro-crate.zip and report.json into the job's directory unless
-o names another path, and refresh its SHA256SUMS.
selftest writes time-selftest with
selftest.json beside its job directories. A result reference such as
--result latest, job:ID or a path reads these
directories.
Exit codes
Codes 3 to 9 mean the job ran and its results exist; 10 and above are errors, and the
last line of the output names the fix. With several codes the most serious wins: the
signal codes 129, 130, 141 and 143 first, then 1, 2, 12, 11, 13, 14, 10, 15, 16, 17,
then 9, 5, 6, 7, 3, 8, 4, 0. A difference between backends
is a result: run and wait exit 0 unless --fail-on
names the outcome.
| Code | Name | Meaning |
|---|---|---|
| 0 | ok | Done, or a finished job whose outcomes match nothing in --fail-on. |
| 1 | internal | A fault in the CLI; the traceback goes to $XDG_STATE_HOME/qrosetta/cli.log. |
| 2 | usage | Bad command, flag, value or reference, or a prompt needed without a terminal. |
| 3 | disagreement | --fail-on matched a difference outcome. |
| 4 | runs_without_output | --fail-on matched runs without output (error, timeout, offline, refused, or a failed playlist task). |
| 5 | job_failed | The server job failed. |
| 6 | job_cancelled | Reserved: the server reported the job cancelled. |
| 7 | wait_timeout | --wait-timeout reached; the job is still running. |
| 8 | not_established | --fail-on matched an inconclusive or no-comparison outcome. |
| 9 | selftest_failed | A self-test check failed. |
| 10 | refused | The server answered 400, 409, 413, 422 or another client error not listed under 13, 14 or 15, the plan has a problem, or the request is over the body limit. |
| 11 | unreachable | No answer (connection, DNS, TLS), a server error other than 503 (500, 502, 504), or the local stack is not running. |
| 12 | incompatible | API levels, a missing feature or field, or a release mismatch. |
| 13 | auth | Not signed in, token expired, 401 or 403. |
| 14 | not_found | Unknown or expired job, run, link, example, key, file or result. |
| 15 | busy | 429 after retries, 503, the exclusive slot taken, or an action refused because runs are in flight. |
| 16 | engine | A container engine or image problem, including a failed start pre-check. |
| 17 | checks_failed | doctor found a FAIL. |
| 129, 130, 141, 143 | signals | SIGHUP, SIGINT, SIGPIPE, SIGTERM. |
Profiles
A profile names a set of services; the core services nginx and
api are always added. The profiles come from the
org.qrosetta.profiles labels of docker-compose.yml, and
GET /runners and GET /compilers report them per service. The
page's Backends and Compile-only services lists name the commands that add a service the
stack does not run.
| Profile | Services besides the core |
|---|---|
minimal | Qiskit, Qulacs and Cirq. |
cpu | The 13 enabled backends that need no GPU: Qiskit, Cirq, Qulacs, QuEST, PennyLane Lightning, PennyLane Default, Qibo, Qrisp, myQLM, PyQuil, qsim-Cirq, TorchQuantum and quimb. |
gpu | The cpu backends and cuQuantum. |
compilers | The eight compile-only services (BQSKit, PyZX, QMAP, Cirq transformers, staq, Q-Synth, Quartz, Synthetiq) and no backend: the profile for testing compilers. |
full | Every enabled backend and compiler. |
Configuration
The config file is $XDG_CONFIG_HOME/qrosetta/config.toml (or
--config, QROSETTA_CONFIG); qrosetta config path
prints it and qrosetta config init writes a commented template. It holds no
measurement setting: shots, seeds, timeouts, backends and every other run setting are
flags of qrosetta run, so a command copied from a paper specifies its run
completely. Besides [lifecycle] it takes default_server,
[servers.NAME] (url, allow_insecure_http),
[results] dir, [auth] credentials, [output]
(color, progress, experimental_notice) and, as an
experiment for start and build, [profiles.NAME].
[lifecycle] key | Default | Meaning |
|---|---|---|
bind | 127.0.0.1:8080 | The address the web server is published on (also --bind and QROSETTA_HTTP_BIND). A non-loopback address gets no TLS. |
cpu_quota | true | false starts every service without its CPU limit, as start --no-cpu-quota; results record it. |
engine | the first of docker and podman whose info answers | docker or podman (also QROSETTA_ENGINE). |
on_exit | ask on a terminal, else standby | What Ctrl-C, SIGTERM or SIGHUP does to a foreground start: standby, remove or ask (also --on-exit, QROSETTA_ON_EXIT). ask takes standby after 10 s without an answer. |
jobs_kept | 200 | Finished jobs the local API keeps (QROSETTA_JOB_MAX_KEPT). |
job_storage | "4GiB" | The API's disk budget for job reports, as "8GiB", "4096MiB" or a number of MiB (QROSETTA_JOB_SPILL_MAX_MIB). |
job_memory | "512MiB" | The estimated API memory finished jobs may hold (QROSETTA_JOB_MEMORY_MAX_MIB). doctor warns from 1,536 MiB, which leaves the 2 GiB API container less than 512 MiB of its own. |
job_retention | "24h" | The longest a finished job is kept, as "90m", "3600s" or a number of seconds; at least 1 minute (QROSETTA_JOB_TTL_SEC). |
A flag comes before its environment variable, and the variable before the file.
start --no-cpu-quota and --cpu-quota are remembered as a stack
setting of the project, which comes before cpu_quota in the file.
start recreates the API when a job limit changes. QROSETTA_SERVER, QROSETTA_TOKEN,
QROSETTA_PROJECT_DIR, QROSETTA_PROJECT (the compose project,
default qsimulators) and QROSETTA_RESULTS_DIR are read too. The
sign-in token is stored in $XDG_STATE_HOME/qrosetta/credentials.json with
mode 0600.
The published port
An address chosen with --bind, QROSETTA_HTTP_BIND (in the
environment or the checkout's .env) or [lifecycle] bind is used
as given, and start refuses it when another program holds it; a
.env value of 127.0.0.1:8080, the default, chooses nothing. When no address
was chosen, start uses the address it recorded for the project, else
127.0.0.1:8080. When another program holds that port, it takes the first other free port
of 127.0.0.1:8080 to 8089, says which (for example "Port 8080 is in use by another
program; using 8081."), and records the address in the project's stack settings;
config show lists it as chosen by start. status,
run and the other commands find the local server there, or at the address
the environment, the config file or the checkout's .env chose.
stop keeps the recorded address; remove, and a
start on a chosen address, forget it. When another Quantum Rosetta project
on this computer publishes the port, start refuses whatever the address's
source and prints the command that stops that project. start never stops a
program that holds a port.
JSON output
With --json every command writes one JSON object to stdout, also on failure:
{schema, cli_version, server, ok, exit_code, outcome, data, warnings, error}.
schema names the payload type as qrosetta.cli/name@n
(for example qrosetta.cli/run-result@1, status@1,
selftest@1), so renaming a command does not rename its schema. error is
{code, reason, message, hint, http_status, detail}, with the exit code's name
as code, a snake_case reason and the server's
detail verbatim; outcomes (exit 3 to 9) leave error null and
data complete. Within a schema version at @1 or above, fields are
only added, so a consumer should ignore fields it does not know. A schema at
@0 may change in any release: every experimental command writes one, and so
do some stable commands whose JSON is not yet fixed (for example
doctor@0, backends@0, start@0). The stable
schemas are run-result, plan, job,
jobs, status, images, selftest,
info, version, summary and export. Server objects embedded in data (from
/config, /runners, the summary) carry their own versions; the
report itself is never embedded, and files are referenced by absolute path. The JSON
Schemas ship with the package in qrosetta_cli/schemas/. Without
--json, data goes to stdout and progress, warnings and errors to stderr; on a
UTF-8 terminal check rows carry marks (✓ ✗ !), otherwise the words PASS, FAIL and WARN,
and colour follows [output] color, NO_COLOR and
CLICOLOR_FORCE.
Accounts, history & autosave
An account is optional. Signing in, or registering with an email and password through the
Login / Register button, turns on automatic run history for single runs
and playlists started from the page: each is saved to your account when it completes,
under its run name. Experiments are never saved; their result is the bundle you download.
Runs started through the API are not saved automatically; save one with
POST /history/runs/from_job/{job_id} (see Reports and
exports) while the server still holds it.
Without an account, nothing is saved permanently on the server. The server keeps each
finished job for its retention time (24 hours by default on a local stack, 30 minutes
on other servers, less time when its job limits are reached; see How
long the server keeps a job), and this browser lists the jobs it submitted under
Earlier runs from this browser for that time (see
Quickstart). To keep a result longer, download its report or
RO-Crate, turn on Auto-save results to a folder, or sign in and save
it. qrosetta run and wait save each job's report, summary
and, on a local stack, its crate under ./qrosetta-results (see
Command-line tool), with or without an account. A restart of the
API container loses every job it holds.
Your Run History lists past runs. Rename them, download their stored
reports, or delete them singly or in bulk. Stored reports have their statevectors removed;
statevector_sha256 and statevector_length are kept. While a run
is in progress, past runs can be renamed, downloaded and deleted but not opened, because
opening one would replace the view of the run. A saved run opened from History has the
same heading as when it ran, with its mode and shot count. A run uploaded with
POST /history/runs, instead of saved from this server's job, is tagged
Uploaded in the Viewing Past Run banner, and one whose stored report
names no source is tagged Source not recorded; the History list
itself does not show the source.
Share links
The Save and share box in the Circuits tab saves the run on screen to
your history (also a run started before you signed in, while the server still holds it)
and creates read-only links. Create link gives a
/share.html#<token> address that expires after 1, 7, 30 or 90 days. An
optional label names the link in your own list and is never shown to its recipients. A
link created from a playlist circuit's view opens on that circuit. Anyone with the address
sees the run's name and save time and its circuit texts: the submitted circuit, the
dispatched circuits and each backend's executed circuit with its transforms, SDK versions,
gate count and depth, plus the compiler input and compiled circuits when the run had any.
An uploaded report is marked as uploaded. The page shows no results, timings, error
messages or account details. The token is shown once and the server stores only its
SHA-256; it sits after #, so browsers do not send it in requests or
referrers. Revoke a link in the same tab. Deleting the run or the account deletes its
links, and a deactivated account's links stop working.
Sessions and the account menu
A session lasts 30 minutes, measured on the server's clock from the sign-in token's issue time, so a computer clock that is fast or slow does not end it early. When it expires, the page signs you out and says that runs started from then on are not saved; pressing Run with an expired session asks first. If it expires before a run finishes, the page offers Sign in and save, which saves the run after you sign in again, while the server still holds the job. When one press of Run starts a statevector and a measured run with a Run Name, History saves them as "name (Statevector)" and "name (Measured)".
Logout, Change Password and Delete Account are in the
menu under your email address in the header. Logout ends every session of the account,
in this browser, other browsers and qrosetta, because the server refuses
every token issued before it; it also clears this browser's list of the account's recent
jobs (an expired session keeps the list, so a pending job can be resumed after signing in
again). Change Password asks for the current and the new password
(POST /auth/password) and ends every other session; this browser stays
signed in. Delete Account asks for the password (DELETE /auth/me takes it in
the body, at the sign-in rate limit), then removes the account with its saved runs and
circuits; a token issued before the deletion stops working. The sign-in token is kept in
this browser's local storage. The page's Content-Security-Policy runs only scripts from
this server, and other sites cannot frame the page.
Run names
Run names may contain any emoji (with skin tones, variation selectors and joiners, such as 👩🔬) and the zero-width joiner and non-joiner that Persian and Indic scripts use. They may not contain control characters, line or paragraph separators, direction marks, overrides or isolates (U+200E, U+200F, U+061C, U+202A–U+202E, U+2066–U+2069), or the invisible characters soft hyphen, zero-width space, word joiner, invisible operators (U+2060–U+2064), byte-order mark, Hangul fillers and interlinear annotation marks. The message names the character and its position. The browser and the server check the same fixed list, so a name the page accepts is accepted when the run is saved. A saved run or circuit name needs at least one visible character: spaces, joiners, variation selectors, combining marks on their own (such as U+0301), format characters, the braille blank U+2800 and the object replacement character U+FFFC do not count. A stored name that holds refused characters is shown and exported without them.
Autosave to a folder
Independent of an account, the Execution chip offers Auto-save results to a folder: each completed run is written as a JSON file to a folder on your computer, with nothing uploaded. This needs the File System Access API, which Chromium-based browsers such as Chrome and Edge provide; other browsers show the option disabled with a note.
Reports and exports
How long the server keeps a job
The report sent to the browser replaces statevectors longer than 214
amplitudes (circuits over 14 qubits) with a placeholder and sets
statevector_omitted_for_display. The server keeps each finished job with its
untruncated report within four limits, published in GET /config
limits:
| Limit | Server default | Local stack | limits field | Server setting | [lifecycle] key |
|---|---|---|---|---|---|
| Retention after the job finished | 30 minutes | 24 hours | job_ttl_sec | QROSETTA_JOB_TTL_SEC | job_retention |
| Finished jobs kept | 200 | 200 | job_max_kept | QROSETTA_JOB_MAX_KEPT | jobs_kept |
| Estimated memory of kept jobs | 512 MiB | 512 MiB | job_memory_max_mib | QROSETTA_JOB_MEMORY_MAX_MIB | job_memory |
| Disk for untruncated reports | 10,240 MiB | 4,096 MiB | job_storage_max_mib | QROSETTA_JOB_SPILL_MAX_MIB | job_storage |
"Local stack" means one started with qrosetta start, from a checkout or
from the installed package (which writes its own compose file), or with
docker compose from the repository's compose file. Beyond the job count
or the memory budget, checked whenever a job finishes, the oldest jobs that finished more
than 30 minutes ago (limits.job_evictable_after_sec) are removed first, so on
a busy server a job can go before its retention time. Younger jobs are kept even over the
budget. A 24-qubit measured job on 14 backends holds about 21 MiB, so about 24 of them fit
in 512 MiB. A sweep every 10 minutes removes jobs past any limit, so a job can stay up to
10 minutes longer. The times the page gives for a kept job ("kept until 10:15 at the
latest") are the longest it is kept; a removed job answers 404, as after a restart. On a
local stack, set the limits in the qrosetta config file and run
qrosetta start -d, which recreates the API with them (see
Command-line tool); start, status and
doctor print the values in use.
Untruncated reports are kept on the API's local disk within the storage budget, and the
server keeps at least 1,024 MiB of that disk free
(limits.job_storage_min_free_mib,
QROSETTA_JOB_SPILL_MIN_FREE_MIB). One 18-qubit statevector circuit run on 14
backends takes about 78 MB. While either limit is crossed, a new run is refused with HTTP
503 and a Retry-After header, and the message names the limit. A playlist or
experiment checks before it writes each circuit's result; when the storage is full it
stops, and the job fails with a message naming the circuit and the limit. A
single-circuit run always keeps its report, so runs already in progress can take the
storage past its budget. Before a run is refused, and before a running playlist or
experiment stops, the server deletes finished jobs older than 30 minutes, oldest first,
until the storage is back within both limits.
Endpoints
| Endpoint | Returns |
|---|---|
GET /jobs/{job_id} | Job status, progress and the browser copy of the report. |
GET /jobs/{job_id}/report | The untruncated report as JSON, without the job envelope (the Download full report button). 404 if the job is unknown or expired, 409 if it has not completed. With ?gated=true (used by qrosetta on a local stack) the report is sent only while no run is in flight on the server, otherwise 409 with a detail starting gate_busy and Retry-After; runs submitted while it is sent wait for it and record gate_wait_sec. GET /jobs/{job_id} lists the job's save requests under saves: gated refusals, when one was admitted, deferred_sec from the first refusal to admission, and the ungated requests with how many started while a run was in flight. |
GET /jobs/{job_id}/summary | Each pair's verdict (pair_verdicts, in pairwise_agreement order) and the per-backend counts with the headline model (backend_verdicts); a playlist has one entry per circuit in benchmark_summary. analysis_version names the rule applied, report_analysis_version the analysis that produced the pair records. GET /history/runs/{run_id}/summary does the same for a saved run, and POST /summary (body {"results": report}, 120 requests a minute) for a report in the body. The verdicts are computed from the pair records, so for a report of the same analysis_version they equal the recorded pair_verdict and backend_verdicts. Same 404 and 409 cases. |
GET /jobs/{job_id}/circuit-texts | The panes of the Circuits tab per circuit (circuits; ?task= picks one circuit of a playlist) in the tab's order, with their ids (input, dispatched:<group>, executed:<result key>, compile-input, compiled:<compile key>). Each has its text and the fields a share link serves (transforms, gate metrics, status, SDK versions; no error text, timings or outputs). Same 404 and 409 cases; 400 for task on a single-circuit job. 120 requests a minute. |
GET /jobs/{job_id}/publication/artifacts | The figures and tables the server copy offers: each one's id (the artifact_id to render), label, group, formats and caption at default parameters; ?task= picks a playlist circuit. POST /publication/artifacts does the same for a report in the body. Rendering an id the report does not offer is a 404 whose detail lists the ids it does offer. |
GET /publication/views | Every export view of the Exports tab, in order: the artifact ids it renders with the formats the render routes take, the formats an export item of the view takes, and its parameters (type, allowed values or range, default; a null default is worked out from the report, as default_when_null says). 120 requests a minute. |
POST /jobs/{job_id}/export | An RO-Crate ZIP built from the server copy. Optional body: include_statevectors, author_name, author_affiliation, publication_artifacts. publication_artifacts.items lists views as {"view", "params", "formats"}: each figure goes to figures/<name>.<format> with figures/<name>.spec.json (the view, its parameters, the caption and the analysis version), each table to tables/<name>.<ext>, the glossary to reference/. The name is the view id followed by every parameter that differs from its default. A playlist crate draws each view for every circuit under figures/<circuit>/. A view or format name the request schema does not know is a 422; an unknown parameter, a bad parameter value, or a known format the view does not take is a 400. Same 404 and 409 cases; ?gated=true as for the report. |
POST /jobs/{job_id}/publication/render | One figure or table drawn from the server copy (body: artifact_id, format, scale, params, and for a playlist task, the circuit's index). Same 404 and 409 cases; 400 for a parameter or format the view does not take. POST /publication/render takes a report in the body instead. |
POST /export | An RO-Crate ZIP built from a report in the request body, within the 1,048,576-byte request limit. The body holds the same options as POST /jobs/{job_id}/export plus results, the report. Used for runs loaded from history and when the server copy has expired; it cannot include statevectors the browser copy does not hold. |
POST /history/runs/from_job/{job_id} | Saves a finished single or playlist job to the signed-in user's history from the server copy (optional body {"run_name": "..."}). 201 with the saved run; saving the same job again returns that run with 200, also after the job has expired. 404 if the job is unknown or expired and this account has not saved it; 409 if it has not finished or is an experiment; 403 if another account started it. A job submitted with a sign-in belongs to that account; one submitted without can be saved by any account that holds its id. GET /history/runs lists each run's job_id (null for a report uploaded with POST /history/runs). |
POST /history/runs/{run_id}/share-links | Creates a read-only link to one of your saved runs (optional body {"expires_in_days": 1..90, "label": "..."}, default 30 days; the label is at most 100 characters and shown only to you). 201 with the link's id, expiry and token; the token appears only in this response. 404 if the run is not yours; 409 when the run already has 10 active links. |
GET /history/runs/{run_id}/share-links | The links to one of your saved runs, with creation, expiry and revocation times, without tokens. |
DELETE /history/share-links/{link_id} | Revokes one of your links; it stops working at once. |
POST /shared/circuits | The circuit texts a link reads (body {"token": "..."}), with the run's name, save time, the link's expiry and report_source; no sign-in. 404 for a token that is unknown, expired or revoked, whose owner's account is deactivated, or whose run was deleted. 30 requests a minute per client address. |
GET /runners | The backends: id, enabled and available state (with the reason when unavailable), device, the description of each optimization level, and per endpoint (statevector, measured) the precision and qubit_ordering the adapter declares; null where the adapter sets the value at run time, as cuQuantum does for its precision. default_selected is true for every enabled backend, which a run naming no backends uses when it is available. profiles lists the built-in profiles the backend belongs to (see Command-line tool). backend and version are null. Availability comes from a probe of each backend, reused for 60 seconds. ?fresh=true (also on GET /compilers) probes now: only with a sign-in or the local lifecycle token, at most 6 times a minute per account (the lifecycle token counts as one client), and a round less than 5 seconds old is served again. A backend with a run in flight is not probed and reads available with reason busy; while an exclusive run holds the server nothing is probed and the last values come back with fresh: false and reason exclusive_run. A probe round counts as a shared dispatch, so an exclusive run waits for it. Each row then carries fresh, reason, probed_at and error_kind: dns (the name does not resolve), connect (not accepting connections, for example while it starts), timeout (no answer within 5 seconds) or http (an error status). |
GET /compilers | The compile-only services: id, name, enabled and available state, and a description of each optimization level. default_selected is false (a compiler runs only when a request names it); profiles is compilers and full for an enabled one. |
GET /quickload | The playlist's Quick Load sets: id, label and items (algorithm, qubits, name), which the server generates when the playlist runs. |
GET /health | {"status": "ok"} while the API process serves requests. It reads nothing else, so it stays 200 while the database or the job storage is down. The compose healthcheck and the Kubernetes liveness and startup probes call it. Runner and compiler images answer GET /health the same way, also while a run holds their execution slot. |
GET /ready | 200 with {"status": "ready", "checks": {"database": "ok", "job_storage": "ok"}} when the database answers SELECT 1 and the job storage directory takes a new file; otherwise 503 with detail naming the failed checks, each ok, failed or timeout (no answer within 2 seconds). A result less than a second old is served again. The Kubernetes readiness probe, qrosetta start -d and qrosetta doctor call it. Neither route needs a sign-in or is rate-limited, and neither names hosts, paths or error text. |
Export RO-Crate uses /jobs/{job_id}/export for a job run in this
session (or the saved run, for a run opened from history) unless Browser copy is
chosen in the Export panel, and offers the browser copy when the server copy has expired.
Report source in a crate
Every crate's provenance.json records report_source, set by the
export route and never read from the report: server_job for the server's copy
of a job; for a saved run, server_job when it was saved from a job
(POST /history/runs/from_job/{job_id}), upload when its report
was uploaded (POST /history/runs), and not_recorded when the
stored report names neither; and client_supplied for POST
/export, whose contents (git
commit, versions, circuit texts) are as the requester sent them. The same value is
report_source in results.json and the
#report-source PropertyValue of the crate and of its agreement analysis. For
any source other than server_job, ro-crate-metadata.json asserts
no completed or failed status for the backend runs and compiles, gives SDK versions and
the platform version only as supplied text, and the crate carries no runner or compiler
lock files and no links to a commit. A run uploaded to history keeps the uploaded
job_id as source_job_id.
Using the API from a script
/openapi.json describes every route, its request fields, the status codes it
can return and the shape of the reports; /docs and /redoc show
it. A run is a POST that returns a job envelope {job_id, status, ...}; poll
GET /jobs/{job_id} until status is completed or
failed. Its results has one of three shapes:
- a single-circuit report (
/compare,/compare_measured):raw_resultsis a list with one entry per run, keyed bysimulator;divergence_report.pairwise_agreementholds one record per pair;n_shotsis present only in measured mode; - a playlist report (
/run_batch_suite):modeandbenchmark_summary, one single-circuit report per task in task order, each withtask_name(the name followed by "(nq)", and by " [MQT Bench]" or " [QASMBench]" for a bundled benchmark circuit),task_qubitsandtask_request(the task as sent, including itsname); a task that failed before dispatch is{task_name, task_qubits, task_request, error}; - an experiment:
{experiment_summary}only; the per-circuit data is in the bundle.
GET /config starts with server, which a script reads first:
platform_version, api_levels ([min, max], the API
levels this server serves; a change that removes or renames a route or field raises the
maximum, and the previous level stays served), analysis_version (the
comparison code that labels new reports), git_sha (the commit of the API
image) and features, a map from feature name to version that only grows.
status_labels gives the word and tooltip ({label, hint}) the
page shows for each live status: runs for the values of
runner_statuses, tasks for a playlist circuit, and
phases for the job's phase.
GET /config also publishes request_defaults, the value the
server uses for every request field a run omits, read from the request schemas. The page
starts its controls from these values, so a script that omits a field gets what an
unchanged page sends. request_defaults.requests has one entry per run
endpoint (compare, compare_measured,
run_batch_suite, experiments), each with fields
and, for playlists and experiments, items (the fields of one task or
circuit). A field with server_fills: false must be sent; any other field has
a default, and where that default stands for a decision the server makes,
when_omitted says which: an omitted seed means the server
generates a master seed and records it, an empty target_simulators means
every enabled backend that is available, and an omitted thresholds means the
values in request_defaults.agreement_thresholds. The defaults are the same
for every endpoint except mode, which a playlist must send and an experiment
takes as measured when omitted. request_defaults.compile_only
says what makes /compare or /run_batch_suite compile-only:
simulate: false, at least one entry in compilers, and empty
runner_config, runner_phases and
target_simulators.
POST /plan turns a workspace into the run requests the Run button would send,
without running anything; the page plans every press of Run through it. Its body has
source (single or playlist),
circuits (playlist items: algorithm, qubits,
name, qasm_string, source; one
{qasm_string, name} for a single circuit), modes,
preprocessing (on, off or both),
compilers, name and settings, each request field
given as {value, source} with source flag, set or
replay. A field left out of settings stays out of the planned
requests, so the run route applies its default. The answer lists runs
(endpoint, kind, mode, title, the
payload to send unchanged, and each payload field's sources)
and problems, each with a code, params, a
message and, where they apply, run_index,
circuit_index and line. The codes are
playlist_empty, editor_empty, no_mode,
compile_only_needs_one_setting, playlist_too_long,
bundled_over_prep_limit, experiment_too_many_cells,
circuit_too_large, request_too_large,
invalid_request, bypass_needs_account, and, with
check_circuits: true, circuit_refused for every literal circuit
the run route's checks refuse. The body may be up to 4 MiB
(limits.max_plan_request_bytes), so the plan can report a request over the
1 MiB run limit, at 120 requests a minute per client
(limits.plan_rate_limit).
In measured mode the verdict of a pair is measured_assessment
(distinguishable is the disagreement), together with
marginal_assessment. The pair's agreement field compares the JS
and Hellinger distances with their thresholds and ignores shot noise, so a check that
reads only agreement can pass a distinguishable pair or fail a consistent
one. In statevector mode agreement is the verdict.
Each pair also records pair_verdict, the verdict every view of the page
shows. Its verdict is not_comparable,
differs_by_only (measured: significant under Benjamini–Yekutieli only, not
under Holm, and no single-bit marginal differs), differs,
inconclusive, agrees, bit_order (agrees after the
bit reversal the declared orderings imply) or unassessed, beside the flags
differs (the badge), differs_by_only, agrees and
inconclusive. divergence_report.backend_verdicts holds the
per-backend counts of the Backends table and headline_model, the backends the
Summary headline names. For a report without these fields, the three summary routes
above compute them with this server's rule, and the page uses the result.
Live statuses in runner_statuses use the same keys as the results: a backend
at one level is its id, several runs are <id>~opt<L>~run<N>,
and a compile is always <id>~opt<L>~run1, as in
compiled_circuits. progress (playlists and experiments) stays on
the job after it finishes. phase is queued (accepted, not
started), dispatching (preparing circuits, waiting for the run gate, runs and
compiles), analysing (the pairwise comparison and the report; the running
view shows ANALYSING), exporting (writing the results to the server's job
store) or done; a playlist moves between dispatching and analysing once per
circuit.
Errors have the body {"detail": ...}. A 422 means the request does not match
its schema (a wrong type, a value out of range such as a level above 3, an unknown field),
with a list of {loc, msg, type} as detail. A 400 means the request is well
formed but this server cannot run it: a circuit that does not parse, an unknown or
undeployed backend or compiler, a level a compiler does not offer, a circuit or playlist
task over the qubit limit (a playlist error names the task as tasks[i],
counted from 0). A 413 is a body over the request limit; one over the proxy's 5 MB limit
gets the same JSON shape. A 409 is a job in the wrong state or of the wrong kind (for
example an ordinary job asked for an experiment bundle). A 415 is a body sent to a JSON
route without a JSON Content-Type (application/json or a
+json type). A 403 with the detail "Requests from other sites are refused."
is a POST, PUT, PATCH or DELETE whose Origin header names another site; a
script that sends no Origin header is not affected.
Run, export, render, lookup and account routes are rate-limited. A request with a bearer token this server signed that has not expired counts against its account; any other request, including one with an expired or foreign token, counts against its client address; requests with the local lifecycle token share one count. Each route has its own count, whatever the job or run id in its path.
| Routes | Default limit | limits field |
|---|---|---|
| Runs, exports, circuit lookups (exporting a saved run counts as an export) | 10 a minute per account (per address without a sign-in); at most 60 a minute per address in total | run_rate_limit, run_rate_limit_per_address |
| Rendering a figure or table | 120 a minute per account (per address without a sign-in); at most 240 a minute per address in total | render_rate_limit, render_rate_limit_per_address |
| Saving, renaming or deleting saved circuits and runs | 60 a minute per account; at most 240 a minute per address in total | history_write_rate_limit, history_write_rate_limit_per_address |
| Full-report and bundle downloads | 30 a minute | — |
| Creating a share link | 20 a minute | — |
Signing in (POST /auth/token, failed attempts included) | 10 a minute per address | login_rate_limit |
Registering (POST /auth/register) | 5 a minute per address | register_rate_limit |
Share-link reads (POST /shared/circuits) | 30 a minute per address | — |
The per-address limits apply whatever the accounts, so several accounts behind one
address (one NAT) each get their own limit up to that total. Each response of a limited
route carries X-RateLimit-Limit, X-RateLimit-Remaining and
X-RateLimit-Reset (Unix time) for the limit with the fewest requests left; a
429 adds Retry-After in seconds, and the exclusive-run 429 sends
Retry-After: 10. An account keeps at most 1,000 saved runs and 1,000 saved
circuits (limits.max_saved_runs, limits.max_saved_circuits); a
save beyond them is refused with 409.
A script signs in with POST /auth/token, an OAuth2 password grant: the body
is form-encoded (application/x-www-form-urlencoded) with the fields
username (the account's email) and password; a JSON body is
refused with 422. For example, curl --data-urlencode username=EMAIL
--data-urlencode password=PASSWORD http://localhost:8080/auth/token. The answer
is {access_token, token_type, expires_in}; the script sends
Authorization: Bearer access_token with each later request, and
a JSON body with Content-Type: application/json (for example
curl -H 'Content-Type: application/json' -d @request.json). The token is
valid for expires_in seconds (1,800 by default), with no refresh token;
after that, authenticated routes return 401 and the script signs in again. POST /auth/logout signs the account
out everywhere: every token issued to it until then gets 401. POST
/auth/password with current_password and new_password
changes the password, ends every earlier token the same way, and answers with a new
token. Saved circuits can be listed, created (the text must parse as OpenQASM 2.0),
renamed (PATCH /history/circuits/{id}) and deleted (DELETE
/history/circuits/{id}; runs linked to it are kept). DELETE
/history/runs answers with the ids it deleted and those it did not find, and 404
when it found none.
Agreement classification
Two correct simulators can return outputs that look different, because they order
qubits differently (endianness) or differ by an unobservable global phase. Each pair
of backends is compared in the basis its two declared qubit orderings imply: directly
when both declare the same ordering, after bit reversal when one declares
lsb and the other msb. Only a match in that basis, with or
without a global phase, can make a pair agree. The pair record also gives the metric
in the other basis and, up to 7 qubits, after the best qubit permutation. A statevector pair that
matches only there is a disagreement; a measured pair is judged by the
shot-noise test, which is run in the implied basis.
A statevector pair agrees when its fidelity, computed on normalised vectors and stored
unrounded, is at least 1 − fidelity_tolerance. The default tolerances are
fidelity_tolerance = 1e-5, phase_tolerance = 1e-6 rad,
norm_tolerance = 1e-4, js_threshold = 0.01 nats and
hellinger_threshold = 0.1; GET /config reports the server's
defaults. The Agreement Thresholds chip changes them. The values sent are recorded in
the report's run configuration and in every pair record, and the pair record holds the
values its label was computed with. The phase tolerance of 1e-6 rad lies above
single-precision rounding (about 1e-8 rad for complex64), so rounding
alone does not make a complex64 backend appear to carry a global
phase.
Statevector labels
A statevector pair is labelled in the basis its two declared qubit orderings imply
(metrics.label_aligned_basis): the bit-reversed basis for an
lsb backend against an msb backend, the direct basis
otherwise. A one-qubit pair, or a pair in which a backend declares no ordering, uses
the direct basis; metrics.basis_source records which rule applied.
| Group | Label | Meaning |
|---|---|---|
| Agree | agree_directly | Same orderings; the outputs match with no transform. |
agree_up_to_global_phase | Same orderings; the outputs match once an overall, unobservable phase is removed. | |
agree_after_bit_reversal | One lsb and one msb backend; the outputs match after the bit reversal the declarations imply. transform_effect.global_phase_aligned marks a global phase offset, and metrics.label_aligned_relative_phase_rad gives it. | |
| Disagree | residual_disagreement | The outputs match in neither basis and after no qubit permutation searched. |
residual_disagreement with metrics.unaligned_basis_match | The outputs match only in the basis the declared orderings do not imply: directly although the orderings differ, or after bit reversal although they are the same. unaligned_basis_match names that basis. Either a declared ordering is wrong, or a gate defect happens to look like a bit reversal. | |
agree_after_qubit_permutation | The outputs match only after a qubit permutation that neither declared ordering implies (searched up to 7 qubits). Neither backend declares such a permutation, so the pair counts as a disagreement. | |
| Note | agree_after_normalization | At least one input statevector has a norm that differs from 1 by more than norm_tolerance, and the normalised vectors agree. metrics.normalized_agreement holds the label of the normalised pair (for example agree_directly), and the page groups the pair by that label. |
| — | not_comparable | At least one side has no usable output. metrics.reason names the cause (see the glossary). |
Measured labels
| Label | Meaning |
|---|---|
distance_within_threshold | Same declared bit orders, or keys of one classical bit (metrics.basis_source: "single_bit", where bit reversal changes nothing); the distributions are within the JS-divergence and Hellinger thresholds. The label is descriptive; the statistical test decides significance. |
agree_after_bit_reversal | One lsb and one msb backend, keys of two or more classical bits; within the thresholds after the bit reversal the declarations imply. |
agree_after_qubit_permutation | Within the thresholds only after a qubit permutation that neither declared ordering implies (searched up to 7 qubits). |
distance_exceeds_threshold | The distributions exceed the thresholds in the basis the declared bit orders imply. With metrics.unaligned_basis_match they are within the thresholds only in the other basis, as in statevector mode; without it no qubit permutation brings them within. |
not_comparable | At least one side has no usable output; metrics.reason names the cause. |
The measured labels are distance checks, and at small shot counts two samples of the
same distribution often exceed them. Whether a measured pair disagrees is decided by
its measured_assessment, which comes from the
shot-noise test:
measured_assessment | Meaning |
|---|---|
consistent_within_shot_noise | Neither test is significant after the Benjamini–Yekutieli (BY) correction, and the power to detect a total-variation gap of 0.05, computed at α/(m·c_m), is at least 0.8. This holds even when the label is distance_exceeds_threshold. The test found no difference at that power; it does not show that the distributions are equal. |
inconclusive_low_shots | Either some expected counts stay below 5 after rare outcomes are pooled, on a table larger than 2 × 2 (inconclusive_reason: low_expected_counts; a 2 × 2 table is tested exactly instead), or neither test is significant but the power, computed at α/(m·c_m), is below 0.8 (low_power). resolvable_by_more_shots records whether more shots can resolve the pair: false when no shot count the server accepts gives adequate expected counts or the target power, null when the sample does not characterise the outcome distribution (see Shot advice under Metric formulas). The pair counts as neither agreeing nor disagreeing. The Summary groups these pairs by cause and gives the shot count the power model recommends when it exceeds the shots used. |
distinguishable | Both tests are significant after the BY correction. A distinguishable pair, or a pair with a differing single-bit marginal (below), is what the Summary counts as a measured disagreement. A distinguishable pair that fails Holm's correction and has no differing marginal is listed apart, as significant under BY only. |
ambiguous | Exactly one of the two tests is significant. Treated as inconclusive. |
not_comparable | At least one side has no usable counts. |
A pair record without measured_assessment is assessed from
metrics.statistical_test.verdict. A measured pair whose observed
shot totals differ from the requested n_shots records both in
metrics.shot_total_mismatch.
Bit order per backend
Each result declares qubit_ordering: msb when qubit 0 is the
most significant bit of the statevector index or counts bitstring, lsb
when it is the least significant. The table gives what each runner declares;
tests/integration/test_runner_contract_asymmetric.py checks the
declarations against an asymmetric circuit on a running stack. Statevector and counts
pairs are compared in the basis these declarations imply. A pair that matches only in
the other basis (after bit reversal although both declare the same ordering, or
directly although they differ) is a disagreement with
unaligned_basis_match: either a declaration below is wrong or a gate defect
looks like a reversal.
| Backend | Statevector | Measured |
|---|---|---|
| Qiskit (Aer) | lsb | lsb |
| cuQuantum | lsb | lsb |
| Qrisp | msb | lsb |
| Cirq, qsim, Qulacs, QuEST, PennyLane (both), Qibo, myQLM, PyQuil, TorchQuantum, quimb | msb | msb |
| Braket, ProjectQ (disabled) | msb | msb |
Counts keys
A counts key is a bitstring over every classical bit the circuit declares, including
bits that no measure statement writes; those read 0. Classical bits get
one flat index in creg declaration order: with creg c[2]; creg
d[3];, c[0] and c[1] are bits 0 and 1 and
d[0]…d[2] are bits 2–4. In an lsb key classical
bit 0 is the rightmost character; in an msb key it is the leftmost.
A circuit without measurements, run in measured mode, gets a measurement of every
qubit for the backends that sample natively (see Circuit
preprocessing): a new register named meas (meas0,
meas1, … if that name is taken), declared after the circuit's own
registers, with qubit k read into meas[k]. Backends whose final
statevector is sampled read out the same register, so every key holds the declared
classical bits (all 0) followed by meas.
The shot-noise statistical test
In measured mode a fixed distance threshold describes a pair but cannot judge it: with few shots, two samples of the same distribution can differ noticeably. Beside the JS/Hellinger label, QRosetta therefore reports for every comparable pair:
- a Pearson chi-square test (no continuity correction) and a Williams-corrected G-test of homogeneity between the two count vectors, in the basis the two backends' declared bit orders select, with rare outcomes pooled;
- Benjamini–Yekutieli adjusted p-values across all pairs of the run (false discovery rate control under any dependence), which decide significance, with Benjamini–Hochberg, Holm and Bonferroni adjusted values recorded beside them;
- the effect size (total variation, Cramér's V) and the power to detect a total
variation of 0.05 at α/(m·c_m), on the observed degrees of freedom
(
power.df).
The verdict is consistent, distinguishable,
inconclusive_low_shots or ambiguous, from the BY-adjusted
p-values at α = 0.05 and the power; Metric formulas
gives the statistics, the corrections and the power model. Each backend samples with
its own derived seed, so no two backends draw the same shot sequence;
shared_seed records whether a pair's runner seeds were equal.
Single-bit marginals
A circuit with many outcomes often gets inconclusive_low_shots at the
default shots, because most outcomes are seen only a few times. As a second, separate
analysis, every pair whose keys have two or more bits is also compared bit by bit: for
each classical bit, the two backends' counts of that bit being 0 and 1 form a
2×2 table, tested with the same chi-square and Williams-corrected G-test. All bit
tests of all pairs form one family under Holm's correction at α = 0.05, so
the probability of any false flag in a report is at most α however many backends
really differ. A bit differs when both tests are significant. A bit with an expected
count below 5, or constant in both samples, is not tested. Equal distributions have
equal marginals, so a differing bit shows that the two distributions differ; marginals
that do not differ leave the question open.
The full-distribution tests and the marginal tests are two families, each at α. Each
pair records marginal_assessment
(marginal_distinguishable, no_marginal_difference_detected,
not_tested or not_applicable) and
metrics.marginal_test (each bit's P(1) on both sides, raw and
Holm-adjusted p-values). The marginal analysis leaves measured_assessment
unchanged, so a pair can be consistent_within_shot_noise (no
total-variation gap of 0.05 found) and still have a differing marginal. The Summary
lists such pairs in a block of their own, the Agreement tab marks them "a single-bit
marginal differs", playlist badges count them as anomalies, and crates and experiment bundles
count them by marginal_assessment.
In a simulation with 14 backends, 16 independent bits and 8,200 shots
(scripts/verify/false_flags.py), 4.5% of 8,000 runs had a false marginal
flag when every backend sampled the same distribution. With one backend off by 0.05
in P(1) on four bits, 4.6% of 2,000 runs had a flag on a pair of correct backends, and
every pair with the wrong backend was flagged. With every backend correct, the two
families together flagged at least one pair in 3.9–4.8% of runs (keys of 2 to 4 bits),
against 0.6–1.1% for the full-distribution test alone.
Metric formulas
Statevectors
Each backend's statevector a is normalised first:
â = a / ‖a‖₂. The norm ‖a‖₂ is recorded in
metrics.norms; if |‖a‖₂ − 1| > norm_tolerance for either
side, the pair is flagged unnormalized_input.
- Direct fidelity:
F = |⟨â|b̂⟩|² = |Σₖ conj(âₖ) b̂ₖ|², clamped to [0, 1] and stored unrounded. - Global phase offset:
φ = arg⟨â|b̂⟩in radians, in (−π, π]; a value with|φ| ≤ phase_toleranceis reported as 0. This is the overall phase between the two states. A relative phase between components of a superposition lowers the fidelity instead. The JSON field isdirect_relative_phase_radand the matrix isrelative_phase_matrix. - Bit-reversed fidelity:
F_rev = |⟨â|R b̂⟩|², where(R b)ₖ = b_rev(k)andrev(k)reverses the n-bit binary representation of the indexk. - Permutation fidelity: the largest
|⟨â|P_π b̂⟩|²over every permutationπof the n bit positions other than the identity and the reversal;P_πreshapes the vector to n axes of size 2 and transposes them byπ. Ties keep the lexicographically first permutation. The search runs for n ≤ 7 qubits; above that the pair recordstoo_many_qubits.
Let ε = fidelity_tolerance and let F_al be the label-aligned fidelity (F
in the direct basis, F_rev in the bit-reversed basis; recorded as
metrics.label_aligned_fidelity). Labels are assigned in this order. In the
direct basis, agree_directly if F ≥ 1 − ε and |φ| ≤
phase_tolerance, else agree_up_to_global_phase if
F ≥ 1 − ε; in the bit-reversed basis, agree_after_bit_reversal if
F_rev ≥ 1 − ε. Otherwise, residual_disagreement with
unaligned_basis_match if the fidelity in the other basis is ≥ 1 − ε;
else agree_after_qubit_permutation if the permutation fidelity is
≥ 1 − ε; else residual_disagreement. An agreeing pair with
unnormalized_input is relabelled agree_after_normalization.
The Summary quotes the fidelity under the transform the label names, with the direct
fidelity beside it.
Counts
Each backend's counts c(x) are normalised by its own observed total,
p(x) = c(x) / Σₓ c(x), over the union of the two backends' outcomes.
- Jensen–Shannon divergence:
JS(p, q) = ½ Σ p ln(p/m) + ½ Σ q ln(q/m)withm = (p + q)/2and the natural logarithm, so it is in nats and lies in [0, ln 2 ≈ 0.693]. - Hellinger distance:
H(p, q) = (1/√2) ‖√p − √q‖₂ = √(1 − Σ √(p q)), in [0, 1]. - Total variation distance:
TV(p, q) = ½ Σ |p − q|, in [0, 1]; recorded asstatistical_test.effect_size.total_variation.
A measured pair is within the thresholds when JS ≤ js_threshold and
H ≤ hellinger_threshold. In the label-aligned basis this gives
distance_within_threshold (direct) or
agree_after_bit_reversal (bit-reversed). Otherwise the label is
distance_exceeds_threshold with unaligned_basis_match when
the other basis is within the thresholds, else
agree_after_qubit_permutation when a qubit permutation is, else
distance_exceeds_threshold. The bit-reversed and permuted distances are
recorded beside the direct ones; the shot-noise test decides
whether the pair disagrees.
Shot-noise tests
The table. The two backends' counts form a 2 × K contingency table
O over the K outcomes either backend observed; outcomes with no counts on
either side are dropped. The table is built in the label-aligned basis: when the two
backends declare different bit orders (lsb against msb), the
second backend's keys are bit-reversed first; otherwise the keys are compared
directly. The basis follows the declared orderings, even when the other basis gives a
smaller distance, and is recorded as statistical_test.basis. With keys of one
classical bit, bit reversal changes nothing, and the keys are compared directly
(basis_source: "single_bit") whatever the number of qubits. With row
totals Rᵢ, column totals Cⱼ and N = Σ O, the
expected counts are Eᵢⱼ = Rᵢ Cⱼ / N.
Rare outcomes. Outcomes whose expected count is below 5 are pooled
into one bin, which holds only rare outcomes; pooled_outcomes records how
many when the bin holds two or more (a bin of one outcome is an ordinary column and
records 0). The bin is tested as a column of its own when its expected count is at
least 5, when the table meets Cochran's rule (no expected count below 1, at most 20%
below 5), or, with two or more common outcomes, when its expected count is at least 1.
Below 1 the bin is left out of the table (untested_outcomes). A common
outcome is never merged into the bin: on a table of three or four outcomes that would
hide a gap as large as the common outcome's probability (see the power model below).
Exact conditional p-values. A 2 × 2 table that still fails the
expected-count rule (one common outcome beside an undersized bin, as for a
near-deterministic circuit whose rare outcome has probability 10−4, or
exactly two observed outcomes, both rare) is outside the range of the chi-square
approximation. Both statistics then get exact conditional p-values
(test_method: "exact_conditional", chi2.method,
g_test.method): with the shots and the column totals fixed, the first
backend's count in the second column is hypergeometric, and each p-value is the
probability of a table whose statistic is at least the observed one. With equal shot
totals this ordering gives the same p-value as Fisher's exact test. With unequal
totals the two can differ: for rows of 100 and 37 shots, [[99, 1], [36,
1]], p = 1.0 here and 0.469 by Fisher's test, which orders tables by their
probability. With three or more observed outcomes, all rare, the pair is inconclusive
(low_expected_counts). When both backends returned the same single
outcome there is nothing to test: the statistics are 0, the p-values 1, and
test_method is "degenerate" ("not_tested" when
pooling leaves one column, which is also a low-count case). The Summary says how many
pairs have exact conditional p-values and how many were degenerate, and each pair's
details give its method.
- Pearson chi-square:
χ² = Σ (O − E)² / E, no continuity correction,df = K − 1. - G-test:
G = 2 Σ O ln(O / E)divided by Williams' correctionq = 1 + (N Σ 1/Rᵢ − 1)(N Σ 1/Cⱼ − 1) / (6 N (rows − 1)(K − 1)), same df (g_test.statistic; the uncorrected value isstatistic_uncorrectedand q iswilliams_q). Without the correction the G-test rejects far too often on tables with many bins of small expected counts. In a simulation with no real difference (2,000 tables of 65,536 outcomes at 106 shots,scripts/verify/v8_calibration.py), the uncorrected G-test rejected 94.7% of tables at α = 0.05, the corrected G-test 6.2% and the chi-square test 4.2%. - Cramér's V:
√(χ² / N). - Multiple comparisons, over the m tested pairs of the run, for each
test separately. Benjamini–Yekutieli (
correction: "BY"): with p-values sortedp₍₁₎ ≤ … ≤ p₍ₘ₎andc_m = Σᵢ₌₁..ₘ 1/i,p̃₍ₖ₎ = min over j ≥ k of min(1, m c_m p₍ⱼ₎ / j), recorded asp_value_by. A test is significant (significant_by) when its BY-adjusted p-value is below α = 0.05. BY controls the false discovery rate at q = α under any dependence between the tests; pairs that share a backend share its sample, so their tests are dependent. Up to a fraction q of the pairs BY flags are expected to be flagged by chance, and one unusual sample of one backend can flag several of its pairs at once. The Benjamini–Hochberg (p_value_bh), Bonferroni (min(1, m p),p_value_bonferroni) and Holm step-down (p_value_holm,significant_holm) adjusted p-values are recorded as well; Holm's controls the family-wise error rate. A distinguishable pair carriessignificant_fwer, true when both tests also pass Holm. Under BY, real differences in other pairs lower the threshold for every pair. With one backend among 14 wrong by a total variation of 0.40 (2 to 16 outcomes, 8,200 shots), at least one pair of two correct backends was flagged in 7.3–9.4% of simulated runs, and by a flag that also passes Holm in 3.2–4.3%; with every backend correct, 0.6–1.1% of runs had any flag (scripts/verify/false_flags.py, 2,000 to 4,000 runs per scenario). The Summary marks a distinguishable pair that fails Holm as significant under BY only. A p-value that underflows to 0 is shown as<1e-300, and values below 1e-3 in scientific notation. - Verdict:
inconclusive_low_shots(low_expected_counts) if no pooling gives adequate expected counts and the table is larger than 2 × 2; elsedistinguishableif both tests are significant,ambiguousif exactly one is, and, if neither is,consistentwhen the power at the observed shots, computed at α/(m·c_m), is at least 0.8 andinconclusive_low_shots(low_power) otherwise. - Shot advice:
resolvable_by_more_shots, besideinconclusive_reason, says whether more shots can turn an inconclusive pair into a verdict. It is null, and no shot count is recommended, when the sample does not characterise the outcome distribution:unseen_mass_good_turing, the share of shots in outcomes seen exactly once (the Good–Turing estimate of the probability of outcomes not yet seen), exceeds 0.5 for either backend (support_characterised: false). This happens when a circuit spreads its outcomes over far more basis states than the shots cover, for example a dense 22-qubit state at 8,200 shots; measuring only the qubits of interest gives the test a distribution it can resolve. When the unseen mass is between δ/2 and 0.5, the recommendation is a lower bound (recommendation_is_lower_bound), because more shots reveal new outcomes and can raise it. It is also a lower bound when the recommendation comes from pooling rare outcomes and some outcomes were seen once: outcomes seen once in n shots stop being pooled at 10n shots per backend, so the minimum often lands there (82,000 after a run of 8,200 shots, recommended as 91,000), and outcomes not yet seen do not enter the calculation. - Power model: the effect size is Cohen's
w = δtested, the smallest w that any pair of distributions at total variation δ = 0.05 can have on the table the test sees (w ≥ TV). Pooling two or more rare outcomes into one bin can hide up to min(P, Q) of the total variation, where P and Q are the two backends' probabilities in the pooled bin, soδtested = δ − min(P, Q); leaving a bin out can hide up to max(P, Q), soδtested = δ − max(P, Q)(recorded aspower.delta_tv_testedandpower.pooled_probability). The bin holds only rare outcomes, so P and Q are small whenever the table has common outcomes. When δtested ≤ 0, a gap of δ could lie entirely inside the pooled bin, and the power is α′. The verdict rule above still applies: such a pair isdistinguishablewhen both tests are significant,ambiguouswhen one is, andinconclusive_low_shots(low_power) when neither is. Otherwise the chi-square statistic follows a noncentral χ² withdf = K − 1and noncentralityλ = 4·ni·nj/(ni + nj) · w², where ni and nj are the two backends' shot totals. With equal totals this isN w²(N = ni + nj); with unequal totals the smaller sample limits it, so 8,200 shots against 50 have the power of about 200 shots split evenly. The single-bit marginal tests use the same noncentrality.power_to_detect_delta_at_observed_shots = 1 − F(χ²₁₋α′,df ; df, λ)with α′ = α/(m·c_m), the level BY applies to a single discovery among the m tested pairs of the run (recorded aspower.alpha_used,power.m_pairsandpower.c_m). It is the smallest level BY applies to any pair, so the power figure does not overstate the chance that the corrected test flags a gap of size δ. It is the power of the chi-square test alone, while the verdict needs both tests to be significant. Pairs tested with exact conditional p-values use the same model, because at the alternatives it describes the counts are large and the asymptotic test applies. In simulation (P(rare) = p₀ against p₀ + δ, 14 backends of which one differs, 2,002 differing pairs each, m = 91), both tests at α′ detected δ = 0.05 at 4,444 shots per backend in 100% of pairs for p₀ ≤ 0.1 and in 79.2% for p₀ = 0.475, against a model power of 0.800; BY over the run, in which the other 12 pairs of that backend also differ, flagged 93.1%. The shots needed therefore grow with the number of outcomes (df) and with the number of backends (m), and the report computes the power of each pair.shots_per_backend_for_target_poweris ⌈N*/2⌉, where N* is the total that gives power 0.8 at α/(m·c_m); when outcomes were pooled, it is the smallest count at which the observed proportions, scaled to that count, pool into a table with that power.recommended_shots_per_backendis that minimum times 1.1 (recommendation_margin), rounded up to two significant figures and capped at the server's shot maximum (shots_maxinGET /configlimits), or at the minimum itself when the minimum is larger.resolvable_by_more_shotsis true for alow_powerpair when the recommendation is at most the shot maximum, and false when it is larger or when no count up to the maximum reaches the target power with pooled outcomes (no recommendation is then given). A rerun estimates the power again from its own table, whose bins change with the shot count, so a rerun at exactly the minimum lands near 0.8. In simulation (5-qubit product state, 14 backends, 8 runs advised from 1,000 shots), 67 of 728 pairs stayed inconclusive at the minimum (about 10,000 shots) and none at the recommended 11,000.recommended_exceeds_actualsays whether the recommendation is more than the shots either backend used; the Summary recommends more shots only then. Because df counts the observed outcomes, the recommendation can be too small when the true support is larger.
Reproducibility
- Seeds. Every measured run has a master seed: the one entered in
the Seed chip, or one the API generates; the report records it at
seed. Each backend receivesrunner_seed= the first 4 bytes ofsha256("<master seed>:<runner key>"), read big-endian, with the top bit cleared; the runner key includes any~opt<L>~run<N>suffix. The report records the formula atseed_derivation.seed_honouredis false for a backend whose sampler ignores the seed (Braket, which is disabled). In a playlist every circuit uses the same master seed, so each backend receives the samerunner_seedfor every circuit. - SDK versions. Each backend reports the versions of the SDK packages it executed with, and the report keeps them in its provenance.
- The image each backend ran from. Every runner and
compiler result carries
image_identity. The runner's serving process reads it at startup from a file in the image and adds it to each result after the run returns. It holds:- the
sourcethe image recorded at build:releasefor an image built by the release pipeline,built_locallyfor a local build, "not recorded" for an image without an identity file or with an unrecognised source; then the release and the commit; - what the container runtime shows the process: Apptainer's image path and sha256, or a podman container's image and id (the latter only when privileged);
- whether the host CPU reports the
hypervisorflag; emulation: the machine the image's Python interpreter is built for (read from its ELF header), the host's OS and machine asqrosetta startpassed them, andemulated, true when the two machines differ and null when the stack was started withoutqrosetta start.
build_filesholds the sha256 of the Dockerfile and therequirements.lockthe image copied.runner_imageis the image the API created a Kubernetes Job with, else the image the runtime showed the runner;runner_image_basissays which. Each result that ran gets aspecimen, and the report aspecimenssummary:all_published(one release),all_built_locally,mixed,unknownornone_ran, with each backend's detail and the image commits. Differing commits mean the measurement code may differ between backends. An RO-Crate includes a runner'srequirements.lockfrom the server's source tree only when its sha256 equals the hash every result of that runner reports, and otherwise says why the file is absent. The crate root statesspecimens,timing_caveatsandrun_completeness(complete,partial,failed,not_recordedfor a server report without a completeness record, ornot_checkedfor a report the server did not produce, such as an export from the Browser copy after the server's copy expired). - the
- Run configuration. Reports record the agreement thresholds sent,
the timeout and its scope, the optimization levels,
apply_preprocessing, the API-side preprocessing, the dispatched circuits,started_atandfinished_at, and the commit the API image was built from (git_sha; a "-dirty" suffix marks uncommitted changes). The divergence report recordsanalysis_version, the version of the classification and test rules. Runner image digests from the registry are recorded only when the deployment setsQROSETTA_IMAGE_DIGESTS; on a local server the report says "not recorded". Each result carriesimage_git_sha, the commit its runner or compiler image was built from, andrunner_code_sha256(compiler_code_sha256for compilers): the sha256 of the bytes of the image'smain.pyfollowed by the bytes of every.pyfile of the installedqrosetta_commonspackage, in order of relative path. It identifies the adapter that produced the result. To recompute it from a checkout, hash the same concatenation;main.pyalone gives a different value. - Statevector hashes. A report stored or exported without
statevectors (run history, RO-Crates with
include_statevectorsfalse, experiment bundles) keepsstatevector_sha256andstatevector_length(the number of amplitudes) for every backend. The hash covers the bytes the runner sent: little-endiancomplex128amplitudes for every backend. A backend that computes incomplex64(itsprecisionfield says so) has its amplitudes widened tocomplex128before encoding, so the hash covers the widened values. A report that carriesstatevector_lenhas it written asstatevector_lengthin exports and bundles. The hash is not stable across replays for every backend: Cirq, for example, can differ in the last bits of some amplitudes between two runs of the same circuit. Compare replayed statevectors by fidelity. - RO-Crate export. A run exports as an RO-Crate that conforms to the
Process Run Crate profile. It holds the inputs, the dispatched and executed
circuits, the per-backend results (counts, or statevector hashes unless
statevectors are included), the agreement evidence and the provenance.
README.txtat the crate's root, written fromro-crate-metadata.json, describes the crate for a reader without this manual: the report source, completeness, which images ran (specimens), the timing caveats, where each kind of file is, the software version and commit, and a command that checks every file's hash. Every file inro-crate-metadata.jsonhas itssha256andcontentSize(bytes). The agreement thresholds and, in measured mode, the test's α, target power and total-variation gap are PropertyValues of#agreement-analysis. Links to the source code point at the commit the API was built from, in the repository the server is configured with (QROSETTA_REPOSITORY_URL). They resolve only when that commit has been published there; a commit marked "-dirty" or unknown gets a link to the repository root.
Replaying a run
- Take the circuit from the crate's
circuit.qasm(circuits/for a playlist) or from the experiment bundle'sinputs/*.qasm, which hold the text as submitted; for a bundle, check each file against the manifest'sqasm_sha256. Submit it as literal QASM; a regenerated algorithm can differ from the original. - Send the values the run used, which can differ from those requested: the seed from
results.seed(for an experiment,effective_seeds_per_axis); the thresholds from the report'sagreement_thresholds, sent explicitly, because defaults can change between versions; an explicit runner list taken fromraw_results[].simulator, because an empty list means every runner enabled at the time; andn_shots,apply_preprocessing,optimization_level,runner_config,runner_phases,timing_repeats,timeout_secondsand, when the run used compile-only services,compilersfrom the report'scompilers_requested. The experiment manifest'seffective_configrecords algorithms by name; replay them from theinputs/*.qasmfiles as literal QASM, as in step 1. - Compare in this order:
runner_seedper backend; the dispatched and transpiled circuits,compile_input.qasmandcompiled_circuits/; the counts, byte for byte; the statevectors by fidelity (this needs the statevectors, so export withinclude_statevectorsor useGET /jobs/{job_id}/report; hashes alone confirm only a bit-identical replay); then the verdicts. - If
git_sha,analysis_versionor a backend'srunner_code_sha256differs between the two reports, the verdicts can differ even when the counts are identical, and a changed adapter can change that backend's output. Derive the verdicts again on the new version before comparing labels.
Self-test
The self-test checks an installation against known answers. Each backend's result is
compared with an answer computed without any backend, so the test fails even when
every backend returns the same wrong state. qrosetta selftest runs it
(see Command-line tool); a script can run it through the API in two
steps.
- Read
GET /selftest. Itsjobshold two request bodies forPOST /run_batch_suite, a statevector playlist and a measured playlist, with every field set: optimization level 0, preprocessing on, one timed run, 8,200 shots, master seed 20261027 and explicit agreement thresholds. Addtarget_simulatorsand change nothing else. The plan does not follow the server's request defaults. - Submit both, wait for each job to finish, and read
GET /jobs/{job_id}/selftest-resultfor each (120 requests a minute). It evaluates the server's own copy of the report (report_sourceserver_job). It answers 404 for an unknown or expired job, and 409 for a job that has not finished, failed before any runner ran, is an experiment, or is not a playlist of the plan.
The statevector playlist has three 3-qubit circuits: x q[0] with two idle
qubits; ry(0.3), ry(0.7) and ry(1.1) followed by
cx q[0],q[1], cx q[1],q[2] and rz(0.5) q[2], whose
eight amplitudes all differ in magnitude; and GHZ-3. The expected states come from a
small numpy simulator that builds each gate from its qelib1.inc matrix
(services/selftest/reference.py). They are committed in
circuits/selftest/expected.json, whose sha256 the plan reports as
expected_sha256.
A backend passes a statevector circuit when its result is ok, it declares
lsb or msb (equal to the runner registry's value where the
registry records one), it returns 2n finite amplitudes with a norm within
10-4 of 1, and its fidelity with the expected state, read in its declared
order with both vectors normalised, is at least 1 − 10-5. For the second
circuit, a wrong state reaches at most these fidelities: 0.834 under any qubit
permutation, 0.559 under bit reversal, 0.874 with either cx reversed, 0.795
with the rz sign flipped and 0.984 with one gate deleted. Rounding the
expected state to complex64 changes its fidelity by less than
10-7. GHZ-3 is unchanged by any qubit permutation, so it checks support and
amplitudes only.
The measured playlist runs five classical-bit probes, each of which puts every shot on
one counts key, and GHZ-3. A probe passes only when the counts are exactly
{key: 8200} for the backend's declared order. The probes test the
counts-key rules of Bit order per backend through the API's own
circuit preparation. GHZ-3 passes with only the all-0 and all-1 keys, 8,200 shots in
total, and p(all-0) within 6σ of 0.5 (± 0.0331).
Each result is also checked for the environment it records; the table gives each
check's outcomes, and some checks give SKIP when the runner does not record the field.
The job's circuits and recorded settings must equal the plan's (plan
check), and every backend in target_simulators must return a result for
every circuit.
| Check | PASS | WARN | FAIL | SKIP |
|---|---|---|---|---|
cpu_quota_cores | 1.0 core | On a local stack started with --no-cpu-quota (the CLI turns the FAIL into a WARN) | null or another value | — |
thread_env | Every thread variable is 1 | — | Any other value, or not recorded | — |
memory_method | vmhwm | A sampling fallback, or not recorded | — | — |
memory_limit_mib | 1,024 MiB | null or another value | — | — |
precision, qubit_ordering | As the runner registry records it for the job's mode | — | Any other value | The registry records null, as for cuQuantum's precision |
host_virtualisation | No hypervisor flag | A hypervisor flag: timings are not comparable with bare-metal runs | — | Not recorded |
host_emulation | No emulation recorded | — | Emulation recorded, or a CPU model naming Rosetta (VirtualApple) | Not recorded, as on a stack not started with qrosetta start |
provenance | Image source release, pulled or loaded | built_locally or pulled-other | Any other source, including "not recorded", or a commit ending in -dirty | The result carries no image identity |
status is FAIL when any row fails, else WARN when any row warns, else PASS;
SKIP rows do not count. backends gives each backend's worst row. A stack
built from a checkout therefore gets WARN from the API because of its
provenance rows. The circuits use only x, h, ry, rz,
cx and measure; the plan's not_tested lists what a
PASS says nothing about: other gates, user-defined gates, mid-circuit measurement,
circuits above 3 qubits, optimization levels above 0 and preprocessing off.
What qrosetta selftest adds
Before the jobs, the command reads one fresh probe round of GET /runners
and GET /compilers with the local lifecycle token, a random token that
qrosetta start writes to
$XDG_RUNTIME_DIR/qrosetta/lifecycle.token and compose mounts into the
API container (the CLI also sends it with host-load notices). It then checks every
image under test (--no-images skips this):
answers: FAIL when the image is unavailable or did not answer within 5 s; SKIP when a run is using it or an exclusive run holds the server.registry(runners): FAIL when the registry declares a precision other thancomplex64/complex128or an order other thanlsb/msb; a null value reads "set at run time".commit: FAIL when the image records no commit or one ending in-dirty; WARN when it differs from the API image's commit (a mixed stack); SKIP when the probe row carries no commit.
By default the command tests every runner that answers on a local stack, and the
server's default selection on a remote one; --backends KEYS names them. The
output gives an Images line with the counts of passed, warned and failed
images, a Statevector and a Measured line with each job's
status, then one row per FAIL and WARN. Tested and Not tested
lines follow: the plan's two sentences, and then each enabled backend left out with
its reason, "not started in this stack (profile P)" for a backend whose
service the local stack does not run. Each job is saved with its report, summary,
crate and selftest-result.json; selftest.json in the results
directory holds the combined result. A job the API rates WARN keeps WARN on its
line, and the last line then reads PASS (N warnings) before the results
directory. The command exits 9
when any check fails and 0 otherwise, warnings included.
Timing and memory methodology
Recorded conditions
- Timing caveats. Every result, and the report as
a whole, records the conditions that limit how far its timings compare across
backends (
timing_caveats). The rules are versioned bytiming_caveats_version, separately fromanalysis_version, because they change no agreement label. Each entry has a code, a sentence and the fields it was read from:shared_dispatch(not exclusive, other runs in the same phase),overlapping_runs,server_overlapping_runs,host_load(a host-load notice was open during the run; next item),throttledandcompilation_throttled(the CPU quota held the runner for at least 1% of the window),unstable_repeats(timed runs spread by more than 1.3×),mixed_cores,outside_process(over the simulation window the container's CPU time exceeds the simulating process's by at least 5 ms and by at least 10% of the container's),single_timed_run,no_cpu_quota,virtualised_host,emulated_cpu,emulated_image(the image's architecture differs from the host's),non_x86_64, and across backendscross_backend_core_speeds,cross_backend_cpu_quotaandcross_backend_image_commits. The page's "throttled", "outside process", "unstable" and "mixed cores" tags and its "Caveats" list show these records. For a report without these records, the page asks the server (POST /timing-caveats). - Host load from the
qrosettacommand.qrosetta stop,remove,build,pull,images saveandimages load, andqrosetta startwhen it starts or recreates services beside a running stack, open a host-load notice with the API on a local stack, authenticated by the local lifecycle token and kept alive by a heartbeat every 10 s. An open notice holds the run gate like a run, so an exclusive run waits for it. The notice ends with the command, or 30 s after its last heartbeat. Every local result records the notices open while it was in flight (server_overlapping_host_load), and the "host load" tag marks it. A notice begun while an exclusive run holds the gate does not wait; the run records the overlap. Astoporremovenotice names its services: a run that then loses its connection to one of them recordsstopped_by_user: trueand an error starting "STOPPED BY USER". - Runs that end without a result. When a runner's
isolated process ends without a result, the error gives its exit code or signal
(
process_exit_code,process_exit_signal). The kernel sends SIGKILL both when a container runs out of memory and on a forced stop, so the signal alone does not identify the cause, and the server records none. When the API loses its connection to a runner or compiler, the error lists the possible causes (the container was stopped, the process crashed or ran out of memory, a time limit near the deadline, the network) without choosing one, unless a stop notice covers the service. In Kubernetes mode the error names the cause Kubernetes recorded for the pod (OOMKilled, DeadlineExceeded) when there is one.
Timing windows
- Warm-up and timed runs. Each backend runs the circuit once and
discards the result, then runs it
timing_repeatstimes (default 1). With one timed run every timing is a single sample (timing_samples = 1) and run-to-run variation is not measured. With more,compilation_time_secandsimulation_time_secare medians (timing_statistic: "median"), recorded with the per-run samples, mean and standard deviation.execution_time_secis the median compilation time plus the median simulation time; its IQR and standard deviation are those of the per-run totals. The statevector or counts and the memory fields come from the first timed run. In measured mode every timed run uses the same runner seed, so a backend that honours the seed draws the same shots each time.cpu_time_secandprocess_peak_rss_mbcover every run and grow with the number of repeats. - The two windows.
compilation_time_secis wall clock from t0 to t1: parsing, rebasing, optimisation passes, and building the executable object where the SDK lets the adapter build it separately (the PennyLane tape and device preprocessing, the myQLM and Qibo circuit objects).simulation_time_secis wall clock from t2 to t3: executing the circuit and returning the statevector or drawing the shots. Building a counts histogram from drawn shots, re-keying counts, and converting an SDK's result object into the reported array fall outside both windows, except where the SDK draws and tallies the shots in one call: Qibo, quimb, myQLM, Qrisp and Qiskit Aer (the qiskit and cuQuantum runners). Their tally is insidesimulation_time_sec(next list). - Conversion outside the simulation call. For Qulacs, QuEST, qsim,
Qiskit and cuQuantum the SDK's own entry point (pytket's
process_circuits, qsimcirq'ssimulateandrun, Aer'srun) converts the circuit inside the call. Their adapters split that call at the native routine: the conversion (tk_to_qulacs,tk_to_quest,translate_cirq_to_qsim, Aer'sassemble_circuitsand run configuration) is incompilation_time_sec, and the timed run applies the converted circuit with the same routine, options and seeds as the SDK call. Each adapter refuses to load with another version of the SDK whose call it reproduces. The disabled Braket and ProjectQ runners convert inside the call. - Sampling from a statevector. In measured mode, a backend with
sampling_method: "sv_sample"reads the state from the SDK and draws the shots insidesimulation_time_sec, because the shots need the state. - Gate fusion. Qiskit Aer (qiskit and cuQuantum) fuses neighbouring
gates above its qubit threshold at every optimization level, recorded per run as
gate_fusion; qsim fuses into gates on up to two qubits. Both happen inside the simulation and are listed inpreprocessing_applied. At levels 1 and 2 the Qibo adapter fuses gates in compilation, except in a circuit that calls a gate its text defines, which runs unfused with a note saying so. Reported gate counts are those of the circuit before fusion.
Backend-specific work inside the simulation window
- cuQuantum.
simulation_time_seccovers Aer's native execution of the assembled circuit: GPU memory allocation, the cuStateVec kernels and the copy of the result to the host. CUDA context initialisation happens in the warm-up run and shows up only incpu_time_sec. - Qiskit Aer (qiskit and cuQuantum). In measured mode Aer draws the
shots and counts them in its C++ simulation, so the counts are inside
simulation_time_sec. Re-keying them over the circuit's classical bits follows the window. - myQLM. myQLM returns a statevector as one Python object per
non-zero amplitude (
SAMPLE nbshots=0), and building that result is inside the simulation window. Its time and memory grow with the number of non-zero amplitudes: a GHZ state is fast, a dense state slow. In measured mode PyLinalg draws the shots and aggregates them into frequencies per basis state insidesubmit(), so that tally is insidesimulation_time_sec; the integer counts are rebuilt from the frequencies after the window. The adapter'spreprocessing_appliednote says so. - Qibo. In measured mode
CircuitResult.frequencies()draws the shots and tallies them in one call, insidesimulation_time_sec, as the adapter'spreprocessing_appliednote says. - quimb.
simulation_time_secincludes the search for a contraction path (cotengra'sauto-hqoptimiser, repeated each run with its caches cleared) as well as the contraction. The search is randomised, so quimb's times vary between timed runs more than a statevector backend's. It runs in the simulating process, with cotengra's worker pool turned off. In measured modesimulate_counts()contracts the network, draws the shots and tallies them in one call, so the tally is insidesimulation_time_sec, as the adapter'spreprocessing_appliednote says. - Qrisp. Qrisp samples the shots and tallies them in one call
(
QuantumCircuit.run()), so the tally is insidesimulation_time_sec. The adapter also wraps Qrisp'smulti_measureso that it returns its outcomes in ascending order; without it, a seeded draw maps to different outcomes in different processes.run()samples from the ordered list, so the ordering is inside the window, and the adapter'spreprocessing_appliednote says so. Withhon every qubit and 8,200 shots on one CPU, the ordering adds little up to 16 qubits and about 0.4 s of the 1.1 srun()takes at 24 qubits.
Comparing timings
- What wall clock includes. Timings are wall clock, so they include
time the process was not running: waits imposed by the CPU quota
(
simulation_throttled_sec,compilation_throttled_sec), preemption by other processes (simulation_involuntary_switches_samples), and contention with the other backends of the same comparison, which run at the same time unless runner phases or the Sequential ordering stage them. Each result recordsconcurrent_runs(the runs dispatched in its phase or in a phase in flight beside it, such as the sampled and native groups of a measured run),dispatch_phase,dispatch_wave(its phase's start, end and run count) andoverlapping_runs(other runs of the same job that were in their runner process at the same time, fromprocess_started_atandprocess_finished_at). Concurrent runs share cores, hyperthreads and memory bandwidth: on a 20-qubit measured QFT, concurrent runs took 2.3–3.3× longer than with the Sequential ordering, and the order of backends changed. On a host with hyperthreads, a run whose sibling thread is busy can be 1.5–2× slower with every other check passing. - Exclusive runs. The "Exclusive timing run" box (API field
exclusive) runs the backends one at a time, and only while no other run is in flight on the server. Each result recordsexclusiveand the wait (exclusive_wait_sec). Without it, every local result recordsserver_overlapping_runs, the runs of other jobs that were in flight (including waiting in a runner's queue) at the same time. - Protocol for a performance comparison. Run the comparison as at
least three separate exclusive jobs, spaced apart, each with
timing_repeatsof at least 5. Report the median of the job medians and the range between jobs, treat backends within about 3% of each other as tied, and report quimb with its full range. Check thatsimulation_throttled_secis zero and thatcpu_max_mhznames the same kind of core for every backend. - Rank marks. The ≈ mark next to a rank
(
overlaps_next) means this backend's slowest timed run took at least as long as the next backend's fastest in the same job. It reflects the spread within one job only, so ranks without it can still swap between jobs. The "unstable" tag marks a run whose slowest timed run took more than 1.3× its fastest. - Different gate counts for the same circuit. Each backend executes the circuit after its own rebase: at 18 qubits one circuit ran as 318, 750 or 1,158 gates depending on the backend. Simulation times compare those workloads; the Gate count column shows each one.
- Benchmark circuits and structure. The
qftpreset applies the QFT (q[0] the most significant bit of the input and output index) to |0…0⟩, so every controlled phase has its control in |0⟩ and the output is a uniform product state. Backends that exploit structure (tensor networks such as quimb, Qrisp's factorised state and gate grouping, sparse or decision-diagram methods) run it much faster than its width suggests. For scaling studies, include circuits whose state is entangled and dense, such asrandom. - Threads. Every runner starts with
OMP_NUM_THREADS,MKL_NUM_THREADS,OPENBLAS_NUM_THREADS,NUMEXPR_NUM_THREADSandNUMBA_NUM_THREADSset to 1; the values each run saw are inthread_env.RUNNER_MAX_CONCURRENT(default 1) sets how many runs one runner executes at once; further runs queue. - CPU time.
simulation_cpu_time_secis process CPU time (all threads) over t2..t3.cpu_time_seccovers the whole isolated runner process: interpreter start, SDK import, warm-up and every timed run.
Memory
- Fields. Memory is read from the kernel high-water mark
(
VmHWM).memory_usage_mb(Sim-window RSS delta) is the peak RSS minus the baseline RSS over the simulation window (pre-execute setup plus t2..t3; the high-water mark is reset when the window opens).process_peak_mb(Sim-window peak RSS) is the absolute peak over the same window.process_peak_rss_mbis the peak RSS of the simulating process over its whole life; Resources are ranked by it. Every field ending in_mbis in MiB (220 bytes). - Method.
memory_methodandprocess_peak_rss_methodrecord how each value was read. Where VmHWM is unavailable they readsampled_10ms(RSS polled every 10 ms, which can miss short peaks) andgetrusage(ru_maxrss), and the page shows a badge. - Memory the warm-up left behind. The warm-up allocates and frees the
memory the timed run needs, and the allocator usually keeps it. The timed run can
reuse it without raising the high-water mark, so
memory_usage_mbcan read near 0 for a statevector of a few MiB (seen for PennyLane at 16 qubits and Qibo at 18). It is the memory the simulation window added. PennyLane-Lightning allocates its statevector when the device is created, during compilation, so its window holds only the copy read out at the end. - Host memory only. Every memory field is host RSS. GPU device memory
is not measured, so GPU runs are not ranked by memory: they are listed under
unrankedwith reasongpu_memory_not_measured, and the Performance tab says so. - RSS and the container limit. RSS counts the shared libraries a
process has mapped, such as the CUDA runtime, so
process_peak_rss_mbcan exceed the container's limit (cpu_environment.memory_limit_mib) without the process being out of memory. - What dominates memory. For small circuits,
process_peak_rss_mbis mostly the Python interpreter and the SDK's import footprint. Compare it withtheoretical_statevector_mb, the size of a dense statevector at the backend's precision: 2N × 16 bytes forcomplex128, 2N × 8 bytes forcomplex64(theoretical_statevector_basissays which). quimb holds no dense statevector; its value is computed the same way from the precision it reports. Differences between backends at small N come from their libraries.
Gate counts and rankings
- Gate count and depth come from the circuit each backend executed:
by default the top-level gate statements of its
transpiled_qasm(a statement on whole registers, such ash q;, counts once per index), with depth by greedy layering. The PennyLane runners count the operations of the tape the device executes, because theirtranspiled_qasmdecomposes operations such asQubitUnitaryinto gates that were not executed as such (aQubitUnitaryon three or more wires is written as anopaquegate with its matrix in comments).gate_metrics_basissays which. - Rankings include only successful runs. Failed runs, and GPU runs in
the memory ranking, are listed under
unrankedwith a reason after the ranked rows. In the Performance tables a GPU run carries a GPU tag under its name, and the playlist summary tags the device of the backend in its "Fastest (total time)" and "Lowest process peak RSS" columns.
Resources, queueing and timeouts
- CPU and memory quota. Each runner is limited to 1 CPU by a cgroup
quota, and its math libraries run one thread. Each runner container (local mode) and
runner Job (Kubernetes mode) has a 1 GiB memory limit; each result records the limit
that applied as
cpu_environment.memory_limit_mib. A process that uses more than one core (an SDK thread pool the thread variables do not control) is throttled: the kernel stops it until the next 100 ms period, and that wait falls inside the timed window. Every result records the throttled time assimulation_throttled_secandcompilation_throttled_sec, read from the cgroup'scpu.statjust outside each window (null when the file is unreadable). The Performance table tags runs held for at least 1% of the window "throttled". The cuQuantum container has the same quota: its kernels run on the GPU, but its host-side work (circuit conversion, kernel launches, synchronisation, the copy to the host and sampling) is throttled like any other runner's. - CPU context. Each result carries
cpu_environment: the host CPU model, the quota in cores (cpu_quota_cores, null for none), the process's CPU affinity, the container's memory limit, andcpu_max_mhzfor the logical CPUs the process was on at the start and end of each simulation window (simulation_cpus). On a host with cores of different speeds, such as Intel P- and E-cores, the same run takes different times depending on the core the operating system chose;cpu_max_mhzshows which kind it was. An operator can restrict every runner process to chosen CPUs withQROSETTA_CPU_AFFINITY(for example0-15), recorded ascpu_environment.cpu_affinity_setting.simulation_involuntary_switches_samplescounts how often the process was preempted in each simulation window.simulation_cgroup_cpu_time_secis the CPU time of every process in the runner's container over the simulation window; when it exceedssimulation_cpu_time_sec, part of the work ran outside the simulating process (for example in a worker pool), and the CPU time and memory fields leave that work out. The Performance table tags such runs "outside process". - One run at a time per runner. A runner executes one run at a time.
When several jobs, yours or other users', target the same runner, later runs wait.
The wait is recorded as
queue_wait_secand is not part of any timing. Waits of 0.5 s or more appear in the per-backend details and as a "queued" tag in the Performance tables; shorter values are dispatch overhead. In local mode a run waits at mostRUNNER_QUEUE_MAX_WAIT_SEC(default 1,800 s, recorded in the report asqueue_max_wait_sec). A run still queued at the cap is not started: it ends with statustimeout,timeout_kind: "queue"andnever_started: true, and the Summary says it never started. - Kubernetes job slots. On a Kubernetes deployment at most
k8s_job_slotsrunner Jobs exist at a time, and a run may wait for a free slot. The wait is recorded asqueue_wait_sec, under the same cap. A run that gets no slot, or whose pod the cluster does not admit or place, before its timeout ends with statustimeoutandnever_started: true. A pod still pulling its image or creating its container at the timeout is atimeoutwhose message says so (pod_waiting_reason); a pod whose image cannot be pulled isoffline. Each result'srunner_imagenames the image by digest (registry/name@sha256:<digest>) when the deployment records digests. - Timeout scope. The timeout in the Execution chip (the server's
allowed range is shown under the field) applies to each backend separately. It covers
starting the isolated runner process, importing the SDK, the warm-up run and the
timed runs. In local mode it starts when the run leaves the runner's queue, so a wait
for a busy runner does not count against it. In Kubernetes mode it starts at Job
creation and also covers pod scheduling, image pull and the result upload. The report
records the scope that applied. A backend that exceeds the timeout ends with status
timeoutandtimeout_kind: "run"; its process and every process it started (such as a compiler binary) are killed. The page sends the field's value with every run; an API call that omitstimeout_secondsgets 60 s, the default the field starts at. - Timing samples. With the default of one timed run, a difference between two backends smaller than either one's run-to-run variation cannot be read from one report. Set Timing repeats above 1 for a median and a standard deviation per backend, or use multi-run mode to compare separate runs.
Compile-only services
A compile-only service turns the run's circuit into another circuit and records the
text. Its output is never simulated, has no timings, and is not part of the agreement
comparison: compiled circuits are kept in the report's compiled_circuits,
apart from raw_results. Tick levels in the Compile-only
services chip's popover, or send compilers (compiler id → list of
distinct levels) with /compare, /compare_measured,
/run_batch_suite or POST /experiments. A request holds at most
one compile per level of every enabled compiler for each circuit:
17 with the eight compilers, 14 on a stack from the published images, which have no
BQSKit. GET /compilers lists them with the versions each running image
reports (versions: pip SDK versions, components built from source,
build-file sha256 and image commit; null in Kubernetes mode, where no compiler runs
between jobs), and the popover shows them under each compiler.
How compiles run
- Input. Every compiler receives the same circuit, recorded as
compile_input: the submitted circuit as the API prepares it for statevector runners (terminal measurements removed, then the run's API preprocessing). Compiled circuits therefore carry no measurements, also in measured mode. In statevector mode the compile input is the dispatched statevector circuit. A measured-mode circuit with mid-circuit measurement,resetor classical control is not compiled; each requested compile is recorded withdispatch_statusskippedand the reason. - Order and sharing. Compilers run after the run's simulators have
finished, through the same queue and timeout as runners, so a compile never overlaps
a timed run of its own job. They always run as a shared dispatch: an exclusive run of
another client waits for them, and other jobs count a running compile in
server_overlapping_runs. Each compiler service runs two compiles at a time, each single-threaded; BQSKit runs one, because its runtime binds fixed ports. A further compile waits in that service's queue, so a busy service can delay another client's compile. The live status grid lists each compile while it runs. - Completion. The report is complete only when every compile has
finished or timed out, so a slow compile (BQSKit level 3 beyond a few qubits) delays
it. A compile that fails or times out is recorded with its status and reason and does
not affect the simulator results. In a compile-only run (
simulate: false), a circuit whose every compile failed, was refused or was skipped is reported like a run whose every runner failed: the job isfailedwith "all N compiles failed" (in a playlist, when this holds for every circuit) and keeps its report. - Refusals. An adapter refuses an input it cannot compile correctly,
and rejects an output that fails its check. Such a compile has
refusal(the reason) andrefusal_kind(inputoroutput_check), also as columns oftables/compiled_circuits.csvin a crate. The CSV'sreasoncolumn gives the reason for every compile without output: the refusal, else the recorded error (the skip reason, "TIMEOUT (N s)", or the compiler's error text, which the crate'sprovenance.jsonalso holds). The Summary lists every compile with its gate counts or reason, those without output first; a share link shows refusal reasons and no other error text.
Records
The report records the request as compilers_requested. Each record's key is
<compiler>~opt<level>~run1 and holds the output text
(transpiled_qasm), the passes that produced it
(passes_applied), gate metrics counted from that text, the pip SDK versions
(sdk_versions), the programs the image built from source
(native_components: staq, Quartz and Synthetiq, with the source archive's
URL and sha256, compiler flags or patches, and Quartz's ECC set hash), the sha256 of the
image's build files (build_files), the image's
runtime_environment and image_git_sha, and
compiler_code_sha256. The Circuits tab shows the compiler input and each
output. Crates hold them as compile_input.qasm and
compiled_circuits/<key>.qasm (in a playlist,
compile_inputs/<task>.qasm and
compiled_circuits/<task>/<key>.qasm); each compile is a
CreateAction from the compile input to its output, and each native component a
SoftwareApplication. For a compiler that produced output, its build files are included
under compilers/<name>/ when the server's copy has the sha256 the
image reported: the Dockerfile and requirements.lock, and for Quartz also
shift10-normalise.patch, gen_nam_ecc.cpp,
quartz_greedy.cpp and Nam_complete_ECC_set.json. A file whose
hash differs (the image was built from another commit) is left out.
Every compiler except BQSKit gives the same text for the same circuit, level and image in every job. BQSKit's outputs (levels 1–3) can differ between runs on one image, and between images, in gate counts as well as angles; each output still passes its check. Compare BQSKit gate counts as distributions over several runs. Cite the record's text rather than a regenerated one.
Gate counts
gate_count is the number of top-level gate statements in the output text (a
statement on whole registers once per index), and circuit_depth its greedy
layering, one statement per layer slot whatever the gate. Barriers are neither counted
nor treated as aligning the wires, so the depth can be lower than Qiskit's
depth() of the same text. Each record also has
multi_qubit_gate_count (statements on two or more qubits) and
gate_counts (statements per gate name). The compilers write different gate
sets: staq keeps swap as a single statement at every level and
ccx and cu1 only at -O1, Quartz writes h, x, rz and
cx, Cirq cz and single-qubit gates. A smaller
gate_count therefore does not mean a smaller circuit across compilers; to
compare compilers, translate the outputs to one gate set and count there.
The compilers
Up to 10 qubits, every output is checked against the compile input with Qiskit when it is produced, and a compile that fails the check is recorded as a refusal, never as output. Above 10 qubits the passes say the output is not checked. Synthetiq takes at most 3 qubits, so all its outputs are checked.
| Compiler | Levels | What runs |
|---|---|---|
| BQSKit 1.2.1 | 1, 2, 3 | bqskit.compile at that level
with max_synthesis_size=3, synthesis_epsilon=1e-8,
seed=0, one worker and no machine model (all-to-all connectivity,
BQSKit's default gate set). Each resynthesised block is accepted within
synthesis_epsilon of the block it replaces and the errors add up, so
the output approximates the input unitary; the check accepts a process
infidelity of at most 1e-6 and the passes give the measured value. BQSKit reads
c3x, c4x, rc3x and c3sqrtx as
single gates on 4 or 5 qubits and u0 without its parameter, so the
adapter adds Qiskit's qelib1.inc definitions of those the circuit uses
under new names (qelib1_c3x and so on) and renames the calls. A gate
defined in the circuit on more than 3 qubits is replaced by its body. Both are
listed in the passes. A circuit BQSKit's parser does not read is refused. Level 4
is not offered: it takes minutes even on a 4-qubit, 6-gate circuit. |
| PyZX 0.10.6 | 1, 2 | Level 1: full_reduce of the
ZX-diagram, then extract_circuit. Level 2: level 1, then
basic_optimization of the extracted circuit. Before PyZX parses the
circuit, the adapter removes creg declarations and comments, refuses
measure, reset and if, rewrites numbers in
scientific notation as plain decimals, and adds Qiskit's qelib1.inc
definitions of c3x, c3sqrtx, c4x,
rccx, rc3x and u0 where the circuit uses
them. The passes give the largest angle change from PyZX's rational phases. The
check accepts a process infidelity of at most 1e-8. |
| MQT QMAP 3.10.0 | 0, 1 | Qiskit 2.5.2 translates the circuit to
u3 and cx (basis translation only), then QMAP maps it onto
a linear chain of the circuit's qubit count, qubit i coupled to i + 1 in both
directions: heuristic (A*) at level 0, exact (SAT) at level 1, with QMAP's default
pre- and post-mapping optimizations. Level 1 is refused above 7 qubits: exact
mapping takes more than 200 s on an 8-qubit GHZ circuit already laid out as a
chain. The output's // i and // o lines give
the physical qubit of each logical qubit at input and output; both must be
permutations of all the qubits, and the unitary check reads the output through
them. A circuit with a qubit that has no gates other than barriers, identities and
rotations by 0 is refused. The post-mapping optimizations can rewrite single-qubit
sequences, so the output can contain gates such as h. |
| Cirq (cirq-core 1.7.0) | 0, 1 | Cirq's OpenQASM 2.0 parser
(circuit_from_qasm), then optimize_for_target_gateset to
the CZ target gate set (CZ and PhasedXZ gates, neighbouring operations merged);
level 1 adds eject_phased_paulis, eject_z and the cleanups
that drop negligible operations and empty moments. Written back with
to_qasm(precision=16) as one register q in declaration
order. The compiler id is cirq-transformers; the Cirq runner compiles
through pytket instead. The adapter refuses a cu3 whose θ mod 4π lies
in [2π, 4π), at top level or inside a gate definition, and the refusal gives the
reason. It adds Qiskit's qelib1.inc definition of rc3x to
the circuit given to Cirq (listed in the passes). The image sets
PYTHONHASHSEED=0, so the output text is the same in every process. The
sqrt-iSWAP target gate set is not offered: OpenQASM 2.0 has no such gate, so the
text would show only its cx decomposition. |
| staq 3.5 (softwareQ) | 1, 2, 3 | The staq command-line compiler,
built from the checksum-pinned v3.5 source with
USE_OPENQASM2_SPECS=false: -O1 (rotation folding,
simplification), -O2 (inlines every gate except x,
y, z, h, s, sdg,
t, tdg, rx, ry,
rz, cz, cy, swap,
cx and u1, then the same), -O3 (adds CNOT
resynthesis, which can raise the CNOT count); no device mapping. Registers,
creg declarations and gate definitions are kept. For a gate of
Qiskit's qelib1.inc outside staq's library (sx,
p, u, cp, rzz, c3x
and so on), the adapter adds Qiskit's definition and lists it in the passes. A
register or gate named r or cswap is refused. staq reads
numeric literals in single precision: a literal that would change by more than
1e-6, or lies below single precision's smallest normal number, is refused, and the
passes give the largest change single-precision reading makes to a constant angle.
The check accepts a process infidelity of at most 1e-8; because infidelity grows
with the square of an angle change, the angle line is the one that shows a change
of 1e-8 rad. |
| Q-Synth 5.1 (Aarhus University) | 0, 1 | Qiskit translates the
circuit to u3 and cx; then
peephole_synthesis(slicing='cnot') resynthesises each CNOT slice
exactly with a SAT solver (CaDiCaL 1.9 through python-sat): the fewest CNOTs at
level 0, the smallest CNOT depth at level 1. Q-Synth works on one register
q; the output is composed back onto the circuit's registers. Q-Synth
splits a 240 s solver budget over the slices and keeps a slice's original gates
when its solver call times out. A compile in which a slice was still timed out at
the end, or the budget ran out, is recorded as an error, because the result would
depend on machine speed. The job's timeout (at most 300 s, including process start)
ends a compile first when it is shorter. The image installs python-sat
1.8.dev14. |
| Quartz 0.3.2 | 0 | Qiskit translates the circuit to
h, x, rz and cx (Nam's gate
set); then Graph::greedy_optimize applies every rewrite from Quartz's
ECC set that lowers the gate count, until none applies. It does not move gates past
each other first, so a merge that needs such a move is missed:
rz(a) q[0]; cx q[0],q[1]; rz(b) q[0]; stays three gates. The ECC set
(equivalent subcircuits on 3 qubits with 2 symbolic parameters, up to 3 gates) is
generated and verified by Quartz when the image is built, and the build fails unless
its sha256 matches the recorded one. Quartz's search
(Graph::optimize), which stops on wall-clock time, and its rotation
merging are not offered. Angles go to Quartz as exact fractions of π and come back
the same way, so 0.3 appears as pi*238732414637843/2500000000000000;
the output keeps Quartz's gate lines with the input's registers and declarations.
The adapter removes barriers and final measurements before Quartz and writes the
measurements back afterwards; mid-circuit measurement, reset and
if are refused. The library is built with one patch,
shift10-normalise.patch. Compile time grows about with the square of
the gate count after translation: 8 s for a 16-qubit QFT (3,361 gates), about 50 s
for 8,000 gates; a compile past the job's timeout is recorded as a
timeout. |
| Synthetiq (commit 59a0cc6) | 0, 1 | For Clifford+T circuits of up
to 3 qubits. Qiskit translates the circuit exactly to h,
rz and cx; a circuit is refused unless every
rz angle is a multiple of π/4 to within 1e-12 in units of π/4 (any
angle change is listed). Synthetiq then searches by simulated annealing for a
Clifford+T circuit with the circuit's unitary, minimising the distance to that
unitary, and simplifies what it finds with its resynthesis pass. Level 0 returns the
first circuit found within 1,000 annealing runs; it does not minimise the T-count
and can return more T gates than the input. Level 1 returns the lowest-cost circuit
(T and T† 1, CX 0.1, H, S and S† 0.01) of up to 5 found within 2,000 runs. On one
thread Synthetiq draws the whole search from one random stream seeded with 0, so
the output, or the failure to find one within the runs, depends only on the input.
The image adds a --max-runs option (max-runs.patch)
because Synthetiq itself stops on wall-clock time. A 3-qubit run takes about 80 ms,
so a level 1 search can take nearly 3 minutes; the error then says whether the run
limit, the 280 s cap or the job's timeout ended it, and only the run limit gives the
same outcome on every machine. A circuit with no gates after translation is returned
empty without running Synthetiq. Barriers are removed (listed). Built without
-march=native or -ffast-math. |
GUOQ (wisq) is not offered: its search stops on wall-clock time only, so its output would depend on machine load.
Each compiler image has a self-test (python main.py --self-test). It
compiles five probe circuits at every level, among them one with a creg,
and six for QMAP, Q-Synth and Quartz, which also compile a c3x followed by
a qubit first used after it. Synthetiq compiles six Clifford+T circuits of its own,
among them one whose angles pass 2π and one that is empty after translation. It checks that each output has the input's unitary
(process infidelity within the compiler's tolerance for BQSKit, PyZX and staq; operator
equality up to global phase for the others, read through QMAP's layout lines) and
declares as many qubits as the input.
With preprocessing on, compilers receive the pytket-rewritten circuit (see
Circuit preprocessing). Run with preprocessing off to see
how a compiler treats your own text. Several compilers then refuse some valid OpenQASM
2.0, each recorded as that compile's error: BQSKit refuses register broadcasts
(h q;), Cirq refuses barrier and the four-parameter
cu, and Cirq, Q-Synth and Quartz refuse u0, which Qiskit's
reader does not take. Qiskit's translation for QMAP, Q-Synth and Quartz runs with
qubits_initially_zero=False, so a multi-controlled gate is never
decomposed with an unused qubit as a clean ancilla.
Limitations
- Agreement between backends is not correctness. Backends that agree can all be wrong, and a backend that differs from the others can be right. QRosetta compares backends with each other; only the self-test checks them against independent answers, for a few small circuits.
- Measured-mode thresholds are descriptive. The JS and Hellinger
cut-offs are configurable and depend on the shot count;
measured_assessment, from the statistical test, decides whether a pair disagrees. - Permutation search is bounded. Exhaustive qubit-permutation matching
stops at 7 qubits. Larger cases report
too_many_qubits. - Default timings are not a benchmark. By default each backend has one timed run and all backends run at the same time, competing for the host. For a comparison, follow the protocol in Timing and memory methodology. Results hold for one host, a 1-CPU quota and one thread.
- Pairwise flags can concentrate on one backend. Every pair that shares a backend reuses its sample, so one unusual sample can make several of that backend's pairs distinguishable at once. When all the flags of a run involve one backend at modest p-values, rerun with another seed or more shots before drawing a conclusion.
- A residual disagreement needs investigation. None of the registered transforms explained the difference. The cause can be an unregistered convention, an environment limit, or a defect in a backend or its adapter.
Adding a simulator
Every runner implements the same contract: process_run (statevector) and
process_run_measured (counts), built on the shared measurement code that does
the timing, memory measurement, qubit-limit check and result assembly, so every backend is
measured the same way. The step-by-step guide, including how to determine a backend's
qubit ordering and how to register it, is
CONTRIBUTING.md
in the repository.
Citing
Cite the version you used; qrosetta version prints it, and
GET /config gives the server's platform_version. The
citation metadata is in
CITATION.cff,
which GitHub offers as "Cite this repository"; .zenodo.json and
codemeta.json give the same title, authors, version and licence. Each
RO-Crate export records the software version and commit it was produced with
(Reports and exports).
Zenodo archives every release. Version 2.0.2 is 10.5281/zenodo.24529372, version 2.0.1 10.5281/zenodo.24505798 and version 2.0.0 10.5281/zenodo.24497797; the DOI 10.5281/zenodo.24497796 always resolves to the newest version.
Glossary
Terms
| Term | Meaning |
|---|---|
| Statevector mode | Each backend returns the final state of the circuit, one complex amplitude per basis state, and pairs are compared by fidelity; terminal measurements are removed first (see Run modes). |
| Measured mode | Each backend samples the circuit's measurements a number of times (shots) and returns how often each outcome occurred; pairs are compared with distances and statistical tests. |
| Fidelity | |⟨a|b⟩|², the squared overlap of two normalised statevectors: 1 for the same state up to a global phase, 0 for orthogonal states. A pair agrees when it is at least 1 − 10⁻⁵ by default. |
| Global phase | A factor eiφ that multiplies every amplitude of a state. No measurement can detect it, so it does not count as a difference; the report records it as the phase offset arg⟨a|b⟩. |
lsb, msb (bit order) | Whether qubit 0 (or classical bit 0) is the least or the most significant bit of a statevector index or a counts key. Backends declare their order, and an lsb backend is compared with an msb backend after reversing the bits (see Bit order per backend). |
| Consistent, inconclusive, distinguishable | The verdicts of a measured pair (measured_assessment): consistent means no difference beyond shot noise with enough shots to detect one; inconclusive means too few shots to tell; distinguishable means the two outcome distributions differ beyond shot noise (see The shot-noise statistical test). |
| Runner key | The name of one run in a report: the backend's id (qiskit), or <id>~opt<L>~run<N> when a request runs one backend more than once (multi-run mode). |
| Specimen | Which kind of image a backend ran from: a published release image, an image built locally, or not recorded. The report's specimens sums them up over all backends (see The image each backend ran from). |
Agreement classes
See the label tables in Agreement classification.
Not-comparable reasons (metrics.reason)
| Reason | Meaning |
|---|---|
missing_statevector | A run returned no statevector. |
statevector_parse_error | A returned statevector could not be decoded. |
empty_statevector | A statevector has no amplitudes. |
nonfinite_statevector | A statevector contains NaN or infinite amplitudes. |
zero_norm_statevector | A statevector has norm 0. |
shape_mismatch | The two statevectors have different lengths. |
missing_counts | A run returned no counts. |
empty_counts | A counts dictionary is empty. |
invalid_bitstring_key | A counts key is not a non-empty string. |
non_numeric_counts | A count value is not a real number (strings and booleans included). |
nonfinite_counts | A count value is NaN or infinite. |
negative_counts | A count value is negative. |
zero_total_counts | A counts dictionary sums to 0. |
nonfinite_metric | A distance metric evaluated to NaN or infinity. |
comparison_error | The comparison raised an exception; metrics.details.error holds the message. |
Statistical verdicts (metrics.statistical_test.verdict, measured mode)
| Verdict | Meaning |
|---|---|
consistent | Neither the chi-square test nor the G-test is significant after Benjamini–Yekutieli (BY) correction, and the power to detect a total-variation gap of 0.05, computed at α/(m·c_m), is at least 0.8. The pair's measured_assessment is then consistent_within_shot_noise. |
distinguishable | Both tests are significant after BY correction. |
inconclusive_low_shots | Expected counts below 5 after pooling rare outcomes on a table larger than 2 × 2 (inconclusive_reason: low_expected_counts), or neither test significant with power below 0.8 at α/(m·c_m) (low_power). resolvable_by_more_shots is true when a shot count within the server's shot limit would make the test conclusive, false when none would, and null when more than half of either backend's shots fell on outcomes seen once (support_characterised: false), so the outcomes seen do not characterise the distribution and no shot count is recommended. |
ambiguous | Exactly one of the chi-square test and the G-test is significant after BY correction. |
Unranked reasons (Performance and Resources)
| Reason | Meaning |
|---|---|
runner_error | The run returned an error. |
runner_timeout | The run timed out. |
runner_offline | The runner could not be reached. |
missing_timing | The run returned no execution_time_sec. |
missing_process_peak_rss | The run returned no process_peak_rss_mb. |
gpu_memory_not_measured | The run simulated on a GPU; its device memory is not measured, so it is not ranked by memory. |
Run statuses
| Status | Meaning |
|---|---|
| Offline | The runner could not be reached (infrastructure). |
| Error | The backend rejected the circuit or crashed. A run that lost its runner to qrosetta stop --force or remove is an Error whose text starts "STOPPED BY USER", with stopped_by_user: true. |
| Timeout | The run exceeded the timeout (timeout_kind: "run"), or it stayed queued behind other runs until the queue cap and never started (timeout_kind: "queue", never_started: true). |
| Anomaly | Results exist, but a statevector pair disagrees (residual_disagreement, with or without unaligned_basis_match, or agree_after_qubit_permutation), or a measured pair is distinguishable beyond shot noise or has a differing single-bit marginal. |
FAQ
Why would two correct simulators disagree?
Usually because of a convention: a different declared qubit ordering or an unobservable global phase. The agreement classification accounts for these, so a convention difference is reported as agreement. A difference that no declared convention explains is reported as a disagreement.
Is a "distance exceeds threshold" pair a bug?
Not by itself. The distances stayed above the descriptive thresholds after every
registered transform. Check the pair's measured_assessment: if it is
consistent_within_shot_noise, the test of the whole distribution found no
difference beyond what sampling produces at this shot count; if it is
inconclusive_low_shots, rerun with more shots when
resolvable_by_more_shots is true; when it is null, the outcomes seen so
far are too spread out to say how many shots would settle it. A real difference is indicated by
distinguishable, or by a marginal_assessment of
marginal_distinguishable (a single classical bit differs), whatever the
measured_assessment; its cause can be an unregistered convention, a
resource limit, or a defect in a backend or its adapter.
Does QRosetta modify a backend's output?
No. Each adapter shapes the backend's raw output into the reported form (a counts
histogram keyed by classical bits, a statevector array), and the report stores that.
Bit reversal, phase alignment and permutation matching are analysis steps reported with
their numerical effect. The input circuit can be changed before dispatch; every
such change is listed in preprocessing_applied (see
Circuit preprocessing).