# T-State Distillation [`standalone/07_magic_state_distillation.py`](../../../../examples/standalone/07_magic_state_distillation.py) builds a 15-to-1 T-state distillation protocol with postselection. It teaches resource requests, resource-backed rotations, and static estimation. The later [T-factory evaluation example](t-factory-evaluation.md) supplies explicit raw-state preparation and gate teleportation to simulate distillation. ```{literalinclude} ../../../../examples/standalone/07_magic_state_distillation.py :language: python ``` [Back to examples](index.md)