Skip to main content
QUICK REVIEW

[Paper Review] Five Quantum Algorithms Using Quipper

Safat Siddiqui, Mohammed Jahirul Islam|arXiv (Cornell University)|Jun 17, 2014
Quantum Computing Algorithms and Architecture6 references4 citations
TL;DR

This paper presents the first implementation of five foundational quantum algorithms—Deutsch’s, Deutsch-Jozsa’s, Simon’s, Grover’s, and Shor’s—using Quipper, a functional quantum programming language. It demonstrates Quipper’s usability and scalability for quantum algorithm development, including custom implementations of 8×8 and 16×16 unitary matrix constructors and oracles for Shor’s algorithm, with testing via the Quipper simulator to validate correctness.

ABSTRACT

Quipper is a recently released quantum programming language. In this report, we explore Quipper's programming framework by implementing the Deutsch's, Deutsch-Jozsa's, Simon's, Grover's, and Shor's factoring algorithms. It will help new quantum programmers in an instructive manner. We choose Quipper especially for its usability and scalability though it's an ongoing development project. We have also provided introductory concepts of Quipper and prerequisite backgrounds of the algorithms for readers' convenience. We also have written codes for oracles (black boxes or functions) for individual algorithms and tested some of them using the Quipper simulator to prove correctness and introduce the readers with the functionality. As Quipper 0.5 does not include more than \ensuremath{4 imes 4} matrix constructors for Unitary operators, we have also implemented \ensuremath{8 imes 8} and \ensuremath{16 imes 16} matrix constructors.

Motivation & Objective

  • To demonstrate the practical usability and scalability of Quipper for implementing major quantum algorithms.
  • To provide a pedagogical framework for new quantum programmers through step-by-step implementation of core quantum algorithms.
  • To extend Quipper’s capabilities by implementing 8×8 and 16×16 unitary matrix constructors, as Quipper 0.5 lacked support beyond 4×4.
  • To develop and test custom oracles (black boxes) for Shor’s algorithm using the Quipper simulator for correctness verification.
  • To bridge the gap between quantum algorithm theory and future physical implementation by generating executable, testable Quipper code.

Proposed method

  • Implementing each algorithm using Quipper’s functional quantum programming framework, leveraging Haskell’s type system and higher-order functions.
  • Using QuipperLib.QFT module to apply the inverse Quantum Fourier Transform (QFT†) in Shor’s algorithm via the qft_big_endian function.
  • Defining oracles as first-class values in Quipper using the Oracle data type, parameterized by input and output qubit counts and a function mapping qubit pairs to quantum circuits.
  • Creating specialized oracles for Shor’s algorithm with modular exponentiation logic, such as mod15_base7_oracle (a=7, N=15) and mod21_base20_oracle (a=20, N=21), using controlled-NOT and controlled-controlled-NOT gates.
  • Testing oracle correctness via simulation using the Quipper simulator, with measurement and circuit execution phases emulated on classical hardware.
  • Extending Quipper’s capabilities by implementing custom 8×8 and 16×16 unitary matrix constructors to support larger-scale quantum circuits.

Experimental results

Research questions

  • RQ1Can Quipper effectively express and simulate major quantum algorithms such as Shor’s factoring and Grover’s search in a scalable and reusable way?
  • RQ2How can oracles for Shor’s algorithm be implemented in Quipper with correct modular arithmetic logic using controlled quantum gates?
  • RQ3To what extent does Quipper’s current limitation in matrix constructor size (≤4×4 in Quipper 0.5) hinder the implementation of larger quantum circuits?
  • RQ4Can custom 8×8 and 16×16 unitary constructors be successfully implemented in Quipper to overcome its native limitations?
  • RQ5How effective is the Quipper simulator in validating the correctness of quantum circuit implementations before physical execution?

Key findings

  • The paper successfully implements all five major quantum algorithms—Deutsch’s, Deutsch-Jozsa’s, Simon’s, Grover’s, and Shor’s—using Quipper, demonstrating its viability for quantum algorithm prototyping.
  • Custom 8×8 and 16×16 unitary matrix constructors were implemented to extend Quipper’s capability beyond its native 4×4 limit, enabling larger-scale circuit construction.
  • Oracles for Shor’s algorithm were correctly implemented for two cases: f_{(7,15)} and f_{(20,21)}, using controlled-NOT and multi-controlled-NOT operations to encode modular exponentiation.
  • The Quipper simulator successfully validated the correctness of the oracle implementations through classical simulation of measurement outcomes and circuit behavior.
  • The implementation of Shor’s algorithm in Quipper includes full circuit generation with Hadamard gates, oracle application, QFT†, and measurement, forming a complete, testable quantum subroutine.
  • The work establishes a pedagogical pipeline from basic quantum circuits to complex algorithms, enabling new learners to transition from theory to executable code in a structured way.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.