Compute Fault-Tolerant Resources
compute_fault_tolerant_resourcesGiven an algorithm stated as (numLogicalQubits, tCount) and a physical error rate (or hardwareId), derive the full surface-code + magic-state-distillation footprint from the general laws of the Litinski lattice-surgery cost model (no per-scenario constants): distillation factory choice, tile layout, required code distance, total physical qubits, and wall-clock time. Results are reported under TWO published logical-error fits (conservative + optimistic) because they disagree by 13-268x (d=7 to d=25) - always state both. Returns an explicit infeasible block when no cataloged factory or code distance can satisfy the error budget. Computes numbers only: comparing against classical alternatives and concluding "should this run on a quantum computer" stays with you, the calling agent (state the caveats when you do).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tCount | Yes | Total number of T gates (magic states consumed). Convention: state Toffoli-counted algorithms in T gates before calling (1 Toffoli ≈ 4–7 T depending on decomposition). | |
| dataBlock | No | Data-block layout (Litinski §2): compact = fewest qubits, fast = shortest time per T gate. | compact |
| hardwareId | No | Alias for qubitErrorRate: resolves to the error rate of a SOTA hardware entry. | |
| qubitErrorRate | No | Physical 2-qubit error rate p in (0, 0.1]. Supply exactly one of qubitErrorRate or hardwareId. | |
| cycleTimeSeconds | No | Surface-code cycle time in seconds. Default 1 µs (Litinski convention; Google 2024 measured 1.1 µs on superconducting hardware). Trapped-ion/neutral-atom cycles are orders of magnitude slower. | |
| numLogicalQubits | Yes | Number of logical data qubits the algorithm needs. | |
| targetSuccessProbability | No | Target end-to-end success probability. The failure budget (1 − target) is split evenly between T-state error and logical (memory/surgery) error, matching Litinski §4. |