Welcome to a centralized, ever-expanding repository of Q# programs built using the Microsoft Quantum Development Kit (QDK). This collection is designed to support a wide range of quantum computing use cases - from randomness and entanglement to advanced simulations and algorithmic experiments.
This repository serves as a modular archive for all .qs files created for learning, experimentation, prototyping, and demonstration. Each file is self-contained and named descriptively to reflect its purpose. Whether you're exploring quantum gates, building custom superposition states, or testing quantum algorithms, you'll find reusable and reproducible code here.
All Q# source files (.qs) are stored in the root directory. Each file is:
- Named to reflect its function or concept (e.g.,
Entangle_two_Qbits.qs,Skewed_Random_Bit_Generator.qs) - Independently executable via the QDK extension in Visual Studio Code
- Written with modularity and clarity in mind
As the repository grows, you may use tags, folders, or naming conventions to organize files by category (e.g., Randomness_, Entanglement_, Grover_, Teleportation_, etc.).
GenerateRandomBit.qs: Quantum random number generator using Hadamard gatesEntangle_two_Qbits.qs: Demonstrates entanglement using Hadamard and CNOTSkewed_Random_Bit_Generator.qs: Creates a biased superposition stateUniformSuperposition_Measurement.qs: 3‑qubit superposition and measurementStepwiseSuperposition_Measurement.qs: Sequential measurement of qubits in superpositionMain.qs: Entry point for executing selected operations
This folder contains Q# programs that generate the four maximally entangled Bell states. Each file demonstrates how to prepare a specific state using Hadamard, Pauli gates, and CNOT operations.
State: |\Phi ^+\rangle =\frac{1}{\sqrt{2}}(|00\rangle +|11\rangle )
Circuit: q1: ──H────■── │ q2: ───────X──
State: |\Phi ^-\rangle =\frac{1}{\sqrt{2}}(|00\rangle -|11\rangle )
Circuit: q1: ──H──Z──■── │ q2: ────────X──
State: |\psi ^+\rangle =\frac{1}{\sqrt{2}}(|01\rangle +|10\rangle )
Circuit: q1: ──H──X──■── │ q2: ───────X──
State: |\psi ^-\rangle =\frac{1}{\sqrt{2}}(|01\rangle -|10\rangle )
Circuit: q1: ──H──Z──X──■── │ q2: ───────────X──
Since this repo uses QDK directly (no .NET wrapper):
- Install QDK
conda install -c microsoft qsharp
- Run in Jupyter Notebook (IQ# kernel):
%load_qsharp BellStates/PhiPlus.qs
%simulate Main- Use
DumpOperation()for textual gate sequences or%tracefor circuit diagrams.
- 🛠️ Install the Microsoft Quantum Development Kit
- 💻 Open any
.qsfile in Visual Studio Code with the Q# extension ▶️ Run the entry point operation using the internal debug console
- 🏷️ Use descriptive filenames for each
.qsfile - 🧩 Keep each operation modular and self-contained
- 📝 Document unusual logic or gate combinations inline
- 📜 Use version control commit messages to track conceptual changes
MIT