# Techniques: Hardware-tailored logical Clifford circuits for stabilizer codes

## What the paper contributes (one paragraph)

The paper gives a general method for compiling any logical Clifford gate (or whole logical Clifford circuit) of an arbitrary stabiliser code into a short sequence of physical gates. It frames the task as an integer quadratically constrained program (IQCP): an alternating ansatz of single-qubit Clifford layers and controlled-Z layers is constrained to realise the target logical gate, while a fully characterised gauge freedom (the freedom matrix) and arbitrary hardware connectivity constraints are folded into the same optimisation and minimised for two-qubit gate count. Unlike generator-by-generator approaches, it compiles entire circuits holistically. For distance-2 error-detecting codes it adds a flag-gadget recipe that makes a compiled circuit fault-tolerant with at most two auxiliary qubits, and it verifies fault tolerance through circuit-level stim noise simulations. The authors apply this to design teleportation-free fault-tolerant logical Hadamard gates for the [[8,3,2]] colour code and release an open-source Python package, htlogicalgates.

## Techniques offered

- **Hardware-tailored logical Clifford circuit synthesis (gauge-optimised IQCP compilation)** - Compiles a target logical Clifford gate or full logical circuit on any stabiliser code into a connectivity-respecting physical circuit by solving an integer quadratically constrained program over an alternating single-qubit-Clifford and CZ ansatz, optimising over all gauges and minimising two-qubit gate count.
  - guarantee: static proof; the returned circuit provably implements the desired logical Clifford gate (the ansatz class is shown expressive enough for any Clifford on a connected device, and feasible solutions satisfy the symplectic constraints exactly), with minimised CZ count subject to the imposed hardware connectivity.
  - quote: "Here, we introduce a mathematical framework for constructing hardware-tailored quantum circuits that implement any desired Clifford unitary on the logical level of any given stabilizer code."

- **Flag-gadget fault-tolerance construction for distance-2 codes** - Takes a compiled logical Clifford circuit on an error-detecting code and repairs it into a fault-tolerant one by inserting at most two flag qubits carrying backpropagated controlled-Pauli gates so that any single fault produces a detectable error.
  - guarantee: static proof of detectability; for a distance-2 code every single circuit fault is caught without introducing further undetectable errors, using no more than two physical flag qubits.
  - quote: "a flag gadget requiring no more than two physical qubits can catch the error $E$, without introducing further undetectable errors."

- **Circuit-level noise simulation for fault-tolerance verification and benchmarking** - Runs stim-based circuit-level Monte Carlo simulations of the full fault-tolerant protocol (state preparation, logical gates, stabiliser and logical measurements) to confirm fault tolerance and compare logical error rates against an existing teleportation-based construction.
  - guarantee: statistical bound; empirical logical error rate versus physical error parameter p, numerically confirming the expected distance-2 fault-tolerant scaling and an order-of-magnitude logical error reduction over the baseline.
  - quote: "The goal of these simulations is twofold: to numerically verify that our logical Hadamard circuits for the $\llbracket 8,3,2 \rrbracket$ code are indeed fault-tolerant (FT), and to compare their performance against an existing protocol~\cite{wang_fault_tolerant_2024}."

## Where it could apply

- Target primitive(s): none directly (logical Clifford gate and circuit compilation for fault-tolerant computation; not VQE, QAOA, QPE, sampling, or Trotterised simulation as such, though it supplies the Clifford layer those workloads run on)
- Target application group(s): error_correction; platforms_tooling
- Code family / hardware assumptions: arbitrary stabiliser codes (CSS and non-CSS), demonstrated on the [[4,2,2]] iceberg code, the [[12,2,3]] twisted toric code, and the [[8,3,2]] colour code; supports arbitrary connectivity graphs with a single connected component, so applicable to superconducting, trapped-ion, and neutral-atom platforms; fault-tolerance results restricted to distance-2 error-detecting codes.

## Caveats

Full open-source method and software (htlogicalgates), no paywall or access limits. The fault-tolerance construction and its simulation-based verification are demonstrated only for distance-2 error-detecting codes; extending the flag-gadget step to larger code distances is stated as a proof-of-principle that requires significant further work. The IQCP is NP-hard in the worst case and relies on the proprietary Gurobi solver, so scaling to large codes is not guaranteed. The method targets Clifford gates only; non-Clifford gates, state preparation, and code switching are noted as future directions rather than delivered capabilities.
