Table of Contents
Fetching ...

A fast and exact algorithm for stabilizer Rényi entropy via XOR-FWHT

Xuyang Huang, Han-Ze Li, Jian-Xin Zhong

TL;DR

This work tackles the computational bottleneck of evaluating the second-order stabilizer Rényi entropy (2-SRE) for generic $N$-qubit states by reformulating the Pauli-string sum as an XOR-convolution over bitstrings, revealed through a bitstring representation and the Walsh-Hadamard transform (WHT). The authors derive a deterministic, exact algorithm, the XOR-FWHT, which reduces the cost from naive $O(8^N)$ to $O(N4^N)$ by performing $d=2^N$ FWHTs of length $d$ and using a concise final expression $\mathcal{M}_2(|\psi\rangle) = -\log\left( \frac{1}{d} \sum_{x,k} |\mathrm{FWHT}(\phi_{x\oplus k}^* \phi_x)|^4 \right)$. They provide pseudocode, a Python implementation, and benchmarks showing accurate results for Haar-random states and dynamical models (e.g., XXZ and TFIM-LF), highlighting improved numerical precision and scalable, parallelizable performance. The method enables high-precision, medium-scale exact calculations of quantum magic and offers a foundation for studying its dynamical and scaling properties in many-body systems. The open-source availability and potential extensions to higher-order SREs further enhance its practical impact for quantum information and many-body physics research.

Abstract

Quantum advantage is widely understood to rely on key quantum resources beyond entanglement, among which nonstabilizerness (quantum ``magic'') plays a central role in enabling universal quantum computation. However, a direct brute-force enumeration of all Pauli strings and the corresponding expectation values from a length-$2^N$ state vector, where $N$ is the system size, yields an overall computational cost scaling as $O(8^N)$, which quickly becomes infeasible as the system size grows. Here we reformulate the second-order stabilizer Rényi entropy in a bitstring language, expose an underlying XOR-convolution structure on $\mathbb Z_2^N$, and reduce the computation to $2^N$ fast Walsh-Hadamard transforms of length, together with pointwise operations, yielding a deterministic and exact XOR fast Walsh-Hadamard transforms algorithm with runtime scaling $O(N4^N)$ and natural parallelism. This algorithm enables high-precision, medium-scale exact calculations for generic state vectors. It provides a practical tool for probing the scaling, phase diagnostics, and dynamical fine structure of quantum magic in many-body systems.

A fast and exact algorithm for stabilizer Rényi entropy via XOR-FWHT

TL;DR

This work tackles the computational bottleneck of evaluating the second-order stabilizer Rényi entropy (2-SRE) for generic -qubit states by reformulating the Pauli-string sum as an XOR-convolution over bitstrings, revealed through a bitstring representation and the Walsh-Hadamard transform (WHT). The authors derive a deterministic, exact algorithm, the XOR-FWHT, which reduces the cost from naive to by performing FWHTs of length and using a concise final expression . They provide pseudocode, a Python implementation, and benchmarks showing accurate results for Haar-random states and dynamical models (e.g., XXZ and TFIM-LF), highlighting improved numerical precision and scalable, parallelizable performance. The method enables high-precision, medium-scale exact calculations of quantum magic and offers a foundation for studying its dynamical and scaling properties in many-body systems. The open-source availability and potential extensions to higher-order SREs further enhance its practical impact for quantum information and many-body physics research.

Abstract

Quantum advantage is widely understood to rely on key quantum resources beyond entanglement, among which nonstabilizerness (quantum ``magic'') plays a central role in enabling universal quantum computation. However, a direct brute-force enumeration of all Pauli strings and the corresponding expectation values from a length- state vector, where is the system size, yields an overall computational cost scaling as , which quickly becomes infeasible as the system size grows. Here we reformulate the second-order stabilizer Rényi entropy in a bitstring language, expose an underlying XOR-convolution structure on , and reduce the computation to fast Walsh-Hadamard transforms of length, together with pointwise operations, yielding a deterministic and exact XOR fast Walsh-Hadamard transforms algorithm with runtime scaling and natural parallelism. This algorithm enables high-precision, medium-scale exact calculations for generic state vectors. It provides a practical tool for probing the scaling, phase diagnostics, and dynamical fine structure of quantum magic in many-body systems.
Paper Structure (13 sections, 33 equations, 2 figures, 1 algorithm)

This paper contains 13 sections, 33 equations, 2 figures, 1 algorithm.

Figures (2)

  • Figure 1: (a) The average 2-SRE $\mathcal{M}_2$ of Haar-random pure states as a function of the system size $N$. For each $N$, we independently sample $10-100$ Haar-random states and compute the average. The solid line shows the theoretically predicted behavior $\log_2(2^N+3)-2$, which is in good agreement with the numerical results, indicating that $\mathcal{M}_2$ of Haar states grows approximately linearly with $N$. (b) Time evolution of $\mathcal{M}_2$ in the dynamics of the XXZ model, comparing results obtained from the brute-force approach and from the XOR-FWHT algorithm proposed in this work. The two methods yield identical numerical results throughout the entire time evolution, verifying the correctness and stability of the XOR-FWHT algorithm in dynamical calculations.
  • Figure 2: Time evolution of the 2-SRE $\mathcal{M}_2$ for $N\!=\!16$ spins evolved under the TFIM with a longitudinal field. Starting from $100$ random product states, $\mathcal{M}_2(t)$ rapidly grows and saturates at a value slightly below the Haar-random benchmark (dashed line) within the accessible time window.