Abstract
Quantum machine learning (QML) algorithms have demonstrated early promise across hardware platforms, but remain difficult to interpret due to the inherent opacity of quantum state evolution. Widely used classical interpretability methods, such as integrated gradients and surrogate-based sensitivity analysis, are not directly compatible with quantum circuits due to measurement collapse and the exponential complexity of simulating state evolution. In this work, we introduce HATTRIQ, a general-purpose framework to compute amplitude-based input attribution scores in circuit-based QML models. HATTRIQ supports the widely-used input amplitude embedding feature encoding scheme and uses a Hadamard test-based construction to compute input gradients directly on quantum hardware to generate provably faithful attributions. We validate HATTRIQ on classification tasks across several datasets (Bars and Stripes, MNIST, and FashionMNIST).
Introduction
Quantum Machine Learning (QML) is often touted for its potential to outperform classical AI, yet it remains a "black box." Because quantum states collapse when measured and computations occur in an exponentially large Hilbert space, understanding why a quantum circuit made a specific prediction is notoriously difficult. HATTRIQ (Hadamard test-based input attribution score scheme) is a novel framework that brings classical-style interpretability to the quantum realm by adapting "Integrated Gradients" (IG)—a gold-standard classical interpretability method—to work directly on quantum hardware.
The Challenge of Quantum Interpretability
In classical machine learning, feature attribution methods create heatmaps showing which parts of an input (e.g., pixels in an image) a model focused on. Standard methods like IG require calculating the gradient of the model's output with respect to its input. In QML, this is challenging for two primary reasons:
- Measurement Collapse: Observing the intermediate state of a quantum computation destroys it, preventing direct gradient calculation.
- Simulation Complexity: Classically simulating a quantum circuit to find its gradient becomes exponentially harder as the number of qubits increases.
This is especially problematic for amplitude embedding, a popular technique that packs $2^n$ data points into just $n$ qubits. Until now, there was no hardware-native way to explain how these compressed features influenced the final result.
The HATTRIQ Framework
HATTRIQ bridges this gap by moving the mathematical computation from classical simulators onto the quantum hardware itself. It implements the IG path-integral approach, which calculates the average gradient along a path from a "blank" baseline input to the actual data point.
The core innovation is the use of the Hadamard Test. Instead of differentiating the circuit mathematically, HATTRIQ uses a specific quantum circuit construction to encode the gradient of the output directly into the measurement probability of an extra "ancilla" qubit.
To improve efficiency, HATTRIQ also supports parallelization. By using multiple ancilla qubits, the system can solve linear equations to extract multiple feature gradients simultaneously, significantly reducing the number of required circuit runs.
Experimental Validation and Results
The researchers validated HATTRIQ using several standard image classification benchmarks, including Bars and Stripes, NIST ($8 \times 8$), MNIST ($28 \times 28$), and FashionMNIST. The underlying QML models achieved high performance, such as 95-100% on NIST tasks and ~90% on MNIST, ensuring the attributions were based on high-quality predictions.
HATTRIQ produced attribution maps that clearly highlighted the shapes of digits and specific clothing features. For example, in digit classification, the maps identified the loop of a '6' or the crossbar of a '4' as critical features.
Key insights from the results include:
- Hardware-Native Explanations: Explainer circuits can run alongside the model on actual quantum hardware.
- Robustness to Shot Noise: HATTRIQ remains accurate even with low shot counts (10–100 shots), making it practical for near-term hardware.
- Encoding Sensitivity: A model's "reasoning" changes based on the encoding method (e.g., angle vs. amplitude embedding), even if final accuracy is similar.
Conclusion
HATTRIQ represents a major step toward interpretable QML. While current studies were performed in simulation and face hurdles like gate noise in NISQ hardware, the framework provides a path toward understanding quantum models. Future work will extend HATTRIQ to support mid-circuit measurements and conditional logic, further opening the quantum black box.
Reference: Nicholas S. DiBrita, et al. "Amplitude-based Input Attribution in Quantum Learning via Integrated Gradients." arXiv:2510.02497v1 [quant-ph].
Summary updated