A collection of various interesting Q# examples.
| Sample Name |
Description |
Blog Post |
Type |
| 💻 Christmas Tree |
📝 Decorating a Christmas tree with a quantum computer. Uses both Q# and Qiskit (Aer) simulators. |
Link |
Executable |
| 💻 Quokka |
📝 A Jupyter notebook showing how to run Q# code on a Quokka quantum simulator. |
Link |
Jupyter Notebook |
| 💻 Certified deletion |
📝 Q# sample illustrating Quantum encryption with certified deletion from Anne Broadbent and Rabib Islam. |
Link |
Executable |
| 💻 Elitzur-Vaidman tester |
📝 Elitzur-Vaidman bomb tester thought experiment, as a playful Q# Santa-themed sample |
Link |
Executable |
| 💻 Hidden shift |
📝 Hidden shift problem |
N/A |
Executable |
| 💻 Simon's algorithm |
📝 A toy demonstration of Simon's algorithm |
N/A |
Executable |
| 💻 Certified randomness amplification |
📝 Q# sample illustrating Certified randomness amplification, Liu et al, arXiv:2511.03686, 2025. |
Link |
Jupyter Notebook |
| 💻 Composite qDRIFT |
📝 Q# implementation of the Hagan-Wiebe composite Trotter/qDRIFT channel, used to measure the cost objective of Optimal Lower Bounds for Hamiltonian Simulation, Zlokapa, Allen and Harrow, arXiv:2607.19852, 2026, on power-law Hamiltonians with an exact channel evaluation. |
Link |
Executable |
| 💻 Stabilizer cloning |
📝 Bell difference sampling learner for stabilizer states on the QDK stabilizer simulator (up to 512 qubits), measuring the Θ(n) sample complexity of cloning from Cloning is as Hard as Learning for Stabilizer States, Bansal, Caro and Mahajan, arXiv:2604.15269, 2026. Needs the qdk package (see its README). |
Link |
Executable |
| Sample Name |
Description |
Blog Post |
Type |
| 💻 Cat state with noise |
📝 A simple 8-qubit GHZ state, with a basic noise model and, optionally, qubit loss, illustrating their impact on measurement. Run with 1000 shots. |
N/A |
Executable |
| 💻 Bit flip error correction |
📝 Bit flip error correction samples (auxiliary qubit-based syndrome extraction, automatic correction with auxiliary qubits and direct parity measurement) |
N/A |
Executable |
| 💻 Phase flip error correction |
📝 Phase flip error correction samples (auxiliary qubit-based syndrome extraction, automatic correction with auxiliary qubits and direct parity measurement) |
N/A |
Executable |
| 💻 Magic rebirth |
📝 Q# demo of Sudden death of entanglement, rebirth of magic, Cao, arXiv:2605.22603, 2026: amplitude damping of α|0ⁿ⟩+β|1ⁿ⟩ as an explicit Stinespring dilation, the magic-death, entanglement-death and magic-rebirth thresholds for n up to 8 with γₑ + γ₊ = 1 read off the environment register, a two-setting magic witness from shots, and parity-syndrome extraction of the reborn magic. Needs the qdk package. |
N/A |
Executable |
| 💻 Steane rotations |
📝 Q# demo of Continuous-angle logical rotations in the Steane code, Huang, Zhu, Ippoliti, Monroe and Gullans, arXiv:2608.20676, 2026: a transversal Rz(θ) on the [[7,1,3]] code followed by X-syndrome extraction and correction is a logical Rz(φₛ) whose angle is set by the syndrome. The exact per-syndrome channel from Q# state dumps (angle, dephasing and probability against the paper's closed forms), logical Ramsey fringes and process tomography from shots, and the two-round +θ/−θ cancellation. Needs the qdk package. |
N/A |
Executable |
You can find more Q# samples in my Introduction to Quantum Computing with Q# and QDK book repository.