Circuit Compiler
Translates logical Clifford+T circuits into fault-tolerant physical gate sequences. Handles magic state distillation and circuit optimization for current noise budgets.
Logical to physical: every gate matters
The Clifford group of gates — Hadamard, S, CNOT — can be implemented natively within the surface code using transversal operations. They are inherently fault-tolerant at the logical level. The T-gate (π/8 rotation) cannot be implemented transversally on the surface code. It requires magic state distillation: a protocol that prepares a high-fidelity |T⟩ = |0⟩ + e^{iπ/4}|1⟩ resource state by distilling many noisy T-gate preparations.
QECSync's compiler analyzes the T-gate count in the input circuit and schedules the appropriate number of magic state distillation factories. Factory count, code distance, and qubit overhead are co-optimized based on the target logical error budget and available physical qubit count.
The compiler also applies circuit-level optimizations specific to the surface code: gate commutation to reduce T-count via Clifford+T identity rules, lattice surgery scheduling to minimize ancilla requirements, and surface code patch routing to minimize logical qubit travel time.
Submit a circuit for compilation
The QECSync Python SDK accepts logical circuits in OpenQASM 3 format or via our native gate builder. The compiler returns a compiled fault-tolerant schedule with resource estimates.
Quickstart Guide →from qecsync import Compiler, CircuitSpec
# Define logical circuit
circ = CircuitSpec.from_qasm3("teleport_t.qasm")
# Compile for target device
result = Compiler(device=device).compile(
circuit=circ,
code_distance=5,
target_logical_error=1e-6
)
# Resource estimates
print(result.t_gate_count) # 12
print(result.physical_qubits) # 441
print(result.distillation_rounds) # 3