HattriQ: Designing Integrated Gradients for Feature Attribution in Quantum Machine Learning

This paper introduces HattriQ, a general-purpose framework that enables interpretability in circuit-based quantum machine learning by computing amplitude-based integrated gradients directly on quantum hardware using Hadamard tests, overcoming the limitations of classical methods due to measurement collapse and simulation complexity.

Original authors: Nicholas S. DiBrita, Jason Han, Younghyun Cho, Hengrui Luo, Tirthak Patel

Published 2026-05-26
📖 5 min read🧠 Deep dive

Original authors: Nicholas S. DiBrita, Jason Han, Younghyun Cho, Hengrui Luo, Tirthak Patel

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a magical, super-complex black box that can look at a picture of a cat and tell you, "That's a cat!" This box is a Quantum Machine Learning (QML) model. It's incredibly powerful, but it works using the strange laws of quantum physics.

The problem? It's a black box. Even the people who built it can't easily explain why it decided it was a cat. Did it look at the ears? The whiskers? Or did it just get lucky? In the classical world, we have tools to peek inside and see which parts of the input mattered most. But in the quantum world, if you try to peek, the magic disappears (the quantum state "collapses"), and the answer changes.

This paper introduces HATTRIQ, a new tool designed to solve this mystery without breaking the magic.

The Core Problem: The "Unseeable" Box

Think of a quantum computer like a chef cooking a dish in a completely sealed, soundproof kitchen. You give them ingredients (the data), and they serve you a finished meal (the prediction).

  • Classical AI: You can ask the chef, "Did you use more salt or more pepper?" and they can check their recipe.
  • Quantum AI: The chef is working with ingredients that exist in two places at once (superposition). If you open the door to ask about the salt, the ingredients instantly turn into something else, and the recipe is ruined.

Because of this, we couldn't previously tell which "ingredient" (pixel in an image, or data point) was most important for the final decision.

The Solution: HATTRIQ (The "Magic Mirror")

The authors created HATTRIQ (Hadamard test-based input attribution score scheme for quantum models).

Instead of trying to peek inside the kitchen and ruin the dish, HATTRIQ uses a clever mirror trick (called a Hadamard test).

  • The Analogy: Imagine you want to know how much a specific ingredient contributed to the taste, but you can't taste the soup directly. Instead, you run a parallel, "ghost" version of the cooking process alongside the real one. By comparing how the real soup and the ghost soup interact, you can mathematically calculate exactly how much that specific ingredient mattered, without ever opening the pot.

HATTRIQ does this on the actual quantum hardware. It runs a special circuit that asks the quantum computer: "If I tweak this specific part of the input, how does the final answer change?" It does this by measuring the "probability" of a specific outcome, which reveals the importance of that input feature.

How It Works (The "Gradient" Concept)

In simple terms, HATTRIQ calculates Integrated Gradients.

  • Imagine you are walking from a blank white screen (no image) to a full picture of a cat.
  • HATTRIQ takes tiny steps along that path. At every step, it asks, "How much did this specific pixel contribute to the change?"
  • It adds up all those tiny contributions to give you a final score: "This pixel was very important (High Positive)," "This pixel was confusing (Negative)," or "This pixel didn't matter (Zero)."

What They Tested It On

The team tested HATTRIQ on several "black boxes" to see if it could explain their decisions:

  1. Simple Patterns: Distinguishing between bars and stripes.
  2. Handwritten Digits: Recognizing numbers like 0, 1, 3, 4, etc. (from MNIST and NIST datasets).
  3. Clothing: Telling the difference between a dress and a shirt, or boots and sandals (FashionMNIST).
  4. Quantum Physics Data: Even testing it on data that represents magnetic spins in a chain (TFIM dataset), proving it works on pure quantum data, not just pictures.

The Results: It Actually Works!

  • It makes sense: When HATTRIQ looked at a picture of the number "4," it highlighted the sharp angles of the 4 and ignored the background. When it looked at a "3," it highlighted the curves. It didn't just guess; it found the actual features the model was using.
  • It's robust: They tested it with "noisy" quantum hardware (simulating a slightly broken or imperfect machine). Even with errors, HATTRIQ still gave clear, accurate answers.
  • It's efficient: They showed that you can run these tests in parallel (using multiple "ghost" kitchens at once) to speed things up.

Why This Matters

Before HATTRIQ, if a quantum AI made a mistake, we had no idea why. We were flying blind.

  • Trust: Now, we can verify if the AI is looking at the right things (like the shape of a shoe) or the wrong things (like a random speck of dust).
  • Debugging: If the AI is biased or confused, HATTRIQ helps the developers see exactly where the confusion is happening so they can fix the model.

In short, HATTRIQ is the first flashlight that lets us see inside the quantum black box without turning off the lights. It translates the confusing, invisible quantum decisions into a clear map of "what mattered" for the final answer.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →