  Quantum error correction is an essential component for practical quantum
computing on noisy quantum hardware. However, logical operations on
error-corrected qubits require a significant resource overhead, especially for
high-precision and high-fidelity non-Clifford rotation gates. To address this
issue, we propose a postselection-based algorithm to efficiently prepare
resource states for gate teleportation. Our algorithm achieves fault tolerance,
demonstrating the exponential suppression of logical errors with code distance,
and it applies to any stabilizer codes. We provide analytical derivations and
numerical simulations of the fidelity and success probability of the algorithm.
We benchmark the method on surface code and show a factor of 100 to 10,000
reduction in space-time overhead compared to existing methods. Overall, our
approach presents a promising path to reducing the resource requirement for
quantum algorithms on error-corrected and noisy intermediate-scale quantum
computers.
