---
title: Quantum Machine Learning Playground
authors:
  - Pascal Debus
  - Sebastian Issel
  - Kilian Tscharke
abstract: This article introduces an innovative interactive visualization tool designed to demystify quantum machine learning (QML) algorithms. Our work is inspired by the success of classical machine learning visualization tools, such as TensorFlow Playground, and aims to bridge the gap in visualization resources specifically for the field of QML. The article includes a comprehensive overview of relevant visualization metaphors from both quantum computing and classical machine learning, the development of an algorithm visualization concept, and the design of a concrete implementation as an interactive web application. By combining common visualization metaphors for the so-called data re-uploading universal quantum classifier as a representative QML model, this article aims to lower the entry barrier to quantum computing and encourage further innovation in the field. The accompanying interactive application is a proposal for the first version of a quantum machine learning playground for learning and exploring QML models.
summaryType: survey
sourceStatus: null
sources:
  - https://doi.org/10.1109/MCG.2024.3456288
---

# Quantum Machine Learning Playground

[Original paper](https://doi.org/10.1109/MCG.2024.3456288) · [Code repository identified in the paper](https://github.com/Fraunhofer-AISEC/qml-playground)

## Background and motivation

Quantum machine learning combines a classical learning workflow with quantum representations of data and parameterized quantum operations.
Understanding such a model requires connecting input samples, transformations of quantum states, measurement probabilities, and updates to trainable parameters.
The paper addresses the established problem of making abstract computational processes understandable through visualization, with a specific focus on interactive exploration of QML classifiers.
Its contribution is a visualization concept and implemented web application, together with a new two-qubit representation called Q-simplex.
The data re-uploading classifier underlying the application comes from prior work.

The authors situate their approach between quantum computing visualization and classical machine learning visualization.
Circuit diagrams show the arrangement of gates but do not by themselves reveal the intermediate states produced by an input.
Bloch spheres, Q-spheres, amplitude plots, and measurement histograms provide complementary information about states, while classical ML tools use architecture diagrams, activation and weight displays, dimensionality reduction, decision boundaries, and training curves.
The related work includes general quantum state visualization, circuit visualization, and visual explanations of particular algorithms.
The authors identify a gap in tools organized around the QML learning process rather than claiming that quantum state or circuit visualization is itself new.

TensorFlow Playground is the main design precedent because it connects data, model structure, intermediate representations, output predictions, and training feedback in one interactive interface.
Figures 10 and 11 review classical techniques and show this existing application; they are background examples rather than screenshots of the authors' QML system.
The challenge in adapting this approach is that an entangled quantum state cannot be reconstructed by treating each qubit as an independent neuron.
A general $n$-qubit state requires $2^n$ complex amplitudes, making both representation and visual scalability difficult.

## Classifier and training model

The application uses the data re-uploading universal quantum classifier, which repeatedly encodes the same input data into a quantum state while applying trainable rotations.
The paper describes a circuit as a sequence of layers,

$$
U(\boldsymbol{\theta},\mathbf{x}) = L^{(N)}\cdots L^{(2)}L^{(1)}.
$$

A layer can separate data encoding and trainable gates, $L^{(k)}=U(\boldsymbol{\theta}_k)U(\mathbf{x})$, or combine them as $L^{(k)}=U(\boldsymbol{\theta}_k\circ\mathbf{x}+\mathbf{b}_k)$, where $\circ$ denotes elementwise multiplication.
The combined form uses weights and biases to determine rotation angles from the input features.
Figure 2 contrasts these alternatives, and Figure 3 provides a schematic of the quantum-classical training loop.
Figure 4 extends the model to two qubits by interleaving single-qubit rotation layers with entangling operations.
These diagrams explain the model and training architecture rather than reporting hardware experiments.

The classifier is useful for this visualization because prior work establishes a universal approximation property even for a single qubit when sufficient layers are available.
This offers expressive models whose complete pure-state space can be displayed on a Bloch sphere, while the two-qubit case introduces entanglement without immediately requiring a large state-space visualization.
The paper explicitly expects no quantum advantage from these small, classically simulated circuits.
The approximation result motivates the algorithm choice; the Playground paper does not prove a new universality theorem or establish that every training run finds an accurate classifier.

For binary classification, measurement probabilities for $|0\rangle$ and $|1\rangle$ can serve as class scores and be compared with labels using a conventional loss.
For a single qubit with more classes, the paper discusses class-specific target states and a fidelity-based loss that encourages each sample's state to approach its assigned target.
With two qubits, classes can instead be associated with computational basis outcomes, allowing cross-entropy on the resulting probabilities after suitable handling of unused outcomes.
This connection between classification and proximity to target states motivates showing whole datasets in quantum state space.

## State representations and Q-simplex

For a single-qubit model, the system shows the embedded dataset on a Bloch sphere after each layer.
Each marker corresponds to one input sample's quantum state, and marker color identifies the sample's class.
Showing many samples together allows users to inspect class separation and movement toward target states as the data passes through successive transformations.
Unlike a circuit drawing alone, this representation exposes the effect of the operations on the dataset.
The final state receives its own view beside the output predictions.

Q-simplex extends this dataset-oriented approach to two qubits by projecting each state onto its computational-basis measurement probabilities.
For

$$
|\psi\rangle=a|00\rangle+b|01\rangle+c|10\rangle+d|11\rangle,
\qquad |a|^2+|b|^2+|c|^2+|d|^2=1,
$$

the four probabilities form coordinates in a probability 3-simplex, displayed as a transparent tetrahedron whose vertices represent the four basis states.
Each dataset sample becomes one point in this tetrahedron.
The representation thus gives a common three-dimensional space for comparing many samples, rather than allocating a separate amplitude plot to each state.

Figure 9 highlights the two opposite edges joining $|00\rangle$ with $|11\rangle$ and $|01\rangle$ with $|10\rangle$.
Their midpoints are the probability distributions of the Bell-state pairs.
The example uses marker color for the class label and marker size for the pure-state concurrence $C=2|ad-bc|$, where $C=0$ denotes separability and $C=1$ maximal entanglement.
The figure caption calls this quantity “concurrency,” but the background defines it as concurrence.
This extra encoding matters because the tetrahedral position discards relative phases and does not uniquely determine a quantum state or, in general, its entanglement.
In particular, the two Bell states in each pair share the same position despite differing in relative phase.
Q-simplex is therefore a probability projection with supplementary state information, not a complete geometric representation of arbitrary two-qubit states.



Figure 9 from the paper illustrates the Q-simplex encoding; the highlighted edges locate the Bell-state probability distributions.

## Interface and interactions

The interface combines controls for the dataset and training process with views of intermediate states and classification results.
Users can select a dataset, choose one or two qubits, set the number of layers, learning rate, training epochs, and batch size, and start or cancel training.
The paper also describes zooming and rotating most visualizations and using hover overlays to inspect additional information, subject to the plotting library's capabilities.
These interactions allow users to explore how model and training choices affect the visible transformations and predictions.

Figure 12 shows the implemented single-qubit interface.
The input panel displays a class-colored scatterplot, the central panel displays the dataset after successive layers on Bloch spheres, and the right-hand column combines training diagnostics with the final state and output views.
Line plots track loss and training and test accuracy over epochs.
A heatmap and contour lines show the predicted decision boundary in the two-dimensional input space, while two additional scatterplots show the ground-truth boundary and distinguish correctly and incorrectly classified samples.
The repeated state views connect changes in the embedded dataset to the final classifier's behavior.
Figure 13 shows the corresponding two-qubit view using four Q-simplex plots for the last four layers of a ten-layer model on a four-class task.



Figure 12 from the paper shows the application's coordinated layout and a circular binary-classification example.

## Implementation and evidence

The web application is written in Python, with Dash and Plotly for the interface and a PyTorch state-vector simulator for the data re-uploading classifier.
The simulator extracts the intermediate state after every layer for visualization.
Training uses mini-batches, PyTorch automatic differentiation, and the Adam optimizer.
The authors distinguish this access to simulated states and gradients from what would be possible directly on quantum hardware.
They report that earlier implementations using Qiskit or PennyLane were insufficiently responsive for their workload of many long circuits with very few qubits, but provide no timing benchmark establishing a general performance comparison between those libraries.

The paper's evidence consists of the implemented interface, illustrative state distributions, and training outputs.
For example, the Figure 12 screenshot displays a circular classification dataset, a ten-layer single-qubit setting, 200 epochs, and training and test accuracies of 0.946 and 0.951.
These values document one illustrated run rather than an aggregate evaluation of classifier quality.
Figure 13 demonstrates how class-colored distributions can be inspected across the final layers of a two-qubit classifier.
The article does not report a controlled user study, learning-outcome assessment, comparison of visualization designs, systematic classification benchmark, or hardware-execution evaluation.
Its claims about improving understanding and lowering the entry barrier should consequently be read as intended benefits of the design, not established educational effects.

The main contributions are the synthesis of quantum and classical ML visualization techniques into a QML exploration workflow, the Q-simplex representation for two-qubit measurement distributions with additional state information, and an implementation that links these views to training a representative classifier.
The work demonstrates a concrete way to inspect dataset transformations inside a small QML model while retaining familiar ML controls and diagnostics.

## Limitations and future work

The principal representational limitation is scalability to entangled multi-qubit states.
Q-simplex omits relative-phase information from spatial position and does not readily extend beyond two qubits, while the single-qubit Bloch sphere cannot express entanglement.
The authors suggest investigating other three-dimensional objects based on convex combinations of more variables, but do not implement or validate such a generalization.
The focus on one- and two-qubit simulation also bounds the models demonstrated by the application.
The decision-boundary views operate in a two-dimensional input space; the paper notes that higher-dimensional boundaries would require other treatment, such as dimensionality reduction.

The authors propose adding data noise and standard regularization options, visualizing weights and biases, and designing displays that respect their meaning as rotation angles or angle multipliers.
They also identify the Fourier-spectrum interpretation of quantum circuits as a possible basis for visualizing model expressivity and guiding model construction.
These are future directions rather than features established in the described implementation.
More broadly, they call for representations that make entangled multi-qubit states meaningful for particular applications and for extending visual exploration to a wider range of quantum algorithms.
