Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Projects

A collection of quantum computing notebooks built with PennyLane, exploring fundamental quantum algorithms from first principles.


Repository Structure

Quantum_Projects/
├── Quantum Phase Estimation/
│   └── qpe.ipynb           # Quantum Phase Estimation algorithm
├── Quantum_Fourier_Transform/
│   └── qft.ipynb           # Quantum Fourier Transform (QFT)
├── requirements.txt
└── README.md

Notebooks

1. Quantum Phase Estimation (QPE)

The Quantum Phase Estimation algorithm is a cornerstone of quantum computing. Given a unitary operator U and one of its eigenstates |ψ⟩, QPE estimates the phase φ such that:

U|ψ⟩ = e^(i·2π·φ)|ψ⟩

What this notebook covers:

  • Theory behind QPE and its role in algorithms like Shor's and HHL
  • Circuit construction using PennyLane's ControlledSequence and adjoint QFT
  • Demonstration with a phase-shift unitary: U = PhaseShift(2π/5), so the true phase is φ = 0.2
  • Probability distribution visualization highlighting the peak at the correct phase

Key circuit components:

Block Role
Hadamard layer Create superposition on estimation wires
Controlled-U powers Phase kickback encoding
Inverse QFT Convert phase → computational basis

2. Quantum Fourier Transform (QFT)

The Quantum Fourier Transform is the quantum analogue of the classical Discrete Fourier Transform (DFT). It is a key subroutine in many quantum algorithms, including Shor's algorithm and QPE.

What this notebook covers:

  • Mathematical relationship between QFT and the classical DFT
  • Comparison of QFT matrix vs. DFT matrix (they are equal!)
  • Circuit decomposition using Hadamard and controlled-phase gates
  • Forward QFT transforming a computational basis state
  • Inverse QFT: verifying the round-trip restores the original state

Getting Started

Prerequisites

  • Python 3.9+
  • pip

Installation

# Clone the repository
git clone https://github.com/<your-username>/Quantum_Projects.git
cd Quantum_Projects

# Create and activate a virtual environment (recommended)
python -m venv .venv
.venv\Scripts\activate        # Windows
source .venv/bin/activate   # macOS / Linux

# Install dependencies
pip install -r requirements.txt

Running the Notebooks

# Launch Jupyter
jupyter notebook

Then open any .ipynb file from the Jupyter file browser and run cells top-to-bottom (Shift+Enter).

About

A collection of PennyLane notebooks exploring the mathematical foundations and circuit implementations of fundamental quantum algorithms, including QFT and QPE, from first principles.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages