Research2024TVCG

VIOLET

Connects quantum neural network inputs, circuit steps, and predictions through probability charts and decision maps, with comparisons across training epochs.

1 publication

Visualization labels

03 / Visualization

Visual representations

Combined representations

A closer look

2 figures
Figure 1. Figure 5 (2024 paper). The classifier map (A) overlays labeled samples on measurement glyphs. Panel C explains the chosen glyph; B1-B2 show alternative encodings considered by the authors.Shaolun Ruan et al. (2024), VIOLET. Courtesy of the authors. Source

Figure 1

A blue and magenta classifier map, two alternative measurement glyphs, and the annotated chosen glyph explaining grouped basis-state probabilities.

Figure 5 (2024 paper). The classifier map (A) overlays labeled samples on measurement glyphs. Panel C explains the chosen glyph; B1-B2 show alternative encodings considered by the authors.

Shaolun Ruan et al. (2024), VIOLET. Courtesy of the authors.

Open full-size image
Figure 2. Figure 4 (2024 paper). The chosen satellite chart (A) links basis-state circles to qubit axes and uses color for probabilities; stacked bars show single-qubit marginals. Panels B-C show design alternatives.Shaolun Ruan et al. (2024), VIOLET. Courtesy of the authors. Source

Figure 2

Three state-chart designs, with the chosen satellite chart and annotations linking its circles, colored lines, qubit axes, and marginal-probability bars.

Figure 4 (2024 paper). The chosen satellite chart (A) links basis-state circles to qubit axes and uses color for probabilities; stacked bars show single-qubit marginals. Panels B-C show design alternatives.

Shaolun Ruan et al. (2024), VIOLET. Courtesy of the authors.

Open full-size image
01Publication · 2024

VIOLET: Visual Analytics for Explainable Quantum Neural Networks

Shaolun Ruan, Zhiding Liang, Qiang Guan, Paul Griffin, Xiaolin Wen, Yanna Lin, Yong Wang

With the rapid development of Quantum Machine Learning, quantum neural networks (QNN) have experienced great advancement in the past few years, harnessing the advantages of quantum computing to significantly speed up classical machine learning tasks. Despite their increasing popularity, the quantum neural network is quite counter-intuitive and difficult to understand, due to their unique quantum-specific layers (e.g., data encoding and measurement) in their architecture. It prevents QNN users and researchers from effectively understanding its inner workings and exploring the model training status. To fill the research gap, we propose VIOLET, a novel visual analytics approach to improve the explainability of quantum neural networks. Guided by the design requirements distilled from the interviews with domain experts and the literature survey, we developed three visualization views: the Encoder View unveils the process of converting classical input data into quantum states, the Ansatz View reveals the temporal evolution of quantum states in the training process, and the Feature View displays the features a QNN has learned after the training process. Two novel visual designs, i.e., satellite chart and augmented heatmap, are proposed to visually explain the variational parameters and quantum circuit measurements respectively. We evaluate VIOLET through two case studies and in-depth interviews with 12 domain experts. The results demonstrate the effectiveness and usability of VIOLET in helping QNN users and developers intuitively understand and explore quantum neural networks.

From the survey collection

VIOLET: Visual Analytics for Explainable Quantum Neural Networks

Background and motivation

VIOLET is a visual analytics system for understanding how variational quantum classifiers encode classical inputs, change during training, and produce predictions through measurement. Such a model first prepares an input-dependent quantum state, applies an ansatz containing trainable rotation gates, and measures an observable to obtain a classical output. The paper studies how to make these steps inspectable, rather than evaluating a quantum speedup or proposing a new learning algorithm. Its central difficulty is connecting the parameters acting on individual qubits to the probabilities of multi-qubit basis states and then to a classifier's output.

The broader problem of explaining machine-learning models and quantum circuits already existed. The authors identify a more specific gap in explaining the entire variational training and prediction workflow. They review circuit-oriented tools, state representations such as Bloch spheres and decision diagrams, and probability-aware quantum visualizations. They also draw on feature-oriented explanations of classical neural networks, including Grad-CAM and VBridge, and training-evolution systems such as ReVACNN and CNNComparator. These approaches offer useful precedents, but do not directly supply the linked explanations of data encoding, rotation-parameter changes, basis-state probabilities, and measurements that VIOLET targets. The contribution is therefore a domain-specific visual analytics solution to an established explainability problem, with new visual designs for this quantum setting. The paper's claim to be the first visualization work for explainable quantum machine learning is explicitly qualified by the authors as being to the best of their knowledge.

Requirements and system organization

A preliminary design study involved six quantum-computing experts, distinct from the later evaluation participants. The authors conducted hour-long individual interviews and then tested initial designs with two doctoral students before refining the system. The resulting requirements cover the representation of encoded data, effects of rotation angles, tracing a prediction through the circuit, explaining measurement, understanding learned patterns, and monitoring training statistics. These combine quantum-specific questions with familiar machine-learning analysis tasks.

The models were implemented with TorchQuantum. The collected data include intermediate quantum states, rotation parameters, gate information, expectation values, and loss and accuracy across epochs. VIOLET derives basis-state and single-qubit probabilities from these records and organizes them into Encoder, Ansatz, and Feature views. Figure 3 is a system-architecture schematic showing data storage, processing, and visualization modules; Figure 1 shows the implemented interface. The surrounding scatterplot, circuit diagram, and statistical charts provide context for the specialized encodings.

Figure 1 shows a selected input connected to its encoded probability distribution and its progression through circuit steps at different epochs. The bottom circuit diagram identifies the encoder, ansatz, and measurement, while the loss and accuracy curves help locate training stages worth examining.

Satellite charts for encoding and training

The satellite chart links the joint distribution over computational-basis states to the marginal probabilities of individual qubits. For an NN-qubit state, let pbp_b be the probability of basis string b∈{0,1}Nb\in\{0,1\}^N. For qubit jj, the relevant relationship is

P(qj=x)=∑b:bj=xpb,x∈{0,1}.P(q_j=x)=\sum_{b:b_j=x}p_b,\qquad x\in\{0,1\}.

This is a marginalization relationship, not a claim that a potentially entangled multi-qubit state can be reconstructed as a tensor product of separate pure qubit states. It explains why several basis states can contribute to the same single-qubit measurement outcome.

In the three-qubit illustration, three equally spaced axes place the zero and one outcomes of each qubit around the periphery. Small circles representing the eight basis states occupy the central region. Their color encodes probability, and lines of the same color connect each circle to the corresponding binary position on every qubit axis. The green scale in the Ansatz View makes larger probabilities darker; the Encoder View shown in Figure 1 uses a grayscale version. Where lines gather at a qubit outcome, their colors provide a qualitative cue to its total probability. Stacked bars at these positions make the sum more explicit: each segment represents a contributing basis state, and the total height represents the marginal probability. These encodings expose probabilities and their relationships; they do not display the complete complex amplitudes or relative phases of the state.

Figure 4 is a design explanation rather than a separate evaluation result. It compares the adopted layout with a star-shaped arrangement whose lines have unequal lengths for semantically comparable states, and a rotated-axis alternative in which lines overlap. The authors also reject using line width for probability because it increases overlap. These alternatives explain the chosen visual structure, but are not compared in a controlled perceptual experiment.

Clicking an input point in the dataset scatterplot displays its encoded state in the Encoder View. The Ansatz View arranges satellite charts in a matrix whose columns correspond to circuit steps. A row follows the selected input through successive steps at an epoch, and the vertically arranged rows in Figure 1 permit comparison across epochs. Users can unfold columns of interest to examine particular gates. Donut indicators adjacent to a chart encode how much a rotation parameter has changed between the current epoch and the first epoch. Groups of controlled gates are treated as a single step because those gates lack the trainable rotation parameters being compared. The circuit diagram aligns this probability-oriented view with gate types, parameters, and qubit positions.

Augmented heatmaps for predictions and measurement

The Feature View displays the classifier's response across sampled input coordinates. For the two-dimensional examples, the input dimensions are normalized to [−1,1][-1,1] and divided into 15 pieces per dimension to obtain a grid of sampled inputs. The model predicts these inputs, and an augmented heatmap glyph is placed at each grid location with the labeled dataset points overlaid. Consequently, the paper's learned “features” are visualized as a spatial pattern of model responses and decision regions over input space, rather than as a separate feature-attribution calculation.

For the illustrated Pauli-ZZ measurement on qubit jj, the expectation value is

⟨Zj⟩=P(qj=0)−P(qj=1),∑bpb=1.\langle Z_j\rangle=P(q_j=0)-P(q_j=1),\qquad \sum_b p_b=1.

The augmented heatmap makes both the probability normalization and this subtraction visible. In its detailed mode, donut segments represent individual basis-state probabilities, grouped by the measured qubit's binary outcome. Blue and pink/red distinguish the two groups. An outer arc and an inner arc make the operands of the subtraction visible, while a pie sector displays the resulting difference. At overview scale, blue or magenta glyphs and their sector sizes convey the predicted class and the strength of the model response, which the paper describes as confidence. This confidence display should be understood in terms of the depicted expectation values; the paper does not evaluate predictive calibration. Clicking a glyph opens the detailed measurement explanation.

Figure 5 combines the input-space overview with explanatory glyph diagrams and rejected alternatives. The side-by-side block alternative exposes basis-state probabilities but requires users to calculate the difference themselves. An earlier donut design made the model-response pattern less apparent when the two probability groups were similar. The final design integrates the probability decomposition and the difference so users can move from a decision-region overview to a measurement explanation. The control panel additionally supports dataset and measurement selection, epoch selection for the Feature View, and switching between loss/accuracy and rotation-angle statistics.

Case studies and expert evaluation

The first case study used a three-qubit classifier and a two-dimensional dataset, with the encoder and ansatz following a Paddle Quantum tutorial. Expert E12 performed a forward exploration from a selected input through encoding, training, and measurement. For input [−0.58,0.10][-0.58,0.10], the reported encoded distribution was dominated by ∣000⟩|000\rangle at 90.5% and ∣100⟩|100\rangle at 9.3%. The expert related the absence of probability for states whose third qubit was one to the lack of encoding rotation gates on that qubit. He then compared training epochs, inspected changes in basis-state probabilities and parameters, and used the Feature View to investigate a misclassified point. This example illustrates an explanatory workflow grounded in model traces.

The second case study involved expert E2, a four-qubit classifier, and concentric-circle data generated with scikit-learn's make_circles function. Figure 6 shows the actual analysis outputs: prediction maps at epochs 1, 25, and 50; states following CNOT layers; loss and accuracy curves; and a sequence of circuit-step views at epoch 100. The learned prediction regions failed to match parts of the circular class structure, prompting the expert to trace a misclassified point backward through the model. He proposed adding another rotation gate on the measured qubit to increase the model's flexibility. The paper reports this as a strategy suggested through inspection; it does not report retraining the modified circuit or measuring an improvement in accuracy.

The subsequent evaluation recruited 12 experts from six U.S. educational institutions, none of whom participated in requirements elicitation. The two case-study experts were members of this evaluation group, so they are not an additional independent sample. Participants used the deployed interface during individual remote sessions, completed seven tasks spanning encoding, ansatz behavior, learned patterns, and measurement explanations, and provided think-aloud feedback and seven-point questionnaire ratings. Table I lists the tasks; Table II defines the questionnaire; Figure 7 displays rating distributions. The reported mean ratings were 5.81 for effectiveness, 6.16 for visual design, 5.20 for interaction, and 5.68 for usability, with standard deviations of 0.83, 1.21, 1.54, and 0.91 respectively. Participants particularly valued the correspondence between basis-state and single-qubit probabilities, the decision-region view, and the circuit diagram's connection to familiar model structure.

These findings support the usefulness and perceived usability of VIOLET for the studied expert workflows. The reported evaluation provides case narratives, interviews, and subjective ratings, without a baseline comparison or quantitative evidence that users learned more, diagnosed problems more accurately, or worked faster than with another interface. Its demonstrated model-analysis scope is the small variational classifiers in the two case studies.

Contributions, limitations, and future directions

The main contributions are the expert-derived analysis requirements, a linked interface covering encoding through measurement, and two visual designs that connect basis-state probabilities to qubit marginals and measured outputs. The paper also reports that the source code, visual designs, and datasets were made publicly available. It contributes an implemented exploratory and explanatory system, with supporting expert evidence, rather than a mathematical guarantee of interpretability or a validated automatic method for repairing QNNs.

The authors explicitly limit the current system's coverage: VIOLET cannot be directly applied to other quantum-learning models such as quantum generative adversarial networks, even though individual visual designs may be reusable. They propose extending support to more model types and more complex tasks such as hyperparameter tuning. Interface improvements include user-supplied inputs through QASM upload, simulator switching, and more flexible exploration. These are future directions rather than capabilities established by the evaluation.

Scalability remains a problem for both deep circuits and states with many basis components. The circuit diagram can become cluttered, and the central basis-state circles can overlap as the state space grows. Using qubit axes does not eliminate the underlying 2N2^N basis-state probabilities represented by the satellite chart. The authors propose grouping large numbers of entities to manage this complexity. They also discuss possible reuse of the visual designs for quantum phase estimation and quantum error mitigation, but do not evaluate those applications in this paper.

Download .bib
@article{ruan_violet_2024,
  author = {Ruan, Shaolun and others},
  doi = {10.1109/TVCG.2024.3388557},
  issn = {1077-2626, 1941-0506, 2160-9306},
  journal = {IEEE Transactions on Visualization and Computer Graphics},
  month = jun,
  number = {6},
  pages = {2862--2874},
  shorttitle = {\textit{{VIOLET}}},
  title = {\textit{{VIOLET}}: {Visual} {Analytics} for {Explainable} {Quantum} {Neural} {Networks}},
  urldate = {2025-10-22},
  volume = {30},
  year = {2024},
}