All publications & toolsVisualization of the Quantum Fourier Transform Using a Quantum Computer Simulator
Research2003QIP

Visualization of the Quantum Fourier Transform Using a Quantum Computer Simulator

Shows simulated quantum Fourier transform steps as a grayscale grid, tracking how measurement probabilities move across basis states.

1 publication

Visualization labels

03 / Visualization

Visual representations

01Publication · 2003

Visualization of the Quantum Fourier Transform Using a Quantum Computer Simulator

Ioannis G. Karafyllidis

The quantum Fourier transform (QFT) is a key subroutine of quantum algorithms for factoring and simulation and is the heart of the hidden-subgroup problem, the solution of which is expected to lead to the development of new quantum algorithms. The QFT acts on the Hilbert space and alters the quantum mechanical phases and probability amplitudes. Unlike its classical counterpart its schematic representation and visualization are very difficult. The aim of this work is to develop a schematic representation and visualization of the QFT by running it on a quantum computer simulator which has been constructed in the framework of this research. Base states, superpositions of base states and entangled states are transformed and the corresponding schematic representations are presented. The visualization of the QFT presented here and the quantum computer simulator developed for this purpose may become a useful tool for introducing the QFT to students and researches without a strong background in quantum mechanics or Fourier analysis.

From the survey collection

Visualization of the Quantum Fourier Transform Using a Quantum Computer Simulator

Background and motivation

The quantum Fourier transform changes the complex amplitudes of a quantum state and is a component of algorithms for factoring, quantum simulation, and hidden-subgroup problems. Karafyllidis situates this work within established quantum algorithms, mathematical treatments of the QFT, and an earlier nuclear magnetic resonance implementation. The paper also connects the need to understand quantum computations with prospective applications in physical modeling, pattern recognition, and signal processing. These references establish the importance of the transform, but the paper does not conduct a comparative survey of existing visualization systems.

The problem is explaining an already established operation rather than defining a new Fourier transform. A circuit diagram specifies which gates act on which qubits, while the mathematical definition specifies changes to complex amplitudes; neither by itself gives a compact picture of how measurement probabilities develop throughout the calculation. The author therefore develops a classical simulator that couples gate-by-gate state evolution with a grayscale history of the register's probabilities. The intended audience includes students and researchers without a strong background in quantum mechanics or Fourier analysis. Educational usefulness and support for algorithm design are motivations and anticipated applications, rather than benefits established by a user evaluation.

Simulator and visual representation

The simulator's pseudocode in Figure 1 takes the number of qubits, the number of computation steps, an initial register state, and a matrix describing the gates at each step. The documented input procedure starts from a register specified by binary values; the superposed and entangled inputs used in later examples are prepared by applying gates before the QFT. The simulator forms tensor products for the initial register and the operators applied at a step, updates the register state, and repeats the calculation through the gate sequence. It produces numerical probability amplitudes and measurement probabilities as well as the graphical history. Although the author describes the simulator as supporting any quantum circuit, the reported examples establish its use for the particular Deutsch and QFT circuits shown in the paper.

In the graphical output, columns represent successive computation steps and rows represent computational basis states labeled by their decimal indices. The first column records the initial state, so gate operation number one appears in the second column. Each cell encodes the probability of measuring that basis state at that stage: black means probability one, white means zero, and intermediate gray levels represent intermediate probabilities. The adjacent legend uses a fixed scale from zero to one. Reading across a row follows one basis state's probability through the computation, while reading down a column gives the entire distribution at one stage. These are simulation outputs paired with circuit schematics, not screenshots of an interactive circuit editor. The paper describes entering circuit data and inspecting the resulting output, but does not document interactions such as brushing, filtering, or manipulating the image directly.

Figure 2 introduces this encoding through a two-qubit Deutsch-algorithm example before the QFT cases. The QFT figures then show how probability spreads, disappears, or concentrates as gates are applied. Because the visual variable is ∣αc∣2|\alpha_c|^2 rather than the complex amplitude αc\alpha_c, changes in relative phase are not directly visible. A controlled phase operation can therefore leave a column's grayscale distribution unchanged even though it changes the state used by subsequent interference. The numerical amplitudes complement the image, but the image alone is not a complete representation of a quantum state.

QFT formulation and circuit construction

For an nn-qubit register, the paper uses N=2nN=2^n and defines the QFT of a basis state as

QFT⁡N∣a⟩=1N∑c=0N−1e2πiac/N∣c⟩.\operatorname{QFT}_N|a\rangle =\frac{1}{\sqrt{N}}\sum_{c=0}^{N-1}e^{2\pi iac/N}|c\rangle.

By linearity, an input ∑a=0N−1xa∣a⟩\sum_{a=0}^{N-1}x_a|a\rangle has output amplitudes

βc=1N∑a=0N−1xae2πiac/N,pc=∣βc∣2.\beta_c=\frac{1}{\sqrt{N}}\sum_{a=0}^{N-1}x_a e^{2\pi iac/N}, \qquad p_c=|\beta_c|^2.

This separates the Fourier transformation of amplitudes from the probabilities encoded by the visualization. The gate construction uses Hadamard gates and controlled phase gates of the form CPjk=diag⁡(1,1,1,eiθjk)CP_{jk}=\operatorname{diag}(1,1,1,e^{i\theta_{jk}}), with θjk=π/2k−j\theta_{jk}=\pi/2^{k-j}. Figure 3 arranges these gates in successive groups, starting with a Hadamard on the most significant qubit and proceeding toward the least significant qubit. The illustrated QFT sequences contain three, six, ten, and twenty-one gate steps for two, three, four, and six qubits, respectively. The circuit drawing does not include a final swap network, so its output-bit ordering needs attention when comparing the plotted decimal labels with other QFT implementations.

Demonstrations and findings

Figure 4 applies the QFT to the basis states ∣01⟩|01\rangle, ∣011⟩|011\rangle, ∣1010⟩|1010\rangle, and ∣110011⟩|110011\rangle for registers of two, three, four, and six qubits. Each initial distribution contains one black cell and otherwise white cells. As the computation proceeds, occupied rows spread through the register until the final column assigns equal probability 1/N1/N to every basis state. This agrees with the equal amplitude magnitudes in the QFT definition, although the output phases depend on the input basis state and are absent from the grayscale image.

The retained image reproduces Figure 4(b): the initial probability is concentrated at decimal state three, and six gate operations produce a uniform final probability of 1/81/8 across the eight basis states. The initial-state column is included in the seven displayed computation steps.

Figures 5 through 8 add Hadamard gates before the QFT to prepare superpositions while retaining the corresponding basis-state starting points for comparison. The two- and three-qubit examples apply a Hadamard to the least significant qubit; the four-qubit example applies one to the second wire from the top; and the six-qubit example applies two, to the second and fourth wires. The resulting final distributions are no longer uniform. For example, Figure 5 reports probabilities 00, 0.500.50, 0.250.25, and 0.250.25 for decimal labels zero through three in the paper's displayed ordering. In Figure 7, the reported final probabilities are 0.12500.1250 for labels zero through three, zero for four through seven, and 0.06250.0625 for eight through fifteen. The repeated starting states make the effect of the added preparation gates visible against the corresponding Figure 4 examples.

Figures 9 and 10 prepare entanglement with a Hadamard followed by a controlled-NOT before applying the QFT. The four-qubit circuit entangles the middle pair of wires, while the six-qubit circuit entangles the top pair and the bottom pair. Their probability histories again differ from both the basis-state and Hadamard-only preparations, and their final distributions are nonuniform. The author's conclusion is that changing the input preparation through superposition and entanglement provides control over the distribution obtained after the QFT. These examples demonstrate changes in the simulated output, but the visual encoding does not independently measure or identify entanglement.

Contributions, evidence, and limitations

The contribution is a simulator-supported way to inspect a quantum computation as a sequence of probability distributions, illustrated systematically across basis-state, superposition, and entangled preparations. The circuit schematics explain the preparation and gate sequence, the grayscale images expose the distribution over time, and numerical amplitudes supply information omitted by the image. The paper's evidence consists of pseudocode, established QFT mathematics, and worked simulation examples up to six qubits. It does not report a controlled educational study, comparisons with other visualization methods, runtime benchmarks, or an experiment demonstrating faster algorithm development or optimization.

The author explicitly acknowledges exponential slowdown as the number of qubits grows and discusses sparse matrix techniques as a way to exploit zeros in the simulated operators. The paper's broad O(2n)O(2^n) complexity statement should be understood as its account of the cost of this classical simulation setting, rather than a demonstrated lower bound covering every specially structured quantum circuit or simulation method. No measured scaling results establish a practical maximum register size or quantify the benefit of sparse matrices.

There are also limits apparent from the encoding itself: the number of rows grows as 2n2^n, low probabilities become difficult to distinguish on a fixed zero-to-one grayscale, and different states with identical measurement probabilities share the same visual appearance. These are implications of the representation, rather than usability findings reported by the author. The conclusion proposes potential use in optimizing existing quantum algorithms and developing new ones, but does not specify a tested optimization workflow or a detailed future research program. At publication, the author stated that the source code was free and available by email; the paper provides no basis for claiming current availability or maintenance.

Download .bib
@article{karafyllidis_visualization_2003,
  author = {Karafyllidis, Ioannis G.},
  language = {en},
  doi = {10.1023/B:QINP.0000020076.36114.13},
  issn = {1570-0755, 1573-1332},
  journal = {Quantum Information Processing},
  month = aug,
  number = {4},
  pages = {271--288},
  title = {Visualization of the {Quantum} {Fourier} {Transform} {Using} a {Quantum} {Computer} {Simulator}},
  urldate = {2025-11-02},
  volume = {2},
  year = {2003},
}