---
title: Quantum-Walk Anomaly Scores
url: https://www.emergentmind.com/topics/quantum-walk-anomaly-scores
type: topic
---

# Quantum-Walk Anomaly Scores

Quantum-walk anomaly scores quantify the degree to which a vertex, edge, or substructure in a graph appears “anomalous” under the dynamics of a quantum walk. These scores are motivated by the observation that localized structural perturbations—such as the insertion of extra edges, loops, or cliques—break spectral degeneracies and produce measurable, localized enhancements or suppressions in the quantum-walk probability distribution. Both discrete-time (scattering) and continuous-time quantum walks provide rigorous frameworks for constructing such scores, offering potential quantum speedups and distinct spectral signatures compared to classical random walk–based anomaly detection.

## 1. Quantum Walk Frameworks for Anomaly Detection

Quantum-walk anomaly scoring methods center on two principal models:

**1. Discrete-Time Scattering Quantum Walks:**  
The system evolves in the Hilbert space $\mathcal{H} = \ell^2(\{(u,v): (u,v)\in E\})$, with basis states $|u,v\rangle$ corresponding to directed edges. The walk operator is $U = S \cdot C$, where $C$ is the direct sum of local Grover-type scattering operators $C_v$ at each vertex $v$ and $S$ is the shift operator that exchanges directionality, $|u,v\rangle \to |v,u\rangle$. Local coins are parameterized as $C_v|w,v\rangle = -r_v|v,w\rangle + t_v \sum_{x\sim v,\,x\neq w}|v, x\rangle$ with $r_v = (d_v-2)/d_v$ and $t_v = 2/d_v$, $d_v$ the degree of $v$ [1009.0482, 1206.6298].

**2. Continuous-Time Quantum Walks (CTQW):**  
Vertices index the computational basis states of $\mathbb{C}^n$, with the adjacency matrix $A$ (assumed Hermitian). With initial state $|\psi_0\rangle = \frac{1}{\sqrt{n}}\sum_{v=0}^{n-1}|v\rangle$, state evolution is governed by $U(t) = \exp(-i\gamma t A)$ for step parameter $\gamma > 0$, yielding $|\psi_t\rangle = U(t)|\psi_0\rangle$. Anomalous structure is inferred from deviations in vertices’ time-averaged occupation probabilities [2311.09855].

## 2. Construction of Quantum-Walk Anomaly Scores

Anomaly scores are constructed from quantum-walk transition probabilities that are amplified at or near anomalous structures due to lifted degeneracies in the graph’s spectrum. The standard procedures are as follows:

**a) Discrete-Time Anomaly Scores:**  
Given the walker’s state $|\psi(n)\rangle$ after $n$ steps, the probability of observing the walker on edge $(u, v)$ is $p_{u\to v}(n) = |\langle u,v|\psi(n)\rangle|^2$. The vertex anomaly score is
\[
S(v) = \max_{0\leq n\leq T} \sum_{u:(u,v)\in E} p_{u\to v}(n)
\]
or its time-averaged variant
\[
\overline{S}(v) = \frac{1}{T} \sum_{n=0}^{T-1} \sum_{u} p_{u\to v}(n),
\]
where $T=O(\sqrt{N})$ for the star graph. Analogously, the edge anomaly score is
\[
S(e = \{v,w\}) = \max_{n}[p_{v\to w}(n) + p_{w\to v}(n)].
\]
Typical behavior: in the unperturbed case, $S(v)=O(1/N)$, whereas for a vertex or edge directly involved in an anomaly, $S(v^*), S(e^*) = O(1)$ [1009.0482, 1206.6298].

**b) Continuous-Time Anomaly Scores:**  
For vertex $v$, define the instantaneous probability $P_t(v) = |\langle v|\psi_t\rangle|^2$ and its time average over $T$ steps,
\[
\overline{P}_T(v) = \frac{1}{T} \sum_{t=0}^{T-1} P_t(v).
\]
The anomaly score is set as the inverse of the limiting time-averaged probability,
\[
S(v) = \left(\lim_{T\to\infty}\overline{P}_T(v)\right)^{-1}.
\]
Vertices with unusually small limiting probabilities—those visited anomalously rarely—are flagged as outliers [2311.09855].

## 3. Spectral Perturbations and Quantum Speedup

Quantum-walk anomaly detection leverages the distinctive response of the walk's spectrum under local structural changes:

- In symmetric (degenerate) graphs, the walk’s spectrum exhibits degenerate (often localized) eigenvalues.
- Introducing an anomaly induces a local perturbation $U \to U + \Delta U$ (or $A \to A + \Delta A$ in CTQW), splitting pairs of formerly degenerate eigenvalues by an amount $\Delta\theta = O(1/\sqrt{N})$.
- The time-evolution $U^n = \sum_j e^{in\theta_j}P_j$ concentrates amplitude onto the anomalous region after $n^* \approx \pi/(2\Delta\theta) = O(\sqrt{N})$ steps.
- This mechanism underlies the quadratic speedup relative to classical random search, where $O(N)$ steps are required for localization [1009.0482, 1206.6298].

In the continuous-time model, the limiting (time-averaged) distribution $\pi(v)$ for the walker at vertex $v$ is determined by the expansion coefficients of the symmetric initial state in the eigenbasis of $A$. Eigenvalue differences $\gamma(\lambda_k-\lambda_\ell)$ control the convergence ("mixing") time, with faster mixing associated with larger gaps [2311.09855].

## 4. Prototypical Graph Models and Explicit Formulas

Several canonical graph anomalies illustrate concrete computation of scores:

| Graph Anomaly Model          | Score Amplification Site           | Detection Time Scaling     |
|------------------------------|------------------------------------|---------------------------|
| Star graph with extra edge   | Two spokes + extra edge            | $T=O(\sqrt{N})$           |
| Star with $M$-clique         | Edges to clique/external vertices  | $O(\sqrt{N})$             |
| Joined stars at one vertex   | Shared vertex/connecting edges     | $O(\sqrt{N})$             |
| Bipartite graph + extra edge | Endpoints of extra edge            | $O(\sqrt{N_1})$           |

In the star-graph extra-edge case, with $N$ spokes and initial state $|\psi_\text{init}\rangle$ symmetric over all edges, the probability on the anomalous subspace at step $n$ is, for large $N$,
\[
P_\text{anom}(n) \simeq 4\sin^2(n\Delta), \quad \Delta = \sqrt{2t/3} = O(N^{-1/2}),
\]
with the optimal detection at $n\Delta = \pi/2$ [1009.0482].

For a star with an $M$-clique, eigenvalue splitting scales as $\theta = \sqrt{2M(M-1)/[(2M-1)N]}$, and the maximal occupation probability at a clique edge is $O(1)$ at time $n^* \sim \pi/(2\theta)$ [1206.6298].

## 5. Generalization to Arbitrary Graphs

The anomaly scoring framework can be extended:

- Construct the discrete- or continuous-time quantum walk with local coin parameters (for discrete-time) or graph Hamiltonian (for CTQW) reflecting the unperturbed graph structure.
- Introduce putative anomalies by modifying local scattering rules at selected vertices/edges (e.g., adding/removing edges, phase shifts, changing degrees), thereby altering the local submatrix or adjacency entries.
- Select initial states symmetric over vertices or edge-directions to maximize overlap with degenerate subspaces.
- Compute or approximate the spectral decomposition; identify eigenvalue splittings $\Delta\theta$ to estimate timescale for maximal amplification of anomalous signals.
- Evolve the walker for the required number of steps and evaluate the probability distributions $P_v(n)$; define scores $S(v), S(e)$ as outlined above.
- Anomalous positions are identified as those for which $S(v) \gg 1/|E|$ or $S(v)$ exceeds a chosen threshold (e.g., half-max) [1009.0482, 1206.6298].

In CTQW-based scoring, spectral convergence guarantees that the occupation probabilities $\overline{P}_T(v)$ converge as $T\to \infty$ to limiting values determined by the initial condition and spectrum; the reciprocal score $S(v)$ is then well defined [2311.09855].

## 6. Comparison with Classical and Other Methods

Quantum-walk anomaly scores differ from classical random-walk approaches in several respects:

- **Classical random walks:** Use the stationary distribution $\pi_{cl}$ of the transition matrix $P$, with $S_{cl}(v)=1/\pi_{cl}(v)$. The stationary distribution is reached in $O(1/\Delta_{cl})$ steps ($\Delta_{cl}$: spectral gap).
- **Quantum walks:** The time-averaged limiting distribution $\pi(v)$ encodes quantum interference effects, with enhanced sensitivity to mesoscopic structures, and mixing time may be quadratically faster (ideal quantum regime) [2311.09855].
- **Structural/topological metrics:** Degree centrality or local clustering are insensitive to global mixing or interference features and cannot detect certain subtle anomalies visible to quantum walks [2311.09855].

On small benchmark graphs, quantum and classical random-walk-based scores exhibit close agreement, with KL divergence $O(10^{-1})$ or smaller, but with subtle distinctions arising from uniquely quantum phenomena [2311.09855].

## 7. Implementation Considerations and Resource Scaling

Quantum-walk anomaly scoring is compatible with both fault-tolerant and near-term hardware, with resource considerations as follows:

- **Qubit cost:** $\log n$ qubits for $n$-vertex graphs.
- **Gate cost:** For CTQW, implementing $U(t)$ via Trotterization or qubitization scales with maximum degree and simulation accuracy.
- **Circuit depth:** Deep circuits are required for coherent evolution over large $t$. Modular-restart strategies (evolving short segments, reinitializing) mitigate circuit depth, trading off increased state preparation overhead [2311.09855].
- **Error mitigation:** Techniques such as zero-noise extrapolation and probabilistic Pauli-Lindblad cancellation are directly applicable and improve measurement reliability under noise [2311.09855].
- **Scalability:** The detection time for an anomaly scales as $O(1/\Delta\theta)$, yielding a quadratic speedup over classical search in symmetric graphs ($O(\sqrt{N})$ vs $O(N)$). The precise speedup depends on the detailed spectrum and type of anomaly [1009.0482, 1206.6298, 2311.09855].

Overall, quantum-walk anomaly scores offer a principled pathway to exploit quantum dynamics for graph-based anomaly detection, with a rigorous correspondence to spectral perturbations and the potential for algorithmic quantum advantage.

Source: https://www.emergentmind.com/topics/quantum-walk-anomaly-scores