Skip to main content
KetQat

Appearance

Definition · intermediate

Quantum intermediate representation

A machine-independent program format between quantum languages and hardware back ends. OpenQASM 3 is a textual circuit language with real-time classical control, timing and pulse calibrations; QIR expresses quantum programs in LLVM IR with profiles of supported features.

Established definitionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

An intermediate representation (IR) for quantum programs is a format, with defined syntax and semantics, that front ends (languages, circuit libraries) emit and back ends (compilers for specific devices, simulators) consume, so that LL languages and TT targets need L+TL + T translators rather than L×TL \times T. Two open standards are widely used.

OpenQASM 3 (Cross et al.; specification) is a textual language. Its gate semantics rest on two built-in gates, the single-qubit U(θ,ϕ,λ)U(\theta, \phi, \lambda) and the global phase gphase(γ)\mathrm{gphase}(\gamma); further gates are defined hierarchically or by modifiers such as ctrl @, negctrl @ and inv @. Beyond circuits it adds classical types and arithmetic, branching and loops on measurement results that must execute within the qubits' coherence time, subroutines and extern calls, timing types (duration, stretch) with delay, box and barrier, and defcal blocks that attach pulse-level implementations, in a selectable pulse grammar, to gates and measurements on specific physical qubits. A gate definition fixes a unitary, not how the hardware implements it.

QIR (specification) defines quantum programs as LLVM IR: qubits and results are opaque pointers, quantum operations are calls to functions of a quantum instruction set that the target chooses, and classical code is ordinary LLVM. Because targets differ widely, QIR defines profiles, coherent subsets that a back end declares it supports. The Base Profile requires only a sequence of quantum instructions followed by measurement of the qubits at the end; the Adaptive Profile adds mid-circuit measurement, conversion of results to booleans, and nested forward branching on them, with loops and further features as optional capabilities.

The two are complementary: OpenQASM 3 reads like an assembly language for circuits with real-time control, QIR reuses classical compiler infrastructure for analysis and optimisation.

Holds when

  • The descriptions of OpenQASM 3 and QIR follow their public specifications as accessed on 2026-12-01; both are living standards and later versions may differ.

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. Andrew Cross, Ali Javadi-Abhari, Thomas Alexander, … Blake R. Johnson (2022). OpenQASM 3: A Broader and Deeper Quantum Assembly Language. ACM Transactions on Quantum Computing 3, 1-50. doi:10.1145/3505636arXiv:2104.14722
  2. OpenQASM contributors (2026). OpenQASM 3.x Live Specification. openqasm.com
  3. QIR Alliance (2026). Quantum Intermediate Representation (QIR) specification, including the Base and Adaptive profiles. github.com

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    OpenQASM 3 description compared with the live specification at openqasm.com (accessed 2026-12-01): gates page (built-in U(theta,phi,lambda) and gphase(gamma), hierarchical gate definitions, ctrl/negctrl/inv modifiers), delays page (duration, stretch, delay, box, barrier), classical page (real-time instructions within qubit coherence time, extern functions), pulses page (defcal on physical qubits, defcalgrammar selecting e.g. openpulse). QIR description compared with qir-alliance/qir-spec main branch, specification/profiles/Base_Profile.md (sequence of quantum instructions, measurement at end, opaque ptr qubits/results) and Adaptive_Profile.md (mandatory mid-circuit measurement, results to booleans, arbitrarily nested forward branching; backwards branching/loops as optional capability 7). Cross et al., ACM TQC 3 (2022) metadata checked on Crossref.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e

Current revision 1504cb3e498bb2d5. Source file knowledge/records/definition/quantum-intermediate-representation.md in the content repository (readable there once it is public).