# Surface-Memory Stim Export [`gadgets/02_stim_emission.py`](../../../../examples/gadgets/02_stim_emission.py) exports a surface-code memory experiment as a Stim circuit with detectors, a logical observable, and data noise. It can optionally sample the circuit. Follow the [Stim emission tutorial](../stim-emission.md) for a detailed walkthrough. ```{literalinclude} ../../../../examples/gadgets/02_stim_emission.py :language: python ``` [Back to examples](index.md)