← Quantum Store · Guides · Lessons · Glossary · Packages · About · Türkçe
Microsoft Quantum
Microsoft QDK and Q# starter package
Official source: microsoft/qdk
Download ZIP (free)Microsoft Quantum Development Kit: a tested Bell state example written in Q# and run from Python, plus a guide to resource estimation.
What is the Microsoft QDK?
The Quantum Development Kit (QDK) is an open-source package containing Microsoft's quantum programming language Q#, its compiler, simulator and resource estimation tool. Q# is designed for writing quantum algorithms in a hardware-independent, type-safe language.
When to use it
- When you want to write an algorithm in its own language, independent of Python.
- To answer the question "how many physical qubits and how much time does this algorithm need on a fault-tolerant quantum computer?" (resource estimation).
- To learn by practising with the Quantum Katas.
The example in this package
bell_qsharp.py compiles Q# code from within Python and runs it 200 times.
In every run the two qubits give the same result.
Note
The old qsharp Python package is being deprecated; install the qdk package
instead and import it with from qdk import qsharp.
Next steps
- Install the "Azure Quantum Development Kit" extension for VS Code.
- Use
qsharp.estimate(...)to compute the physical resources your own algorithm needs.
Installation and running
pip install qdk
python bell_qsharp.py
Tested with: qdk 1.33.1, Python 3.12.
Official source
- Repository: microsoft/qdk
- Latest release: v1.33.0 — 6 October 2026
- Licence: MIT
- Stars: 1,021
- Default branch commit when the catalogue was built:
7401e10239b3(13 October 2026)
Links
Package contents
bell_qsharp.pyREADME.en.md— this fileREADME.md— the same guide in TurkishLICENSE— the licence of the files in this packageKAYNAK.json— a machine-readable summary of the official sourceUPSTREAM-LICENSE.txt— the licence text of the official projectCITATION.cff— citation information of the official project
Licence
The example code and the guide in this package were written by the Quantum Store editors and are MIT licensed. The project it uses is subject to its own licence (MIT).
Quantum Store — https://hakanerdogan.com/en
Example code
The example shipped in the package, run and checked. Comments and printed messages are in Turkish; the code is the same in any language. Everything is in the ZIP.
bell_qsharp.py
"""Microsoft Quantum Development Kit: Python içinden Q# çalıştır.
Çalıştırma:
pip install qdk
python bell_qsharp.py
"""
from qdk import qsharp
qsharp.eval(
"""
operation Bell() : (Result, Result) {
use (a, b) = (Qubit(), Qubit());
H(a);
CNOT(a, b);
let results = (M(a), M(b));
ResetAll([a, b]);
return results;
}
"""
)
shots = qsharp.run("Bell()", shots=200)
same = sum(1 for a, b in shots if a == b)
print(f"200 çalıştırmadan {same} tanesinde iki kübit aynı sonucu verdi.")
print("İlk 5 sonuç:", shots[:5])
assert same == len(shots)
print("Tamam: Q# Bell durumu doğrulandı.")