run_quantum_circuit
Run a quantum circuit
Run an OpenQASM program and return measurement counts, Pauli expectation values and/or amplitudes. The service chooses the method (bit-exact or double-precision state vector up to 32 qubits, single precision on a GPU to 33, stabilizer tableau for Clifford circuits up to 32768 qubits, matrix product states up to 4096, sparse Pauli dynamics for expectation values up to 1024 with an error bound, an exact density matrix or trajectories for noise), reports why and how accurate, and signs the result. Give `intent` (an exact distribution, or a reference program it must equal or whose state it must prepare) and the engine checks it with the run. Every answer carries `verdict`: the level the engine checked to (proof, evidence, executed, parsed, refused), whether the intent holds and a plain statement, sealed in the receipt. Waits up to 50 s; a longer job answers with status running and an id for get_quantum_job. Each call is a new job unless it gives idempotency_key, which makes sending it again safe.
Parametersqasmseednoisepulseshotsfabricintentmethodparamsrepairsourcetarget+6 more
run_quantum_set
Run a set of quantum programs, or one over a grid
Run several OpenQASM programs as one set (`programs`: each a program's text or a job), or one program over a grid of its inputs (`qasm` with `sweep`, as {"theta": [0.1, 0.2], "n": [2, 3]}: every combination; integer inputs written out, float and angle inputs bound to the double given). The set's other fields (shots, observables, seed, intent, …) apply to every item. Each item gets its own result and receipt, each stating its verdict, and one receipt over the set binds every item through a Merkle root; verify_quantum_receipt checks it whole. At most 100 items, run one after another in one job. Waits up to 50 s; a longer set answers with status running and an id for get_quantum_job. Each call is a new job unless it gives idempotency_key, which makes sending it again safe.
Parametersqasmseednoisepulseshotssweepfabricintentmethodparamsrepairtarget+7 more
dry_run_quantum_job
Plan a quantum job or set without running it
What the service would do with a job or a set, running nothing: the method and why, the memory, the estimated time and energy (each with its basis: this service's own timings and readings where it has them, otherwise the planner's nominal rate, and no energy figure without readings), the bounds that apply, where you stand against your limits, and whether the service would take it now, or the refusal it would give, with its code. Takes what run_quantum_circuit or run_quantum_set takes. It counts as one submission.
Parametersqasmseednoisepulseshotssweepfabricintentmethodparamsrepairsource+7 more
get_quantum_job
Read a quantum job
A job's status, and its result when it is done. The service keeps every job across its restarts for its retention (a day on the public service); a job that was running when it stopped is run again once from its request (its interruptions say when), and stopped again it comes back interrupted, with the reason.
Parametersidrequired
verify_quantum_receipt
Verify a result's receipt
Whether a result's receipt (an Ed25519 signature by the service) seals exactly that request and that result. Pass the job's own `request` (as run_quantum_circuit or get_quantum_job returns it: a run here asks for its verdict, so the request it seals says so) and its result.
Parametersresultrequiredrequestrequired
critique_qasm
Critique a quantum program
A program's measures, computed by the engine: gates by kind, two-qubit gates, depth and two-qubit depth, T count, whether it is a Clifford circuit, and a fidelity under reference error rates (a model, not a run). Also its smells, each with its lines: gates that cancel, rotations that merge or do nothing, idle qubits, and qubits acted on but never measured.
Parametersqasmrequired
check_equivalent
Check two quantum programs are the same circuit
Whether two programs are the same circuit up to a global phase, and how the engine knows: Clifford circuits by their tableaus at any size, others on every basis state to 8 qubits, then by checked rewrites of one followed by the other's inverse to nothing (a proof at any width), then on random product states to 22 (evidence, not proof), otherwise unchecked with the reason. Its `verdict` is that decision; `verification` is the level it reached, as every tool's verdict states it. A check that would take long here is refused with the command that runs it locally.
Parametersarequiredbrequired
convert_program
Convert a program between formats
Carry a program between OpenQASM 3, QIR (LLVM text, read under its base and adaptive profiles, written as QIR 2.0) and jeff (its Cap'n Proto message, as base64). The answer is the program written, the program as OpenQASM 3 (what every other tool takes), each note with its code (a rotation at an arbitrary angle, a custom gate read by its name, what a format leaves out), what was read and written, and the check: the output read back and held to the program by the equivalence ladder. A construct a reader cannot hold exactly is refused with its code (Q700 to Q721) and its place: quote the code, and never guess around it. A conversion larger than the service takes is refused with the command that runs it locally.
Parameterstorequiredfromcheckprofileprogramprogram_base64
improve_qasm
Improve a quantum program
The program with its smells fixed in its own text (all of them, and each alone), each candidate with its measures and the equivalence check's verdict against the program. A candidate the check finds different is never returned.
Parametersqasmrequired
classical_shortcuts
Find a quantum program's classical shortcuts
Every exact classical route to simulating a program, priced on it: the stabilizer tableau, the cut-rank sum, an exact matrix product state at a rigorous bond bound, the light cone of a one-qubit expectation value, and the state vector. The cheapest is named for each question. A cheap route proves the program classically easy; none being cheap proves nothing about hardness. A thorough search, with a contraction tree, runs locally: wai-quantum shortcuts --thorough.
Parametersqasmrequired
compile_qasm
Compile a quantum program, every pass checked
Compile an OpenQASM program through named passes (lowering, checked rewrites, phase folding, one- and two-qubit resynthesis, and every rotation off the multiples of π/4 written as a Clifford+T word within its share of the ε budget), each checked where it acts. Returns the compiled program and a certificate sealed with the service's key: each pass's counts before and after, its check and verdict (proof, exact or approximate with its distance), the budget and the bound the distances add to. verify_quantum_receipt checks it. Quote the bound; an approximate compile is not exact. A large or very fine compile is refused with the local command.
Parametersqasmrequiredbasislevelepsilon
estimate_resources
Estimate a quantum program's fault-tolerant resources
What a fault-tolerant quantum computer would need to run a program. First its logical counts: T gates, Toffolis, rotations (each costed at the T count of its own synthesised Clifford+T word, within its share of the budget), measurements, T depth and total depth, and logical qubits with the ancillas that gates under several controls need. Then, on a physical qubit, the planar model's code distance (the gate-based surface code's model fitted to this engine's own decoders), T factories, physical qubits and runtime, and the frontier of estimates trading qubits for time. Takes a program, or a logical-counts or routine document. Every estimate is sealed in the resource-estimate receipt family, binding the program's digest and the ε budget; the answer's notes state the model's assumptions. Quote the figures with the qubit and the budget, and call them an estimate. Sealed with the service's key; verify_quantum_receipt checks the seals and re-runs it. A program with more than 256 distinct rotation angles, or a budget too fine for its rotations, is refused with the local command.
Parametersnameqasmqubitbudgetcountsexportroutinecalibrationmax_slowdown
repair_qasm
Repair a quantum program on its flagged lines
Repair a program the reader refuses, changing only the lines its diagnostics flag. The engine makes the fixes that are mechanical (a missing `;`, an undeclared register's size, a measurement with no target, an unbounded while given the bound chosen, an angle the bit-exact method refuses rounded to the bits chosen with its rounding stated), and holds a fix you propose (`proposed`) to the flagged lines: any change to another line is rejected (J021) and nothing is changed. Returns the repaired program, each repair with its code and every line it changed, what needs a person with the reader's advice, and the verdict.
Parametersqasmrequiredrulessizesproposeddiagnosticsdyadic_bitsmax_iterations
quantum_service_info
What the quantum service can do
The methods with their qubit limits and what each answers, the accuracy classes, the per-client limits, the current load, how jobs are kept and metered, the receipt keys, and the conventions (bit order, Pauli strings).
Takes no parameters.
qasm_diagnostics
The reader's diagnostic codes
Every code the OpenQASM reader gives (each refusal and warning carries one, as `[Q103]` at the end of its message): its outcome (refused, lowered, carried, preserved or warned) and its meaning; and beside them, under job_codes, the codes of what is asked of a program (`[J011]`: the request, the method, an intent, a repair, the host). A code never changes meaning once released. Give `code` for one of either.
Parameterscode
list_components
List the engine's components
Every component the service plans, runs, compiles and converts through: the simulation methods, the compiler passes, the noise channels and the program formats, each with its version, its origin and the BLAKE3 digest of its descriptor, which is the identity a result is sealed with. The service runs the built-ins alone and never loads a component from a request.
Takes no parameters.
list_targets
List the device targets
The device targets the service knows by name: synthetic, made up in the shapes of published formats, each with its qubits, pairs, the gates a program compiles to, the spread of its T1 and readout errors, and its hash. A job may give its own target document instead.
Takes no parameters.
show_target
Show a device target
A device target's qubits, pairs, native gates with the spread of their errors and durations, its calibration snapshot and its hash; with view, each qubit's place for drawing its coupling map with its readout and one-qubit errors, and each pair's two-qubit error. Give a built-in target's name or a target document.
Parametersviewtargetrequired
run_on_target
Run a program as a device would
Run an OpenQASM program as it would run on a device target: compiled exactly to its gates, placed on its most reliable qubits and routes (the expected success given), checked against the circuit, and simulated under the noise its calibration gives, on the density matrix or by trajectories. Counts and expectation values with their distance from the ideal distribution, the noise derived, and a receipt that binds the target's hash. A model of the device, not a run on it. Every angle must be a dyadic multiple of 2π. Waits up to 50 s, as run_quantum_circuit does, and like it, each call is a new job unless it gives idempotency_key.
Parametersqasmseednoisepulseshotsfabricintentparamsrepairsourcetargetrequiredcompile+5 more
quantum_circuit_examples
Ready-to-run quantum examples
Worked examples, each a complete job (OpenQASM program and arguments) with what it shows: a Bell pair, a rotation, QAOA, noise, a 1000-qubit GHZ state, 100-qubit dynamics, 200 qubits as a matrix product state. Pass an example's job to run_quantum_circuit as it is, or adapt it.
Takes no parameters.
qec_code
Show an error-correcting code and certify its distance
Show an error-correcting code and certify its distance: its checks (Z-type: they see X errors) and stabilizers (X-type), k counted by rank, a layout to draw it, the decoders it admits, and its distance certificate. In each sector the certificate gives the least weight of a logical found, a witness of that weight, and every lighter support ruled out by an exhaustive search over connected supports (a bivariate-bicycle code's translations checked as symmetries before use), re-checkable node for node. Give `certificate` to check one: its witnesses and the search run again. Sealed with the service's key. Quote the certificate's distance and its reading; a search stopped by `bound` settles nothing past it.
Parameterscoderequiredboundcertifycertificate
qec_decode
Decode a syndrome or a circuit's detectors
Decode with the engine's decoders. At code capacity, give `code` and a `syndrome` (the violated checks) or an `error` (the flipped qubits: its syndrome is taken and its residual judged, logical or not): matching (exact) and union_find for codes whose qubits sit in at most two checks; color for colour codes (restriction to matching on the three restricted lattices, lifted at each colour, completed below half the distance by an exact search); relay_bp for any code (it can stall on a degenerate error of a topological code, and then says it did not converge); search for the lightest error with the syndrome up to max_weight. At circuit level, give `memory` ({distance, rounds, p}: the rotated surface-code memory experiment), `circuit` (the circuit text: tags, Pauli-target observables and coordinates read) or `model` (detector error model text, decompositions with ^ read), with the fired `detectors` (the prediction: which observables flipped) or `shots` (sampled and decoded: the failure rate and its standard error): matching (exact), correlated (exact matching twice through the model's decomposed faults, the second answer kept only when the model's mechanisms explain it more cheaply), union_find, bp_osd, or window (a sliding window: `window` {commit, buffer} rounds; every edge set below half the distance is corrected once the buffer is at least (d + 1)/2). Sealed with the service's key.
Parameterscodeseederrormodelshotsmemorywindowcircuitdecodersyndromedetectorsmax_weight
qec_threshold
Measure logical failure rates over distances
Measure logical failure rates over distances and physical error rates: family surface at circuit level (decoders matching, correlated or union_find; the code model P(d) = a·(p/p*)^((d+1)/2) per round fitted to the points), or color, toric or surface_capacity at code capacity. Each point gives its shots, failures, rate and standard error; below_threshold says, at each p, whether every larger distance failed less. Sealed with the service's key. Report rates with their errors: a crossing measured on few shots is not a threshold.
Parameterspseedshotsfamilyroundsdecoderdistances
pulse_schedule
Read a pulse program into its schedule
Read a pulse program (OpenPulse calibrations: ports, frames, waveforms, play, delay, shift_phase, set_phase, shift_frequency, set_frequency, captures and barriers) into its schedule on frames: every instruction at its sample, each waveform's samples (gaussian, drag, gaussian_square, constant, sech, sine, or explicit), each gate call with the samples its calibration spans, and the digests a pulse run's receipt binds (the program, its calibrations, the schedule). Durations are whole samples of dt (pulse.dt_ns, default 0.5 ns) or refused. A construct the reader does not take is refused with a Q code and its line. Sealed with the service's key. To run it, give the program to run_quantum_circuit with method "pulse".
Parametersqasmrequiredpulse
pulse_check
Check a pulse run by running it again
Check a pulse job as a host returned it ({"request", "result"}, the result with its receipt): the receipt's signature, the program's digest against the request's text, and the request run again here with the result held to the one given field by field (the density matrix's digest among them), each difference named. A pulse run is the same bits on every platform, so a result that does not reproduce was not made from that request by this engine. Sealed with the service's key. Quote `verified` and the statement.
Parametersresultrequiredrequestrequired
gradient_qasm
The exact gradient of a Hamiltonian's expectation by a program's parameters
The expectation E = ⟨ψ|H|ψ⟩ of a Hamiltonian at a program's parameters, and its gradient by each parameter, exactly: by adjoint differentiation or the parameter-shift rule on the double-precision state vector (at most 20 qubits, no noise, measurements only at the end). The reader follows each parameter into the gates, so an argument may be any expression of the built-in functions. The answer states its method, that it is f64 and approximate, and a bound on the rounding of the value and of each component (precision.rounding_bound). Sealed with the service's key. Quote the gradient with its bound.
Parametersqasmrequiredparamsrequiredgradienthamiltonianrequired
optimize_qasm
Minimise a Hamiltonian's expectation over a program's parameters
Minimise E = ⟨ψ|H|ψ⟩ over a program's parameters from the given params, deterministically: gradient descent with a fixed step, Adam, or SPSA from a seeded stream (at most 2000 steps). Every step's parameters and value (and gradient, or SPSA's perturbation and estimate) are listed, each step a link of a digest chain from the request, best and final given; the same request gives the same bytes on every platform. Sealed with the service's key: the receipt binds the program, every step, the method and the seed, and verify_quantum_result (or wai-quantum verify) re-runs it. A minimum found is a minimum along this path, not a proof of the global one.
Parametersqasmrequiredseedstepsparamsrequiredgradientoptimizerstep_sizehamiltonianrequired
vqe_ground_state
Find a Hamiltonian's ground energy by the variational eigensolver
The variational eigensolver: an ansatz (the program given as qasm with params, or ansatz {"layers": L}: layers of ry and rz on every qubit and a ring of cx, its parameters t0, t1, … from 0.1) optimised on the Hamiltonian as optimize_qasm does. At most 8 qubits the answer sets the energy found beside the exact ground energy by diagonalisation (reference.ground_energy and gap); the energy found is never below it. Sealed with the service's key. Report the gap: an ansatz that cannot reach the ground state stops above it.
Parametersqasmseedstepsansatzparamsgradientoptimizerstep_sizehamiltonianrequired
qaoa_maxcut
Solve Max-Cut on a graph by QAOA
Max-Cut by the quantum approximate optimisation algorithm: the program (|+⟩ⁿ, then for each layer rzz(gamma·w) on every edge and rx(2·beta) on every qubit) and its cost Hamiltonian built from the graph (at most 20 vertices, 16 layers), optimised as optimize_qasm does from the params or a linear ramp, and read against the maximum cut found by brute force: the expected cut and its ratio to the maximum, the likeliest assignment and whether it is optimal, and the probability of an optimal one. Sealed with the service's key.
Parametersseedgraphrequiredstepslayersparamsgradientoptimizerstep_size
build_algorithm
Write the program for a standard algorithm, checked against its reference
An OpenQASM 3 program for a standard algorithm, with how to read its result, what it gives, and the equivalence ladder's verdict on it against a reference matrix or truth table built from the definitions (check: exact on every basis state up to 8 qubits, the adder's up to 16; past that unchecked). qpe: the phase φ of p(2πφ) on counting qubits; amplitude_estimation: the amplitude a that A = ry(2·arcsin √a) gives the good state, by phase estimation of the Grover operator; adder: the ripple-carry adder of bits-bit integers in place (with a and b, prepared and measured); qsvt: quantum signal processing from phases, of a signal x or of a real symmetric 2 × 2 matrix through its block encoding (all phases zero give the Chebyshev polynomial). Sealed with the service's key. Run the program with run_quantum_circuit.
Parametersabxbitsphasematrixphasescarry_incountingalgorithmrequiredamplitude