Research
Rule-based hardware-configurable static analysis for quantum programs
Quantum hardware ISAs change quickly: new instructions, data types, and constraints appear while older ones are deprecated, and a cloud service such as Amazon Braket may host devices with several…

- arXiv
- 2611.01995
- Published
- 2026-11-01
- Authors
- Yi-Ting Chen, Lauren Capelluto, Ryan Shaffer, Jeffrey Heckey
In plain words
Quantum hardware ISAs change quickly: new instructions, data types, and constraints appear while older ones are deprecated, and a cloud service such as Amazon Braket may host devices with several different ISAs at once. If hardware-specific validation is hard-coded into a static analysis engine, every hardware update forces changes to the engine itself.
AI summary
Overview
Research area: Quantum software engineering, specifically static analysis and compiler tooling for quantum programs. Technical level: Intermediate — assumes familiarity with quantum programming (OpenQASM, native/verbatim gates), abstract syntax trees, and basic compiler concepts. Scope: The paper presents SHARP, a rule-based framework that validates OpenQASM programs against hardware instruction set architectures (ISAs) supplied as standalone data rather than hard-coded into the analysis engine.
What This Paper Is About
Quantum hardware ISAs change quickly: new instructions, data types, and constraints appear while older ones are deprecated, and a cloud service such as Amazon Braket may host devices with several different ISAs at once. If hardware-specific validation is hard-coded into a static analysis engine, every hardware update forces changes to the engine itself. The paper's goal is a stable validation layer where hardware constraints are expressed as rules and loaded as data, so that supporting a new or modified device feature requires updating only the ISA description.
Key Contributions
- Decoupled architecture: SHARP separates the ISA description from the core static analysis mechanism, so the engine has no knowledge of specific hardware and consumes the description alongside the program at validation time.
- Rule-based ISA representation: Hardware constraints are expressed as
Ruleobjects built from an "attribute" (a property of a program element) and a "kernel" (the check applied to it), and composed by stacking withALL,ANY, andCONDITIONAL. - Analysis-driven multi-stage validation: A
Passpairs a rule with an action, and aPassSequencechains passes. Analysis passes annotate AST nodes or key-value tables, and validation passes enforce constraints conditioned on those annotations, enabling complex validation from simple rules. - Language decoupling: An attribute extraction layer confines all parser and AST dependencies, so supporting a new language or AST implementation requires only a new extraction layer (adapter plugin), not a reimplementation of the framework.
Main Findings
- Expressiveness of simple rules: The paper walks through a conceptual device "QC1" and its novel
raw_measureinstruction, encoding three constraints as rules: allowed qubits ($1,$2,$3), a resonator-to-qubit relationship ($1→R1,$2→R2,$3→bothR1andR2), and a return type of two real numbers for the I/Q readout values. - Feature updates are data updates: When the QC1 manufacturer later removes the resonator input, only the rule object is replaced (
raw_measure_rulebecomesraw_measure_rule_v2); the engine is unchanged. - Program-level constraints are supported: Beyond single-instruction checks, SHARP uses a global key-value table and a per-pass key-value table to handle constraints such as a maximum number of
measureinstructions (limit denotedM) and an ordering requirement that anmcminstruction precede aclassical_controlinstruction. - Feature access control becomes data management: Because ISA descriptions are standalone data, gating experimental or beta features by account or role requires managing data rather than adding logic or code paths in service components.
- Complexity: Validation complexity is stated as O(N_g·N_L), where N_g is the number of native gates and N_L is lines of code, since rules grow linearly with native gate count.
- Benchmark: A Python implementation on a MacBook M1, using a rule stack for the Rigetti Ankaa-2 ISA (four native gate types: Rx, Rz, ISWAP, CZ; 3 to 5 constraints per gate; 15 leaf rules total), validated OpenQASM programs at approximately 30 microseconds per line. Parsing the same programs with the default OpenQASM parser took roughly 200 microseconds per line on the same environment.
- No correctness evaluation reported: The paper reports timing only; it does not report accuracy, false-positive/false-negative rates, or a comparison against other hardware-aware validators.
- Fault-tolerant applicability: The authors argue the approach extends to fault-tolerant systems, where constraints from Clifford+T or lattice surgery primitives and from surface-code or color-code architectures can be encoded as rules.
Methodology in Plain English
The workflow is: parse the quantum program into an abstract syntax tree; use an extraction layer to map AST fields onto SHARP's semantic attributes (for example, mapping an OpenQASM QuantumGate node's arguments attribute to Instruction.inputs); then run passes over the tree.
Each rule retrieves an attribute and hands it to a kernel, which performs the actual check — membership in a set, equality, length, or type uniformity. Rules combine into trees using ALL, ANY, and CONDITIONAL. Each pass associates a rule with an action that fires only if the rule evaluates to true. Analysis passes write findings into AST node data or into key-value tables; validation passes use those findings as conditions and throw an exception (with an actionable message from the failing rule) when a constraint is violated. Because the ISA is a separate data artifact, adding raw_measure support means adding a PassSequence to that device's description — not editing the engine.
Why This Matters
The work reframes hardware-aware validation as a data problem rather than a code problem, which matters for services that must track fast-moving, heterogeneous quantum ISAs. Catching constraint violations before submitting a job avoids wasted time on scarce quantum processors.
Real-world applications:
- Multi-vendor cloud quantum services that host devices with different native gate sets and must validate submissions per device.
- Native/verbatim programming workflows, where users write directly to a device ISA and need instruction-level and program-level constraint checks.
- Beta and experimental feature gating, restricting unstable features to opted-in accounts through data rather than service code changes.
- Fault-tolerant program validation, encoding logical-operation constraints such as T-count limits or logical qubit layout rules.
Industry relevance is direct: the authors are affiliated with Amazon Braket and AWS Quantum Technologies, and the design targets exactly the maintenance burden such a service faces when onboarding new hardware.
Future Directions
- Higher-performance implementation: the current Python prototype could have performance-critical components rewritten in a compiled language such as C++ or Rust.
- Solver-based inference: translating rule stacks into logical formulas for SAT or SMT solvers, moving beyond pattern checks toward formal constraint verification.
- Pipelining and parallelization: validating many programs concurrently across threads or distributed systems, and overlapping ingestion, validation, execution, and result processing.
- Broader language and FTQC coverage: additional attribute extraction layers for other languages or AST implementations (the paper notes OpenQASM and QIR may have C++ parsers and ASTs with different node and attribute names), plus encoding of distance-based scheduling rules and logical qubit layout constraints.
Target Audience
Quantum software and compiler engineers building validation or transpilation infrastructure; maintainers of cloud quantum computing services that host multiple hardware backends; researchers working on quantum programming languages and IRs; and readers interested in how classical rule-based static analysis tools such as ESLint, Clang-Tidy, and Error Prone can be adapted to hardware-aware quantum program validation.
Authors’ abstract
The rapid evolution of quantum hardware necessitates an adaptable static analysis framework for validating quantum programs. In this work, we introduce SHARP, a rule-based static analysis framework designed for OpenQASM that decouples hardware-specific constraints from the validation engine. By employing a rule-based approach, SHARP allows quantum computing services to validate programs against evolving instruction set architectures (ISAs) without having to modify the core…
The full abstract on arXivRelated papers
- Resource-Optimal Screening for Two-Tier Quantum System Characterization 2026-10-25 · quant-ph · Also by Yi-Ting Chen
- Agentic Pipelines for Mapping Topological Codes to Quantum Hardware 2026-11-02 · quant-ph · Key terms of the title in common
- Discovering formally verified quantum programs with AI 2026-11-06 · quant-ph · Key terms of the title in common
- Weight-Space Programming of Variational Quantum Circuits: Large Language Models Write Quantum Circuit Parameters Without an Optimizer 2026-11-08 · quant-ph · Key terms of the title in common
- Quantum Residual Exploration for Selected Configuration Interaction 2026-11-09 · quant-ph · Key terms of the title in common