Papers
Topics
Authors
Recent
Search
2000 character limit reached

Quantum Hadamard Edge Detection (QHED)

Updated 6 July 2026
  • Quantum Hadamard Edge Detection is a method that applies a single-qubit Hadamard operation on amplitude-encoded images to extract boundary information.
  • The technique transforms neighboring pixel amplitudes into sums and differences, enabling efficient edge detection even for large images.
  • Implementations on NISQ devices demonstrate reduced circuit depth and high fidelity, positioning QHED as a benchmark in quantum imaging research.

Quantum Hadamard Edge Detection (QHED) is a quantum image-processing algorithm in which an image is amplitude-encoded into a quantum state and a Hadamard-based interference step transforms neighboring pixel amplitudes into sums and differences, with the difference components encoding boundary information (Yao et al., 2018). In its canonical formulation, QHED is built on Quantum Probability Image Encoding (QPIE), uses a single-qubit Hadamard as the core edge operator, and is often presented as a constant-time quantum edge-detection primitive once the image state has already been prepared (Yao et al., 2018). Subsequent work has refined this basic construction for grayscale and FRQI-encoded images, contrasted it with transform-domain Walsh–Hadamard alternatives, and adapted it to NISQ-oriented decompositions for large medical images (Shubha et al., 2024, Rohida et al., 9 Jul 2025, Billias et al., 15 Jul 2025).

1. Origins and formal definition

QHED was explicitly introduced as a “quantum Hadamard edge detection (QHED) algorithm” in the framework of quantum image processing based on amplitude encoding (Yao et al., 2018). The original formulation represents an image as an nn-qubit pure state

f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,

where the computational basis labels pixel positions and the amplitudes ckc_k encode normalized pixel values (Yao et al., 2018). The defining idea is to choose a qubit whose binary value distinguishes neighboring pixels and then apply a Hadamard gate to that qubit so that each amplitude pair (a,b)(a,b) is mapped to (a+b,ab)/2(a+b,a-b)/\sqrt{2} (Yao et al., 2018).

In the original construction, the global edge operator is

Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,

with the Hadamard applied to the last qubit of the image register (Yao et al., 2018). Acting on the amplitude vector, this gives

[c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.

The amplitudes associated with the targeted qubit in state 1|1\rangle therefore encode neighboring-pixel differences, which are interpreted as edges (Yao et al., 2018).

The original paper framed this as a global edge detector acting on the entire image state in parallel and stated that the task can be completed with “only one single-qubit operation, independent of the size of the image” for the core edge-detection step (Yao et al., 2018). A later review and extension characterized QHED in the same terms: QPIE input, an auxiliary qubit, a Hadamard-permutation-Hadamard pattern, and difference amplitudes interpreted as discrete gradients (Shubha et al., 2024).

2. Image encoding and circuit mechanics

The canonical encoding used by QHED is QPIE. For a classical image F=(Fi,j)F=(F_{i,j}), the original work forms the column-stacked vector

f=vec(F)=(F1,1,F2,1,,FM,1,F1,2,,FM,L)T\vec f = \mathrm{vec}(F) = (F_{1,1},F_{2,1},\dots,F_{M,1},F_{1,2},\dots,F_{M,L})^T

and prepares the state

f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,0

for f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,1, with zero padding when f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,2 (Yao et al., 2018). This encoding is qubit-efficient because pixel intensities are stored directly in amplitudes rather than in a separate value register (Yao et al., 2018).

A widely cited ancilla-assisted QHED construction appends a redundant least-significant qubit initialized in f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,3, giving

f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,4

A Hadamard on that qubit yields a duplicated amplitude pattern,

f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,5

after which a decrement permutation f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,6 cyclically shifts amplitudes, and a second Hadamard maps the result to

f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,7

so that odd-indexed basis states encode f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,8 (Billias et al., 15 Jul 2025). A closely related account describes the same sequence as: auxiliary Hadamard, amplitude permutation f=k=02n1ckk,|f\rangle = \sum_{k=0}^{2^n-1} c_k |k\rangle,9, second Hadamard, then conditioning on the auxiliary outcome that carries the differences (Shubha et al., 2024).

The decrement operator is written as a cyclic-shift permutation matrix,

ckc_k0

and is the core nontrivial permutation primitive in ancilla-based QHED descriptions (Shubha et al., 2024, Billias et al., 15 Jul 2025).

3. Boundary extraction, orientation, and full-edge variants

The simplest Hadamard-only form of QHED produces differences for neighboring pairs ckc_k1 (Yao et al., 2018). To recover complementary pairs such as ckc_k2, the original work described two strategies (Yao et al., 2018).

The first strategy uses a quantum amplitude permutation ckc_k3 that shifts amplitudes so that odd and even entries are exchanged in the appropriate pattern before applying the same Hadamard edge operator again (Yao et al., 2018). The second strategy, developed in the appendix of the original paper, introduces an auxiliary qubit and a specific amplitude permutation ckc_k4 so that after postselection on the last qubit the resulting ckc_k5-qubit state is

ckc_k6

which encodes the full set of neighboring differences with cyclic boundary conditions (Yao et al., 2018).

Orientation is controlled by the encoding order. The original paper stated that with image encoding along different orientations, row scanning detects vertical boundaries and column scanning detects horizontal boundaries (Yao et al., 2018). A later Walsh-domain alternative explicitly noted that its vertical–horizontal handling is “the same strategy as in QHED”: run the algorithm directly on the original matrix for vertical edges, transpose the image to obtain horizontal edges, transpose back, and combine the outputs (Rohida et al., 9 Jul 2025). This confirms that QHED is ordinarily understood as a directional detector whose output depends on the mapping between pixel geometry and basis ordering.

A common misconception is that the single-Hadamard description by itself yields a complete edge map. In the original formulation, full boundary extraction requires either an additional amplitude permutation step or an ancilla-based redundant encoding that captures all neighboring differences in one pass (Yao et al., 2018).

4. Complexity claims and their assumptions

The canonical complexity claim associated with QHED is that the core edge-detection step is ckc_k7 in image size because the logical operator is a single-qubit Hadamard acting on an ckc_k8-qubit image state (Yao et al., 2018). The original paper contrasted this with classical gradient-based methods, which it described as requiring at least ckc_k9 work because every pixel must be processed (Yao et al., 2018). A later FRQI-based refinement reiterated that, once image preparation is treated separately and the decrement permutation is regarded as available, the edge-extraction depth remains constant in the idealized model (Shubha et al., 2024).

That asymptotic statement is accompanied, in later work, by explicit caveats. A 2025 Walsh-based comparison paper stated that both QHED and its proposed alternative ignore the costs of quantum state preparation using QPIE and ancilla measurement in their complexity analyses (Rohida et al., 9 Jul 2025). The same paper characterized QHED’s central operation as quantum amplitude permutation with computational cost

(a,b)(a,b)0

where (a,b)(a,b)1 is the number of qubits encoding the image, and therefore summarized QHED’s cost for an (a,b)(a,b)2 image as

(a,b)(a,b)3

under the shared assumption that state preparation and final readout are excluded (Rohida et al., 9 Jul 2025).

The original paper also acknowledged the readout issue: reconstructing the full edge image requires many measurements, whereas global feature testing can avoid full image reconstruction by using procedures such as a SWAP test (Yao et al., 2018). A plausible implication is that QHED’s most defensible speedup claims arise when it is embedded inside a larger quantum pipeline and when the objective is not exhaustive classical readout. That implication is explicitly aligned with later remarks that the algorithm becomes advantageous when the input state is already the output of a preceding quantum subroutine (Rohida et al., 9 Jul 2025).

5. Experimental realization and NISQ-oriented implementations

QHED was demonstrated experimentally in liquid-state NMR on a four-qubit processor using iodotrifluoroethylene, with three (a,b)(a,b)4 nuclei and one (a,b)(a,b)5 nucleus (Yao et al., 2018). The experiment encoded a (a,b)(a,b)6 image into a four-qubit state, prepared a pseudopure state

(a,b)(a,b)7

reported a pseudopure-state fidelity of approximately (a,b)(a,b)8, and implemented the edge operator (a,b)(a,b)9 to obtain the edge-information state (a+b,ab)/2(a+b,a-b)/\sqrt{2}0 (Yao et al., 2018). For the input and output image states, the reported fidelities relative to the ideal states were between (a+b,ab)/2(a+b,a-b)/\sqrt{2}1 and (a+b,ab)/2(a+b,a-b)/\sqrt{2}2, with normalized Euclidean distances of about (a+b,ab)/2(a+b,a-b)/\sqrt{2}3 for the input and (a+b,ab)/2(a+b,a-b)/\sqrt{2}4 for the output (Yao et al., 2018).

More recent work has focused less on proof-of-principle state tomography and more on hardware-aware restructuring. A 2025 medical-imaging study introduced a modified QHED, denoted QHED(a+b,ab)/2(a+b,a-b)/\sqrt{2}5, with a two-level (a+b,ab)/2(a+b,a-b)/\sqrt{2}6 decomposition consisting of Data-Level Decomposition into (a+b,ab)/2(a+b,a-b)/\sqrt{2}7 buffered sub-images and Circuit-Level Decomposition into (a+b,ab)/2(a+b,a-b)/\sqrt{2}8 smaller cut circuits per sub-image (Billias et al., 15 Jul 2025). In that work, the original decrement implemented via multi-controlled (a+b,ab)/2(a+b,a-b)/\sqrt{2}9 gates was replaced by an ancilla-assisted construction using only CX and Toffoli gates after decomposition, with ancillas starting and ending in Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,0 (Billias et al., 15 Jul 2025).

Under realistic IBM FakeMumbai noise models for 5-qubit data input sizes, that decomposition and optimization strategy was reported to achieve over Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,1 reductions in circuit depth, approximately Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,2 fewer two-qubit operations, and fidelity exceeding Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,3 (Billias et al., 15 Jul 2025). The same study applied the method to Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,4 MRI images and to a Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,5 brain MRI volume, which was decomposed into Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,6 buffered 5-qubit subdomains processed in a distributed D-NISQ workflow (Billias et al., 15 Jul 2025). These results do not alter the logical structure of QHED, but they recast it as a decomposed, stitched primitive suitable for NISQ-era constraints.

6. Extensions, alternatives, and comparative developments

A major extension of QHED replaced QPIE with Flexible Representation of Quantum Images (FRQI) and then used partial measurement of the FRQI color qubit to obtain a QPIE-like grayscale state before applying a modified QHED stage (Shubha et al., 2024). In that approach, the FRQI image state is

Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,7

and measurement of the color qubit yields either a state proportional to Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,8 or one proportional to Uedge=I2n1H,U_{\text{edge}} = I_{2^{n-1}} \otimes H,9, both interpreted as QPIE-like grayscale images that preserve the same edge structure (Shubha et al., 2024). The measured qubit is then reset and reused as the QHED ancilla, prepared in [c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.0 via [c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.1 and [c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.2 gates if needed (Shubha et al., 2024).

That FRQI-based work also introduced classical post-processing to improve object outlines. It defined a dynamic threshold

[c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.3

for a [c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.4 image, and proposed shifting detected edges by one pixel when the sign of a difference is inconsistent with the sign of the first edge in a scan line, thereby relocating interior detections to the object boundary (Shubha et al., 2024). Within the terms used there, the modification was presented as addressing the fact that traditional QHED can produce noisy or incomplete object outlines on grayscale images (Shubha et al., 2024).

QHED has also served as a benchmark for alternative quantum edge detectors. A 2025 paper on grayscale edge detection in the sequency-ordered Walsh domain explicitly stated that QHED uses QPIE and that its central operation is quantum amplitude permutation [c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.5, whereas the proposed method replaces that primitive with a sequency-ordered Walsh–Hadamard transform [c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.6 and a quantum high-pass filter (Rohida et al., 9 Jul 2025). That paper reported complexity

[c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.7

for the Walsh-based algorithm versus

[c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.8

for QHED, and gave SSIM comparisons on [c0 c1 c2 c3  cN2 cN1]12[c0+c1 c0c1 c2+c3 c2c3  cN2+cN1 cN2cN1],N=2n.\begin{bmatrix} c_0\ c_1\ c_2\ c_3\ \vdots\ c_{N-2}\ c_{N-1} \end{bmatrix} \mapsto \frac{1}{\sqrt{2}} \begin{bmatrix} c_0 + c_1\ c_0 - c_1\ c_2 + c_3\ c_2 - c_3\ \vdots\ c_{N-2} + c_{N-1}\ c_{N-2} - c_{N-1} \end{bmatrix}, \quad N=2^n.9 synthetic images in which the proposed method was slightly better or comparable to QHED: 1|1\rangle0 vs 1|1\rangle1 for a string image, 1|1\rangle2 vs 1|1\rangle3 for one polygon case, and 1|1\rangle4 vs 1|1\rangle5 for another (Rohida et al., 9 Jul 2025).

A distinct line of work has pursued NISQ-friendly local alternatives rather than full-image QHED. One hybrid method based on a quantum artificial neuron explicitly cited QHED as a more efficient alternative in theory, but emphasized that larger hardware demonstrations remained limited; its own design instead used small patchwise Hadamard-and-phase circuits whose qubit count and depth do not scale with image size (Geng et al., 2022). This suggests a bifurcation in the literature between globally encoded QHED-style methods and hybrid patchwise methods that retain some Hadamard-interference structure while abandoning whole-image amplitude encoding.

7. Interpretive issues and research status

The central interpretive issue around QHED is the status of its constant-time claim. In the narrow sense used by the original algorithm, the claim refers to the logical edge operator itself—one Hadamard or a short Hadamard-permutation-Hadamard sequence acting on an already prepared quantum image state (Yao et al., 2018, Shubha et al., 2024). In broader system-level terms, later work has repeatedly emphasized that state preparation, readout, and physically realistic implementations of the permutation primitive can dominate cost and fidelity (Rohida et al., 9 Jul 2025, Billias et al., 15 Jul 2025).

Another persistent issue concerns image representation. QHED in its canonical form is tightly associated with QPIE, which is qubit-efficient but couples all intensities through global normalization (Yao et al., 2018). FRQI-based modifications were introduced precisely to broaden applicability to grayscale and potentially color images, while Walsh-domain alternatives retained QPIE but replaced QHED’s amplitude-permutation core with transform-domain filtering (Shubha et al., 2024, Rohida et al., 9 Jul 2025).

The research trajectory therefore presents QHED in three distinct but connected roles. First, it is an original Hadamard-interference algorithm for edge extraction from amplitude-encoded images (Yao et al., 2018). Second, it is a modifiable template whose image representation, ancilla handling, and post-processing can be altered to improve outlines or support more general image classes (Shubha et al., 2024). Third, it is a benchmark against which newer transform-based and hardware-aware methods are evaluated, especially in terms of asymptotic cost, gate decomposition, NISQ fidelity, and scalability to real-world datasets such as MRI (Rohida et al., 9 Jul 2025, Billias et al., 15 Jul 2025).

Within quantum image processing, QHED remains the canonical example of how a single Hadamard-induced interference pattern can convert amplitude-encoded image data into neighbor-difference information. Its enduring significance lies less in any settled practical superiority than in the way it crystallizes the central promises and tensions of the field: logarithmic qubit representations, highly compressed quantum operators, and the unresolved costs of loading, extracting, and faithfully executing image-processing tasks on realistic hardware (Yao et al., 2018, Billias et al., 15 Jul 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Quantum Hadamard Edge Detection (QHED).