Overview

8 Using the quantum Fourier transform

This chapter shows how the quantum Fourier transform (QFT) and its inverse (IQFT) are used both to read out periodic structure encoded in quantum states and to efficiently prepare useful probability distributions. It connects interference patterns familiar from physics and digital signal processing to quantum computation, highlighting the discrete sinc distribution as the characteristic signature that emerges when phase information is converted into measurable magnitudes. The material motivates these tools for core tasks such as frequency extraction, sampling from structured distributions, and as building blocks for algorithms like quantum phase estimation and number-oriented applications in optimization.

The chapter first encodes a complex sinusoid (a geometric sequence state) on n qubits by applying Hadamards followed by phase rotations with angles that double across qubits, thereby embedding a frequency in relative phases. Applying the IQFT converts phase differences into magnitude differences whose envelope follows a discrete sinc pattern: integer frequencies collapse to a single outcome, while non-integers spread probability around the nearest integers, yielding what the authors call phased discrete sinc states. Several equivalent closed forms for these amplitudes are given (e.g., product-of-cosines and a sinc-ratio), periodicity is noted modulo 2^n, and a qubit-reversed implementation is provided to avoid final swaps without changing the resulting distribution.

To build intuition, the same discrete sinc probabilities are recast as a sequence of coin tosses with step-dependent biases, revealing a recursive, digit-by-digit view of the distribution. The chapter then leverages the QFT for state preparation: by seeding a few well-chosen Fourier coefficients and applying a QFT (in reversed order, without swaps), one can encode trigonometric distributions in the measurement probabilities. Examples include a raised-cosine distribution and a sin^4-based distribution, both of which serve as practical, tunable approximations to bell-shaped (normal-like) densities. These constructions illustrate how Fourier-domain design enables compact, efficient quantum circuits for sampling and downstream algorithmic use.

A dependency diagram of concepts covered in this chapter.
CH08 F01 gonciulea
The diffraction pattern on a screen resulting from a single-slit experiment.
CH08 F02 gonciulea
An example plot of diffraction intensity based on a diffraction pattern where the x-axis is the distance from the slit.
CH08 F03 gonciulea
Plot of \(\text{sincd}_3\) for \(-8 \le x \le 8\).
CH08 F04 gonciulea
Table 8.1 An \(n\)-qubit geometric sequence state for an angle \(\theta\), where \(0 \le k < 2^n\).
CH08 T01 gonciulea
The state tables of a three-qubit state after applying a Hadamard gate to each qubit, starting with the default state.
CH08 F05 gonciulea
The state tables before and after applying a phase gate to target qubit 0 with angle \(\theta = \frac{\pi}{3}\).
CH08 F06 gonciulea
The state tables before and after applying a phase gate to target qubit 1 with angle \(2 \theta = \frac{2\pi}{3}\).
CH08 F07 gonciulea
The state tables before and after applying a phase gate to target qubit 2 with angle \(4 \theta = \frac{4\pi}{3}\).
CH08 F08 gonciulea
A tree diagram representation of the encoding pattern for a geometric sequence state with \(n = 3\) qubits and an angle \(\frac{\pi}{3}\).
CH08 F09 gonciulea
In a geometric sequence state with \(n\)-qubits and an angle \(\theta\), the amplitude corresponding to each outcome \(0 \le k < 2^n\) is the product of the factor for the target qubit digit in the binary form of the outcomes.
CH08 F10 gonciulea
The encoding of a geometric sequence state with \(n = 3\) qubits and angle \(\theta = 4\frac{2\pi}{2^n} = \pi\), starting with the default state.
CH08 F11 gonciulea
The state tables before and after applying the IQFT to the geometric sequence state with \(n = 3\) qubits and angle \(\theta = 4\frac{2\pi}{2^n} = \pi\).
CH08 F12 gonciulea
The encoding of a geometric sequence state with \(n = 3\) qubits and an angle \(\theta = 4.7\frac{2\pi}{2^n}\), starting with the default state.
CH08 F13 gonciulea
The state tables before and after applying the IQFT to the geometric sequence state with \(n = 3\) qubits and an angle \(\theta = 4.7\frac{2\pi}{2^n}\).
CH08 F14 gonciulea
The amplitude pattern for the encoding of \(v = 4.7\) in a three-qubit state.
CH08 F15 gonciulea
The amplitude pattern for the encoding of \(v = 4.3\) in a three-qubit state.
CH08 F16 gonciulea
Table 8.2 The general form of a phased discrete sinc state with \(n\)-qubits, where \(0 \le k < 2^n\), and an encoded frequency \(v\), where \(0 \le v < 2^n\).
CH08 T02 gonciulea
Table 8.3 The general form of a phased discrete sinc state with \(n\)-qubits, where \(0 \le k < 2^n\), and an encoded frequency \(v\), where \(0 \le v < 2^n\).
CH08 T03 gonciulea
Table 8.4 The general form of a phased discrete sinc quantum state with \(n\) qubits, where \(0 \le k < 2^n\), and an encoded frequency \(v\), where \(0 \le v < 2^n\).
CH08 T04 gonciulea
Encoding a geometric sequence state using the reverse index order with \(n = 3\) qubits and an angle \(\theta = 4\frac{2\pi}{2^n} = \pi\).
CH08 F17 gonciulea
The state tables before and after applying the IQFT (without swaps).
CH08 F18 gonciulea
The encoding of a geometric sequence state using the reverse index order with \(n = 3\) qubits and angle \(\theta = 4.7\frac{2\pi}{2^n}\).
CH08 F19 gonciulea
The state tables before and after applying the IQFT (without swaps).
CH08 F20 gonciulea
The probabilities of getting a 0 or 1 at each of the three tosses.
CH08 F21 gonciulea
Frequency of outcomes and discrete sinc probability distribution for \(v = 4.7\) and \(n = 1\), \(n = 2\), and \(n = 3\). Note that for \(n = 1\) and \(n = 2\) the actual encoded frequency is 0.7.
CH08 F22 gonciulea
Frequency of outcomes and discrete sinc probability distribution for \(v = 4.5\) and \(n = 1\), \(n = 2\), and \(n = 3\). Note that for \(n = 1\) and \(n = 2\) the actual encoded frequency is 0.5.
CH08 F23 gonciulea
The raised cosine probability density function.
CH08 F25 gonciulea
Encoding the starting frequencies for the raised cosine in the amplitudes of a three-qubit quantum state.
CH08 F26 gonciulea
Applying a QFT to the qubits in a three-qubit state in reverse order (without swaps).
CH08 F27 gonciulea
The general state tables for encoding the raised cosine probability density function for \(\mu = s = 2^{n - 1}\) in a quantum state.
CH08 F28 gonciulea
The general state tables for encoding the raised cosine probability density function in a quantum state.
CH08 F29 gonciulea
Examples of encoding the raised cosine probability density function in a three-qubit quantum state with varying \(\mu\) values.
CH08 F30 gonciulea
The general state tables for encoding three starting frequencies in a quantum state followed by a QFT.
CH08 F31 gonciulea
Encoding three starting frequencies in the amplitudes of a three-qubit quantum state.
CH08 F32 gonciulea
Applying a QFT to the qubits in a three-qubit quantum state in reverse order (without swaps).
CH08 F33 gonciulea
CH08 T02 gonciulea
CH08 T03 gonciulea
CH08 T04 gonciulea

Summary

  • The discrete sinc function comes from the sinc function, which is very important in the field of digital signal processing.
  • The discrete sinc function also appears in quantum computing. Specifically, when we encode a frequency value or angle in a quantum state and then apply the IQFT, the magnitudes of the amplitudes of the resulting state match the discrete sinc function. We call a state with this pattern a phased discrete sinc state.
  • We can express the general form of a phased discrete sinc state with \(n\) qubits, outcomes \(0 \le k < 2^n\), and an encoding frequency value \(v\), using the state tables below.
CH08 T02 gonciulea
CH08 T03 gonciulea
CH08 T04 gonciulea
  • We can use the phased discrete sinc state to estimate the encoded frequency value, \(v\). If \(v\) is an integer, the magnitude of the amplitude corresponding to that integer will be 1, and the rest will be 0. If \(v\) is a non-integer, it will lie between the outcomes corresponding to the top two largest magnitudes.
  • Another useful application of the QFT is to encode certain probability distributions in quantum states. The normal distribution is especially difficult to encode in a quantum state, but we can use other trigonometric distributions as close approximations for the normal.
  • To encode a trigonometric function like the raised cosine or \(\sin^4\) in a quantum state, we encode well-chosen starting frequencies derived from the Fourier coefficients of the function into the phase of the quantum state and then apply the QFT.

FAQ

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Building Quantum Software with Python ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Building Quantum Software with Python ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Building Quantum Software with Python ebook for free