Source-linked AI summary

MagiCFirm: A Runtime for Magic-State Cultivation with Algorithm-Hardware Co-Design

Jubo Xu, Abbas B. Ziad, Prakash Murali, Hongxiang Fan

arXiv:2609.29267v1quant-phcs.ARcs.DC

TL;DR

Cultivation needs a runtime between logical software and physical control, with protocol-specific decisions produced under tight latency constraints. MagiCFirm combines offline-compiled control and dedicated datapaths with a two-stage early-escape scheme that runs partial and complete decoding in parallel. It reduces wall-clock preparation time by up to 39.3% at matched logical error rate, with an estimated 11% application-runtime reduction for a representative workload.

  • Problem

    High-level FTQC tools leave online cultivation execution largely unspecified, although measurement interpretation, decoding, and retries must meet timing constraints while the encoded state remains protected.

    Source: §1 · p. 1
  • Method

    MagiCFirm combines offline-compiled microprograms and configurable detector and event-processing datapaths with offline detector selection and parallel partial and complete decoding for early escape.

    Source: §1 · pp. 1–2
  • Results

    39.3% lower wall-clock preparation time at matched logical error rate, with an estimated 11% reduction in overall runtime for a representative workload.

    Source: §1 · p. 1
  • Takeaways & Limitations

    The results turn cultivation from a coarse logical abstraction into a concrete runtime operation whose latency and resource use can be accounted for.

    Source: §6 · p. 12

    MagiCFirm currently targets statically compiled circuits; dynamic circuits will require richer data-dependent event triggers and conditional microprogram branches.

    Source: §5 · p. 11

Abstract

from arXiv · show

Magic-state cultivation offers a promising alternative for lowering the cost of non-Clifford operations in fault-tolerant quantum computing (FTQC). However, realizing cultivation in practice exposes two challenges: (i) the lack of an open-source classical runtime layer between logical software and physical control, and (ii) the latency constraints on protocol-specific decisions that determine magic-state readiness. To address these challenges, we adopt an algorithm--hardware co-design approach. At the algorithm level, we develop a two-stage early-escape scheme that identifies an informative subset of detectors offline, constructs a compact decoding problem, and performs partial decoding in parallel with complete decoding at runtime, allowing high-confidence attempts to advance before full decoding completes. At the hardware level, we present MagiCFirm, a configurable runtime that combines offline-compiled microprograms with dedicated datapaths for detector construction, event processing, and protocol control, enabling end-to-end execution of magic-state cultivation. Across evaluated configurations, MagiCFirm reduces wall-clock magic-state preparation time by up to 39.3% at matched logical error rate. For a representative magic-state-bound workload, this translates to an estimated 11% reduction in overall application runtime.

1 Introduction

Magic-state cultivation can reduce the resource burden of non-Clifford operations, but its real-time measurements, decoding, retries, and control need an execution layer between logical software and physical control. MagiCFirm combines a configurable hardware runtime with a two-stage early-escape scheme to advance high-confidence attempts before complete decoding finishes.

1 Introduction

  • Cultivation requires real-time interpretation of noisy measurements, protocol-specific decisions, and decoding-dependent retries while the encoded state remains protected through continued QEC rounds.These variable classical-processing latencies are coupled to quantum execution time and resource occupancy.Source: §1 · p. 1
  • 39.3% lower preparation time at matched logical error rate, with an estimated 11% reduction in application runtime at a representative operating point.The estimate is for a workload where magic-state supply accounts for 90% of execution time.Source: §1 · p. 1
  • MagiCFirm realizes cultivation end to end with offline-compiled microprograms and configurable datapaths for detector construction and event processing.The runtime is designed for monolithic and distributed control systems.Source: §1 · p. 1
  • Its two-stage early-escape scheme constructs a compact decoding problem offline, then runs partial and complete decoding in parallel so high-confidence attempts can advance early.The partial-mask method profiles logical ambiguity and applies structural closure before graph-based DEM contraction.Source: §1 · p. 2

2 Background and Motivation

This section introduces the quantum-error-correction and decoding concepts behind magic-state cultivation, then motivates an executable runtime and faster cultivation decisions. It highlights the preparation-time and accepted-state-error trade-off, and how selective detector information can support earlier state availability.

2.1 Background

  • Fault-tolerant universality supplements Clifford gates with non-Clifford T gates, commonly implemented by consuming encoded magic states; distillation and cultivation are preparation approaches.Distillation consumes multiple noisy magic states, while cultivation improves one encoded state through physical operations and post-selection.Source: §2.1.1 · p. 2

2.1.1 Quantum Error Correction.

  • Quantum error correction encodes logical qubits in redundant physical blocks and detects errors through stabilizer measurements.Major code families include surface, color, and high-rate qLDPC codes.Source: §2.1.1 · p. 2

2.1.2 Detector Construction and Decoding Confidence.

  • A detector is a protocol-specific XOR over spatiotemporal measurement records; a matchable detector error model supports graph-based decoding, and the complementary gap compares minimum-weight configurations in two logical classes.Similar class weights indicate low decoding confidence, while a larger gap indicates higher confidence.Source: §2.1.2 · p. 2

2.1.3 Magic State Cultivation (MSC).

  • Cultivation injects a noisy logical magic state, uses detector-triggered post-selected checks to improve it in place, then transfers it into a larger escape code.The complementary gap is evaluated after decoding and compared with a tunable threshold, trading lower output LER for higher retry overhead.Source: §2.1.3 · pp. 2–3

2.2.2 Performance Challenge: Cultivation Decision Latency.

  • Raising the complementary-gap threshold from 30 to 67 dB lowers accepted-state LER from 9.7 × 10−5 to 1.5 × 10−6, while average preparation time rises from approximately 31.5 to 66.7 𝜇s.Classical decision processing contributes roughly two thirds of preparation latency across the sweep.Source: Figure 2 · p. 3, §2.2.2 · p. 4

2.2 Motivation

  • Existing control and QEC systems provide measurement feedback and real-time decoding, but not a protocol-aware runtime for end-to-end detector-driven state preparation.The proposed runtime addresses this execution gap and targets cultivation decision latency through partial-detector early acceptance.Source: §2.2 · p. 4

2.2.1 Architectural Challenge: From FTQC Abstractions to Executable Protocols.

  • MagiCFirm separates static protocol semantics from latency-critical execution by compiling protocol rules offline into per-controller microinstructions for online coordination.The runtime coordinates detector construction, protocol decisions, decoding, and physical control.Source: §2.2.1 · p. 4

2.2.2 Performance Challenge: Cultivation Decision Latency.

  • Only 48 of 1,027 detectors (4.7%) reduce conditional mean gap by at least 6 dB, while the top 10% account for 83.2% of summed negative shifts.Partial and complete decoders run in parallel; after early acceptance, remaining complete-decoder latency overlaps downstream operations, while the complete decoder still supplies the correction.Source: §2.2.2 · p. 4

3 MagiCFirm System

MagiCFirm integrates hierarchical logical control with existing physical-control systems through offline compilation and runtime event handling. Its design coordinates protocol transitions, maps logical instructions to backend-specific commands, and constructs detectors hierarchically from measurements.

3.1 Control System Design

  • An offline compiler maps circuits and system configurations to per-board microprograms, allowing parameterized LCores to support monolithic and distributed deployments over existing physical-control systems.The architecture targets protocols with offline-compilable operations and runtime coordination through QEC-level events.Source: §3.1 · p. 4

3.1.1 Event-Based Protocol Control.

  • START, ABORT, and FINISH events update LCore state and redirect protocol-dependent instruction pointers; attempt tags let LCores discard stale data and retry without waiting for old data to drain.The hierarchy propagates local outcomes to a root, which broadcasts global control events for synchronized transitions.Source: §3.1.1 · p. 5

3.1.2 Logical-to-Physical Control Interface.

  • Leaf LCores map logical instruction entries to backend-specific command-word sequences, separating protocol control from physical-control commands.Each time-synchronized entry waits a specified number of cycles before streaming a command-word range to the PCore.Source: §3.1.2 · p. 5

3.1.3 Configurable Detector Construction.

  • The detector datapath builds each detector at the lowest LCore containing its required measurements, forwarding completed detectors and only residual measurements needed higher in the hierarchy.Kernels select measurement channels, while parallel processing elements apply configurable XOR masks and reuse partial parities in circular registers.Source: §3.1.3 · p. 5

10 repeat

Partial gap estimation uses profiling data to select informative detectors and contract the decoding problem, then runs partial decoding alongside complete decoding so high-confidence attempts can advance early.

3.2 Partial Gap Estimation

  • Offline profiling builds a reduced decoding problem from a detector mask, which runtime decoding uses to estimate the partial gap.The approach targets the classical processing cost of complementary-gap estimation.Source: §3.2 · p. 6

3.2.1 Partial Mask Construction.

  • The Logical Ambiguity Profile selects detectors associated with competing logical explanations, weighting near-degenerate configurations more heavily.It uses the detector support of the configurations’ symmetric difference to localize ambiguity.Source: §3.2.1 · p. 6
  • Structural Closure augments the LAP mask by adding excluded detectors incident to crossing errors when their inclusion reduces structural incompleteness.This avoids indiscriminate expansion while filling interior holes and regularizing the mask boundary.Source: §3.2.1 · pp. 6–7

3.2.2 DEM Contraction.

  • DEM contraction collapses masked-out fault paths into minimum-weight effective faults, then truncates high-weight edges and restores boundary access to preserve retained-syndrome feasibility.The framework covers arbitrary DEMs and has an efficient specialization for matchable decoding graphs.Source: §3.2.2 · pp. 7–8

3.3 Two-Stage Early Escape

  • Two decoder pairs run concurrently: partial decoding accepts an attempt early when its gap exceeds the high-confidence threshold; otherwise, the system waits for the complete gap.Complete decoding finishes in the background, with its correction tracked in the Pauli frame for later logical measurements.Source: §3.3 · p. 8

4.1 Configurable Control Runtime

MagiCFirm compiles cultivation circuits into board-level control hierarchies and evaluates them across monolithic and distributed topologies. Reported results show sub-microsecond post-selection feedback and a small FPGA footprint.

4.1 Configurable Control Runtime

  • Compiled control designs reconstruct Stim detectors with zero mismatches on 1,000 noisy shots per design across monolithic and distributed topologies.Source: §4.1 · p. 8

4.1.1 Control Latency.

  • 334 ns broadcast and 344 ns gap latency stay fixed across six configurations; syndrome delivery spans 403.8–423.6 ns and post-selection feedback stays below 0.78 μs.The configurations use three-level trees containing 35–69 boards.Source: Table 1 · p. 9, §4.1.1 · p. 9

4.1.2 FPGA Implementation.

  • Less than 0.3% of VU19P LUTs are used by the largest LCore, indicating a lightweight footprint for FPGA-based control systems.Source: Table 2 · p. 9, §4.1.2 · p. 9

4.2 Partial-Gap Estimation Ablation

The ablation evaluates partial-gap estimation through mask construction, mask-size sensitivity, and DEM contraction. LAP with structural closure improves gap fidelity, while contraction provides backend-dependent decoding and hardware benefits.

4.2.1 Mask-Construction Strategy.

  • At matched mask sizes, LAP reduces high-side mismatch to 0.6%–0.7%, while closure cuts S(M) by 42%–58% and raises agreement by another 14.1–19.7 points.The comparison uses the complete DEM to exclude contraction effects; Table 3 reports mask-construction results at matched sizes.Source: §4.2.1 · p. 9, Table 3 · p. 9

4.2.2 Mask-Size Sensitivity.

  • At shared K_Q = 250, d_cultiv = 3 reaches P= = 73.4% and P> = 0.6%, versus 33.7% and 5.2% for d_cultiv = 5.The selected K_Q = 250/450 masks retain 32.7%/45.7% of detectors.Source: §4.2.2 · p. 10, Figure 6 · p. 10

4.2.3 Effect of DEM Contraction.

  • Contraction changes P(g_p = g_c) by a median 0.007 percentage points, cuts PyMatching latency by a further 68.4%, and reduces Micro Blossom incremental vertex- and edge-unit footprints by medians of 73.1% and 60.4%.Figure 7 reports decoding-cost ablations across 24 d_cultiv = 3 configurations.Source: §4.2.3 · p. 10, Figure 7 · p. 10

4.3 End-to-End Two-Stage Early Escape Evaluation

The evaluation measures mean wall-clock preparation time per accepted state at matched logical error rate. Two-stage early escape reduces preparation time, and its beneficial operating region depends on code distance, physical error rate, and mask size.

4.3 End-to-End Two-Stage Early Escape Evaluation

  • Preparation time is the mean wall-clock time per accepted state, including failed attempts, with quantum execution, control feedback, and RTL-characterized Micro Blossom latency modeled.LER is measured independently from large-sample gap tables.Source: §4.3 · p. 10

4.3.1 Iso-LER Scaling.

  • Preparation-time savings reach 39.3% as d_escape increases, while savings are 22%–26% through p = 10^-3 and fall to 14.1% at the highest p.Nearly unchanged gate and control time across the sweeps indicates that gap-decoding savings translate into system speedup.Source: Figure 8 · p. 10, §4.3.1 · p. 11

4.3.2 Design-space Exploration and Sensitivity Analy-

  • For d_cultiv = 3, partial decoding benefits down to approximately 6 × 10^-6 LER; halving p lowers the boundary from 7.1 × 10^-6 to 5.5 × 10^-7 at fixed K_Q = 250.Increasing K_Q modestly extends the beneficial region at the cost of longer partial decoding.Source: Figure 9 · p. 11, §4.3.2 · p. 11, Figure 10 · p. 11

4.3.3 Potential System-Level Impact.

  • For a representative 90% source-bound workload, partial gap corresponds to roughly an 11% reduction in application runtime.At LER_cultiv = 2 × 10^-5, the modeled magic-state throughput increase is 13.6%.Source: §4.3.3 · p. 11

5 Future Work

MagiCFirm currently targets statically compiled circuits, with runtime events selecting among precompiled control paths. The paper identifies dynamic circuits and changing device conditions as future extensions, and proposes applying the runtime to other post-selection protocols.

5 Future Work

  • MagiCFirm currently supports statically compiled circuits, with runtime events choosing among precompiled control paths.Source: §5 · p. 11
  • Adaptive syndrome extraction would require richer data-dependent event triggers and conditional microprogram branches.Source: §5 · p. 11
  • Proposed extensions include online DEM updates, per-shot partial-mask adaptation, and applying the detector-driven runtime to other post-selection FTQC protocols.Source: §5 · p. 11

6 Conclusion

MagiCFirm makes magic-state cultivation an end-to-end runtime operation, combining configurable hardware with partial decoding that can advance high-confidence attempts before complete decoding finishes.

  • MagiCFirm combines offline-compiled microprograms with hierarchical event handling and configurable detector construction for end-to-end cultivation.Source: §6 · p. 11
  • DEM contraction builds a compact decoding problem for two-stage early escape alongside complete decoding.Source: §6 · p. 12
  • Evaluation demonstrates low-latency control with a lightweight FPGA footprint and reduced preparation time at matched LER.Source: §6 · p. 12
Loading 2609.29267v1…