Skip to content

Tutorial 00 Quantum Fourier Transform

Mohammadreza Khellat edited this page Dec 16, 2025 · 1 revision

Tutorial 00: Quantum Fourier Transform (Abelian)

A comprehensive review of quantum Fourier transform over finite Abelian groups with use cases in phase estimation and Hadamard test.


Overview

This tutorial provides a thorough introduction to the mathematical foundations of quantum Fourier transform (QFT) over finite Abelian groups. You'll learn how QFT serves as a linear transformation between function spaces and explore practical applications in phase estimation and Hadamard test scenarios.

Location: quantum_fourier_transform_abelian/
Notebook: qft_abelian_qpe_hadamard.ipynb
Framework: Classiq
Difficulty: 🟢 Beginner
Estimated Time: 2 hours


Learning Objectives

By completing this tutorial, you will be able to:

  1. Understand the mathematical foundations of QFT over finite Abelian groups
  2. Recognize the relationship between $\mathbb{C}[G]$ and $\mathbb{C}[\widehat{G}]$ vector spaces
  3. Implement QFT circuits for phase estimation applications
  4. Apply QFT in Hadamard test scenarios
  5. Design quantum circuits using Classiq for QFT operations

Prerequisites

Required Knowledge

  • Linear Algebra:

    • Vector spaces and linear transformations
    • Inner products and orthogonality
    • Eigenvalues and eigenvectors
  • Complex Numbers:

    • Complex exponentials: $e^{i\theta} = \cos\theta + i\sin\theta$
    • Complex arithmetic operations
  • Quantum Computing Basics:

    • Qubits and quantum states
    • Quantum gates (Hadamard, phase gates)
    • Quantum measurement

Recommended Background

  • Group Theory: Basic understanding of groups and Abelian groups (helpful but not required)
  • Fourier Transforms: Familiarity with classical Fourier transforms (conceptual understanding)

Prior Tutorials

  • None required - this is a foundational tutorial

Theory

Mathematical Foundations

The main focus of this tutorial is a review of the mathematical foundations of quantum Fourier transform (for Abelian groups) as a linear transformation between:

  • $\mathbb{C}[G]$: The vector space of complex-valued functions $f : G \to \mathbb{C}$ where $G$ is a finite Abelian group
  • $\mathbb{C}[\widehat{G}]$: The vector space of complex-valued functions $\widehat{f} : \widehat{G} \to \mathbb{C}$ where $\widehat{G}$ is the complete set of characters of $G$

Both are vector spaces over the field of complex numbers $\mathbb{C}$.

Key Concepts

  1. Finite Abelian Groups ($G$):

    • A group where the operation is commutative
    • Examples: $\mathbb{Z}_n$ (cyclic groups), direct products of cyclic groups
  2. Characters ($\widehat{G}$):

    • Group homomorphisms from $G$ to the unit circle
    • Form an orthonormal basis for functions on $G$
  3. Quantum Fourier Transform:

    • Maps quantum states representing functions on $G$ to states representing functions on $\widehat{G}$
    • Enables efficient phase estimation and other quantum algorithms

Applications Covered

  • Phase Estimation: Using QFT to estimate eigenvalues of unitary operators
  • Hadamard Test: Measuring expectation values using QFT-based techniques

Implementation

High-Level Approach

The quantum circuit for the Hadamard test example is designed to be simple and self-explanatory. The implementation demonstrates:

  1. State Preparation: Setting up the initial quantum state
  2. QFT Application: Applying the quantum Fourier transform
  3. Measurement: Extracting phase information through measurement

Key Components

  • Quantum Circuit Design: Using Classiq to construct QFT circuits
  • Phase Estimation: Implementing phase estimation algorithms
  • Hadamard Test: Applying QFT in Hadamard test scenarios

Software Architecture

The notebook uses Classiq's high-level quantum programming interface to:

  • Define quantum functions
  • Synthesize optimized quantum circuits
  • Execute circuits and analyze results

Software Requirements

The following Python packages are required:

  • numpy - Numerical operations and array handling
  • matplotlib - Plotting and visualization
  • classiq - Quantum circuit design and synthesis

Installation:

All packages are included in the top-level requirements.txt. If you have set up the base environment as described in the main README, no additional installation is needed.

# If not already installed
pip install numpy matplotlib classiq

Running the Tutorial

Step 1: Navigate to the Tutorial Directory

cd quantum_fourier_transform_abelian

Step 2: Open the Notebook

jupyter notebook qft_abelian_qpe_hadamard.ipynb

Or in JupyterLab:

jupyter lab qft_abelian_qpe_hadamard.ipynb

Step 3: Execute the Notebook

  1. Read through the theory sections to understand the mathematical foundations
  2. Run cells sequentially to see the implementation
  3. Observe the outputs including plots and measurement results
  4. Experiment with parameters to deepen understanding

Step 4: Generate Quantum Model (Optional)

If you want to save the quantum circuit as a model file:

  • Execute the cell containing write_qmod(create_model(main), "qft-expvalue")
  • This will generate qft-expvalue.qmod in the current directory

Expected Results

Outputs

  1. Plots:

    • Expectation values visualization
    • Measurement results showing phase information
    • QFT transformation results
  2. Quantum Model File (Optional):

    • qft-expvalue.qmod - Quantum model file (generated if the write_qmod cell is executed)
  3. Understanding:

    • How QFT transforms quantum states
    • Relationship between time and frequency domains in quantum context
    • Application of QFT in phase estimation

Key Takeaways

  • QFT is a fundamental quantum algorithm with wide applications
  • Mathematical foundations connect group theory to quantum computing
  • QFT enables efficient phase estimation and related algorithms
  • Classiq provides high-level tools for QFT circuit design

Troubleshooting

Issue: Classiq Import Errors

Solution:

  • Ensure Classiq is installed: pip install classiq
  • Check Classiq version compatibility
  • Some features may require API authentication (see Classiq documentation)

Issue: Plots Not Displaying

Solution:

  • Ensure matplotlib is installed: pip install matplotlib
  • Use %matplotlib inline in Jupyter if plots don't appear
  • Check that cells executed successfully

Issue: Quantum Model Not Generated

Solution:

  • Ensure you have write permissions in the directory
  • Check that the write_qmod cell executed without errors
  • Verify Classiq authentication if required

Issue: Mathematical Notation Unclear

Solution:

  • Review the theory section carefully
  • Refer to linear algebra and group theory resources
  • See Academic Resources for related papers

Further Reading

Related Papers

  • Group Theory and Quantum Computing: See papers in 6.B/ directory
  • Phase Estimation: Original quantum phase estimation algorithm papers
  • Fourier Transforms: Classical and quantum Fourier transform literature

Related Tutorials

  • Tutorial 02 - Quantum Walk: Uses QFT concepts in graph algorithms
  • Tutorial 05 - Coupled Harmonic Oscillators: Applies similar mathematical foundations

External Resources


Contributors

  • Mohammadreza Khellat - Primary author and maintainer

For questions or contributions, see the Contributing Guide.


Summary

This tutorial provides a comprehensive introduction to quantum Fourier transform over finite Abelian groups. You've learned:

✅ Mathematical foundations of QFT
✅ Relationship between function spaces $\mathbb{C}[G]$ and $\mathbb{C}[\widehat{G}]$
✅ Practical applications in phase estimation and Hadamard test
✅ Implementation using Classiq framework

Next Steps:

  • Try modifying parameters to see how QFT behaves
  • Explore Tutorial 02 (Quantum Walk) which builds on these concepts
  • Review Academic Resources for deeper theoretical understanding

Return to: Tutorial Catalog | Home

Clone this wiki locally