---
title: Diagonal Walsh Operators
url: https://www.emergentmind.com/topics/diagonal-walsh-operators
type: topic
---

# Diagonal Walsh Operators

Diagonal Walsh operators are a class of commuting, diagonal operators on qubit registers whose structure, basis, and circuit application are built from the theory of Walsh functions. They provide an orthonormal operator basis for the construction and efficient circuit synthesis of arbitrary diagonal unitaries and non-unitary diagonal operators on $n$-qubit (or $r$-qubit) Hilbert spaces, with direct implications for quantum simulation, variational quantum eigensolvers, and quantum chemistry. The construction of these operators and their resource-efficient compilation enable exact or approximate encoding of functions—such as potential energy surfaces or configuration interaction (CI) wavefunctions—without reliance on ancilla qubits and with favorable scaling in gate count and circuit depth [1306.3991], [2601.07037].

## 1. Mathematical Foundation: Walsh Functions and Operator Basis

Walsh functions $w_k(x)$ are defined on the integers $x \in \{0,\ldots,2^n-1\}$, written in binary as $x = (x_1,\ldots,x_n)$, $x_i \in \{0,1\}$, while $k$ has binary digits $(k_1,\ldots,k_n)$. The Paley-ordered Walsh functions are
\[
w_k(x) = (-1)^{\sum_{i=1}^n k_i x_i}
\]
or, equivalently, with inner product modulo 2,
\[
w_j(k) = (-1)^{\langle j,k \rangle}, \quad \langle j,k \rangle = \sum_{i=1}^{r} j_i k_i \bmod 2
\]
where $j, k$ index the basis elements.

The set $\{w_k(x)\}$ forms an orthonormal basis for all real-valued functions on bitstrings of length $n$, satisfying
\[
\frac{1}{2^n} \sum_{x=0}^{2^n-1} w_k(x) w_\ell(x) = \delta_{k\ell}.
\]
Promoted to operators on the $n$-qubit Hilbert space, the diagonal Walsh operator is
\[
W_k = \mathrm{diag}_x\left[w_k(x)\right] = \bigotimes_{i=1}^n (Z_i)^{k_i}
\]
where $Z_i$ is the Pauli-$Z$ acting on the $i$-th qubit. There are $2^n$ such operators, each diagonal in the computational basis, with eigenvalues $\pm1$. The set $\{W_k\}$ provides an orthonormal basis (under the Hilbert–Schmidt product) for all $2^n \times 2^n$ diagonal matrices [1306.3991], [2601.07037].

## 2. Expansion and Synthesis of Diagonal Operators

Any diagonal operator $\Sigma = \sum_{k=0}^{2^r-1} \sigma_k |k\rangle\langle k|$ can be expanded in the Walsh basis:
\[
\Sigma = 2^{-r} \sum_{j=0}^{2^r-1} a_j \hat{w}_j,\quad
a_j = \mathrm{Tr}\left(\Sigma \hat{w}_j\right) = \sum_{k=0}^{2^r-1} \sigma_k (-1)^{\langle j,k\rangle}
\]
For diagonal **unitaries** generated as $U = e^{i f(\hat{x})}$, with $f(x)$ a real function on bitstrings, the unique Walsh expansion is
\[
f(x) = \sum_{k=0}^{2^n-1} a_k w_k(x), \quad a_k = \frac{1}{2^n}\sum_{x=0}^{2^n-1} f(x) w_k(x)
\]
and the unitary decomposes as
\[
U = e^{i f(\hat{x})} = \prod_{k=0}^{2^n-1} e^{i a_k W_k}
\]
Due to the commutativity of all $W_k$, the ordering is irrelevant.

In quantum chemistry (e.g., variational quantum configuration interaction), CI amplitudes $c_k$ can be encoded via the Walsh–Fourier decomposition, mapping each real amplitude into phases $a_j$ on Pauli–$Z$ strings [2601.07037].

## 3. Resource-Efficient Circuit Realization

Each elementary diagonal Walsh operator $e^{ia_k W_k}$ corresponds to a multi-controlled $R_z$ rotation. The efficient decomposition proceeds by:
- Identifying the most significant nonzero bit $m$ in $k$.
- Applying $R_z(-2a_k)$ to qubit $m$.
- For each other $i$ with $k_i=1$, surrounding $R_z$ with a pair of CNOTs: control at $i$, target at $m$.

Optimizing the circuit, consecutive terms $W_k$ in a Gray (sequency) order (where consecutive $k,k'$ differ by one bit) allow maximal CNOT cancellation, yielding a circuit of depth $2M-c$ for $M$ terms (full expansion: $2^{n+1}-3$ gates) [1306.3991].

For **non-unitary diagonal operators** encountered in VQCI, the operator $\Sigma$ is embedded via a dilation into a larger unitary $U = \operatorname{diag}(\Sigma_+,\Sigma_-)$ on $r+1$ qubits, implemented as a product over exponentials of commuting extended Walsh operators acting on both system and ancilla [2601.07037].

## 4. Complexity, Scaling, and Sparse Approximations

Resource estimates are controlled by the number $M$ of nonzero Walsh coefficients used in the expansion:

- **Full expansion:** $M = 2^n - 1$ (all Walsh terms), gate-count $2^{n+1} - 3 = O(2^n)$.
- **Approximate expansion (smooth $f$):** For $\epsilon$-accurate approximation,
  $M = O(1/\epsilon)$ terms suffice, independent of $n$ for $n \ge k$.
- **Sparse approximation:** Retaining only largest $M$ coefficients yields operator-norm error $\leq \epsilon$; gate count $O(M)$.
- **CI encoding (minimal surjective set):** Number of terms $|J|=D$ for $D$ selected determinants gives CNOT count $O(D\,r)$; for partial expansion $|J|=O(D\log D)$, CNOT count $O(r\,D\log D)$ [2601.07037].

Ancilla-free realization is possible for unitaries; the block-ancilla construction appears only in the non-unitary (norm-not-preserving) VQCI context.

## 5. Applications in Quantum Simulation and VQCI

Diagonal Walsh operators provide highly efficient encoding mechanisms for major classes of quantum algorithms:

- **Quantum simulation:** Real-space simulation of Trotter steps $U \approx F^\dagger e^{-iK\Delta t} F e^{-iV\Delta t}$, with sampled $V(x)$, maps directly onto sparse Walsh expansions. For the classical Eckart barrier problem, high-fidelity simulation ($F > 0.98$) is achieved with circuit depth $\sim 60$ and only 30 largest Walsh components for $n=8$ qubits [1306.3991].

    | n(qubits) | $\epsilon$ (error) | M (#terms) | Gate count | Simulation Fidelity |
    |-----------|--------------------|------------|------------|---------------------|
    | 10        | exact              | 1023       | 2045       | 1.00                |
    | 8         | ~5%                | 30         | 60         | ~0.98               |
    | 7         | ~10%               | 19         | 38         | ~0.91               |
    | 6         | ~15%               | 14         | 28         | ~0.65               |

- **VQCI for electronic structure:** By an initial Dicke or quantum-walk state-preparation, followed by Walsh-encoded diagonal CI amplitude block, the entire configuration interaction (CI) space is compiled with gate counts $O(D)$–$O(D \log D)$ (for $D$ determinants), enabling practical scaling to large systems. Fidelity benchmarks for H$_2$, H$_6$, H$_2$O, LiH, BeH$_2$, NH$_3$ confirm chemical accuracy and outperform coupled-cluster in strongly correlated regimes [2601.07037].

    | Molecule | Qubits | Determinants $D$ | Subspace Prep CNOTs | Walsh Ansatz CNOTs | Total |
    |----------|--------|------------------|---------------------|--------------------|-------|
    | H$_6$    | 12     | 400              | 52                  | 726                | 778   |
    | H$_8$    | 16     | $>1000$          | 391                 | 8756               | 9147  |
    | LiH      | 12     | 400              | 96                  | 520                | 616   |
    | NH$_3$   | 16     | $>1000$          | 218                 | 7530               | 7748  |

This construction precludes barren-plateau trainability issues: the commuting nature of Walsh operators ensures the absence of 2-design structure in the ansatz.

## 6. Contextual Significance and Limitations

The resource scaling and modularity of diagonal Walsh operator schemes address a major barrier in quantum algorithm design—efficient implementation of diagonal operations, historically resource-bottlenecked and often requiring many ancilla qubits. The approach's absence of overparameterization and resilience to trainability plateaus (as seen in unitary coupled-cluster circuits) are central to its adoption in contemporary quantum algorithms in chemistry and other fields [2601.07037].

A plausible implication is that as quantum devices scale beyond $r\sim20$ qubits and as determinant subspace selection for CI becomes dominant in practical simulations, the advantages of Walsh operator sparsity and circuit efficiency could be increasingly central in quantum-classical hybrid methodologies.

## 7. References and Research Trajectory

The foundational construction and ancilla-free circuit compilation of diagonal unitaries using the Walsh basis were established in Welch, Greenbaum, Mostame, and Aspuru-Guzik [1306.3991], and systematically extended to non-unitary, full and partial CI encoding in variational quantum chemistry (VQCI) by Aydoğan, Gross, and coauthors [2601.07037]. As quantum algorithms for simulation and eigensolving evolve, the diagonal Walsh operator formalism continues to underpin efficient, scalable approaches to problems where diagonal structure and classical decomposability coincide with quantum resource constraints.

**Key References:**
- Welch, Greenbaum, Mostame, Aspuru-Guzik, "Efficient Quantum Circuits for Diagonal Unitaries Without Ancillas" [1306.3991]
- Aydoğan, Gross et al., "Subspace Selected Variational Quantum Configuration Interaction with a Partial Walsh Series" [2601.07037]

Source: https://www.emergentmind.com/topics/diagonal-walsh-operators