liveBook · Manning

Raised cosine distribution

As explained in Building Quantum Software with Python

A raised cosine distribution is a bounded continuous probability distribution whose density follows a shifted and scaled cosine curve over a finite interval.

A raised cosine distribution is a bounded continuous distribution whose density follows a shifted, scaled cosine curve on [μ−s, μ+s] and vanishes outside that interval. It approximates the normal distribution when long tails can be ignored. section 8.4.1

Quantum state preparation turns the distribution into a reusable Fourier-based pattern:

  • Encode two Fourier coefficients into the amplitudes associated with outcomes 0 and 2ⁿ−1. section 8.4.1
  • Apply the quantum Fourier transform to the qubits in reverse order without swaps. section 8.4.1
  • Measure probabilities matching the discretized raised cosine; for s = 2ⁿ⁻¹, the discrete probabilities can be checked against equivalent cosine-squared expressions. section 8.4.1

Three-qubit encoding

For n = 3, N = 8, and μ = 3.25, construct a circuit with a Hadamard gate, a phase rotation of −2πμ/N, and a reversed, swap-free QFT. Running it produces amplitudes proportional to cos((k−μ)π/N) with a phase factor; their squared magnitudes match the raised cosine probabilities. section 8.4.1

Figure 8.29 The raised cosine probability density function
figure

Use the density plot to see the finite support and cosine-shaped profile before examining its quantum encoding. section 8.4.1

How Building Quantum Software with Python covers it

How deep it goes
Explains finite support, Fourier-coefficient encoding, circuit construction, and probability checks, while omitting coefficient-derivation details.
Examples
Demonstrates three-qubit states, varying μ values, amplitude formulas, probability identities, and executable circuit assertions.
What it assumes
Assumes quantum registers, circuit gates, amplitudes, and the quantum Fourier transform, while supplying the raised cosine encoding pattern.
What you can do after
Build it from scratch as a quantum circuit and verify its amplitudes and measurement probabilities against cosine formulas.
How it connects
Connects probability density functions with normal distribution, digital signal processing, Fourier coefficients, and quantum Fourier transform.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Quantum Software with Python. The section links point to the parts of the book it draws on.