\documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amssymb,amsthm,mathtools} \usepackage{microtype} \usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref} \usepackage{enumitem} \usepackage{authblk} \setlength{\emergencystretch}{2em} \allowdisplaybreaks[2] \setlist[enumerate]{itemsep=0.35em,topsep=0.5em} \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newcommand{\Ftwo}{\mathbb F_2} \newcommand{\ket}[1]{\lvert #1\rangle} \newcommand{\bra}[1]{\langle #1\rvert} \newcommand{\poly}{\operatorname{poly}} \newcommand{\polylog}{\operatorname{polylog}} \newcommand{\Gap}{\operatorname{gap}} \newcommand{\CNOT}{\operatorname{CNOT}} \newcommand{\CZ}{\operatorname{CZ}} \newcommand{\CCZ}{\operatorname{CCZ}} \newcommand{\wt}{\operatorname{wt}} \newcommand{\TV}{d_{\mathrm{TV}}} \title{Subexponential-Time Classical Sampling of Quantum Circuits \\from Not ETH} \author[1]{Alexandru Gheorghiu} \author[2]{Aparna Gupte} \affil[1]{IBM Research} \affil[2]{Massachusetts Institute of Technology} \date{} \begin{document} \maketitle \begin{center} \fbox{% \begin{minipage}{0.9\textwidth} \centering \textbf{Note.} Writeup by ChatGPT Astra, based on ideas and feedback from the authors. \end{minipage}} \end{center} \vspace{1em} \begin{abstract} The recent subexponential-time algorithm for counting satisfying assignments of a $3$-CNF formula, together with the Boolean tensor-contraction theorem underlying its sharper bound, gives classical sampling algorithms for two families of quantum circuits. The first consists of $n$-qubit circuits with $O(n)$ gates from any fixed finite set of bounded-arity algebraic gates. The second consists of circuits over $\{H,Z,\CZ,\CCZ\}$ with $O(n)$ Hadamard gates and $d\leq n\,2^{o(\sqrt{\log n})}$ diagonal gates. More precisely, for $d\leq Cn^{11/10}$ with fixed $C$, we obtain exact worst-case sampling in time $n^{O(1)}2^{O(n\log(2+d/n)/\sqrt{\log n})}$ and polynomial space. We explain the reductions using Feynman sums over paths. Montanaro's construction~\cite{Mon17} gives a cubic polynomial with $O(n)$ variables and $O(n+d)$ monomials; an explicit density bound for polynomial-system counting yields the stated time. In both cases, each prefix probability is computed as a single circuit amplitude, and the chain rule gives a sample. The second sampler uses exactly as many fair bits as the circuit has Hadamards. \end{abstract} \section{Statements and conventions} \label{sec:statements} Let $U$ be a circuit on $n$ qubits, initialized in $\ket{0^n}$ and measured in the computational basis. Its output distribution is \[ p_U(z)=\bigl|\bra{z}U\ket{0^n}\bigr|^2, \qquad z\in\{0,1\}^n. \] We take the recent counting results of~\cite{OAI26} as input and derive the following two consequences. Throughout, logarithms are base two, $\polylog n$ means a fixed power of $\log n$, and subexponential time means $2^{o(n)}$ in the number of qubits. All running times count bit operations. Finitely many small input sizes can be handled by exhaustive computation. \begin{theorem}[Linear-size circuits] \label{thm:linear} Fix a finite set $\mathcal G$ of quantum gates, each acting on at most a constant number of qubits and having algebraic matrix entries. For every fixed $A>0$, the output of any $n$-qubit circuit over $\mathcal G$ with at most $An$ gates can be sampled exactly by a classical randomized algorithm in expected time \begin{equation} n^{O(1)}2^{O(n/\sqrt{\log n})}=2^{o(n)}. \label{eq:linear-time} \end{equation} For any $0<\varepsilon<1$, a sample within total variation distance $\varepsilon$ can instead be produced in worst-case time \[ 2^{O(n/\sqrt{\log n})}\poly\bigl(n,\log(1/\varepsilon)\bigr). \] The constants depend only on $\mathcal G$ and $A$. \end{theorem} The gate-set assumption gives a precise model for exact arithmetic. It includes, for example, the usual gate set $\{H,T,\CNOT\}$. The distinction between expected and worst-case time concerns the generation of exact random choices when probabilities are irrational; the probability computations themselves have deterministic time bounds. \begin{samepage} \begin{theorem}[A linear number of Hadamards and more diagonal gates] \label{thm:few-h} Assume Theorem~D.1 and Lemmas~5.1--5.2 of~\cite{OAI26}. Fix constants $A,C>0$. Let $U$ be an $n$-qubit circuit over $\{H,Z,\CZ,\CCZ\}$ with $h\leq An$ Hadamard gates and $d\leq Cn^{11/10}$ diagonal gates. Its output can be sampled exactly by a classical randomized algorithm in worst-case time \begin{equation} n^{O_{A,C}(1)} 2^{O_{A,C}(n\log(2+d/n)/\sqrt{\log n})} \label{eq:few-h-time} \end{equation} and polynomial space. Its random choices use exactly $h$ fair bits. The gate description is an explicit list of gate types and wire indices. \end{theorem} \end{samepage} The bound is subexponential whenever $\log(2+d/n)=o(\sqrt{\log n})$, equivalently $d\leq n\,2^{o(\sqrt{\log n})}$. For $d=O(n\polylog n)$ it recovers the exponent $O(n\log\log n/\sqrt{\log n})$. It also permits, for example, $d=n\,2^{(\log n)^{1/3}}$, giving exponent $O(n/(\log n)^{1/6})$. At the technical endpoint $d=Cn^{11/10}$, \eqref{eq:few-h-time} gives exponent $O(n\sqrt{\log n})$ and does not certify subexponential time. The proof has three steps: compute a prefix probability as one amplitude, express that amplitude by exact counts, and choose the output bits using conditional probabilities. For the second theorem we retain the monomial density explicitly in the polynomial-system construction of~\cite{OAI26}, following the strengthened argument in~\cite{Density26}. This requires the full contraction theorem. The fixed polylogarithmic-density counting statement alone does not cover an input-dependent exponent of $\log n$. \section{The counting results} \label{sec:counting} We use two counting statements. The first is the fixed-density case of \cite[Theorem~1.1]{OAI26}. The second extends the incidence construction of~\cite[Lemma~D.2]{OAI26} to an explicit monomial-density parameter. We give its proof in Appendix~\ref{app:density}, using \cite[Theorem~D.1 and Lemmas~5.1--5.2]{OAI26}. All constants in the hypotheses are fixed independently of the input size; the parameter $B$ in part~\textup{(ii)} may depend on the input. \begin{theorem}[Counting results] \label{thm:counting} \leavevmode \begin{enumerate}[label=(\roman*)] \item For each fixed $D>0$, the number of satisfying assignments of a $3$-CNF formula with $N$ variables and at most $DN$ clauses can be computed deterministically in \[ N^{O(1)}2^{O(N/\sqrt{\log N})} \] time and polynomial space. \item Fix an integer $k\geq1$ and constants $c,C>0$. Suppose that $P_1,\ldots,P_a$ are polynomials over $\Ftwo$ in $N\geq20$ declared Boolean variables, where $a\leq cN$. Each $P_i$ has degree at most $k$ and is specified by at most $B$ monomials, with $1\leq B\leq CN^{1/10}$. Assuming \cite[Theorem~D.1 and Lemmas~5.1--5.2]{OAI26}, their common zeros can be counted deterministically in \[ N^{O_{k,c,C}(1)} 2^{O_{k,c,C}(N\log(B+2)/\sqrt{\log N})} \] time and polynomial space. \end{enumerate} \end{theorem} Bounded values of $N$ can be handled by enumeration. When $B=O((\log N)^c)$ for a fixed $c$, part~\textup{(ii)} has exponent $O(N\log\log N/\sqrt{\log N})$, as in the original sparse-polynomial statement. Its explicit dependence on $B$ is what permits more diagonal gates in Theorem~\ref{thm:few-h}. \section{From prefix probabilities to samples} \label{sec:prefixes} For a string $a\in\{0,1\}^{\ell}$, define its prefix probability by \begin{equation} p_U(a)=\sum_{b\in\{0,1\}^{n-\ell}}p_U(ab). \label{eq:prefix} \end{equation} In particular, $p_U(\varnothing)=1$ and $p_U(a)=p_U(a0)+p_U(a1)$. Starting from the empty prefix, choose the next bit to be $0$ with probability \begin{equation} q(a)=\frac{p_U(a0)}{p_U(a)}, \label{eq:conditional} \end{equation} and choose $1$ otherwise. Every prefix reached with positive probability has a positive denominator. For any output $z$ of positive probability, the chance that this procedure produces $z$ is \[ \prod_{j=1}^n \frac{p_U(z_1\cdots z_j)}{p_U(z_1\cdots z_{j-1})} =p_U(z). \] Zero-probability outputs are never chosen. Since the current value $p_U(a)$ can be retained and $p_U(a1)$ obtained by subtraction, only one new prefix-probability computation is needed per output bit. \subsection{A prefix probability is one amplitude} The sum in~\eqref{eq:prefix} can be represented without enumerating its $2^{n-\ell}$ terms. Add $\ell$ ancilla qubits initialized to zero, and let $C_\ell$ copy the first $\ell$ computational-basis bits into these ancillas: \[ C_\ell\ket{z}\ket{0^\ell} =\ket{z}\ket{z_1\cdots z_\ell}. \] This unitary is a product of $\ell$ CNOT gates. For $a\in\{0,1\}^{\ell}$, let $X^a=\bigotimes_{j=1}^{\ell}X^{a_j}$ and set \begin{equation} V_a=(I\otimes X^a)(U^\dagger\otimes I)C_\ell(U\otimes I). \label{eq:prefix-circuit} \end{equation} \begin{lemma} \label{lem:prefix-amplitude} The circuit $V_a$ acts on $n+\ell$ qubits and satisfies \begin{equation} \bra{0^{n+\ell}}V_a\ket{0^{n+\ell}}=p_U(a). \label{eq:prefix-amplitude} \end{equation} If $U$ has $s$ gates, then $V_a$ has at most $2s+2\ell$ gates, using the original gates, their adjoints, CNOT, and $X$. \end{lemma} \begin{proof} Write $\alpha_z=\bra{z}U\ket{0^n}$. Immediately after $C_\ell$, the state is \[ \sum_z\alpha_z\ket{z}\ket{z_1\cdots z_\ell}. \] The final ancilla bra selects exactly the strings with prefix $a$, while $\bra{0^n}U^\dagger\ket{z}=\overline{\alpha_z}$. The amplitude in \eqref{eq:prefix-amplitude} is therefore $\sum_{z:z_{1:\ell}=a}|\alpha_z|^2=p_U(a)$. The gate count follows directly from~\eqref{eq:prefix-circuit}. \end{proof} Thus sampling reduces to $n$ amplitude computations for circuits whose size increases only by a constant factor and an additive $O(n)$ term. Equation~\eqref{eq:prefix-amplitude} is an equality with the probability itself; its right-hand side is already the squared-amplitude sum required by the Born rule. \section{Linear-size circuits: paths and 3-CNF formulas} \label{sec:linear} Let $W=G_s\cdots G_1$ be a circuit on $r$ qubits. Inserting computational-basis states between successive gates gives its Feynman sum over paths. A path specifies the basis bits on the wires as the circuit is traversed; its weight is the product of the corresponding gate entries. For fixed input $x$ and output $y$, \begin{equation} \bra{y}W\ket{x} =\sum_{\pi:x\longrightarrow y}\prod_{j=1}^s g_j(\pi), \label{eq:path-sum} \end{equation} where $g_j(\pi)$ is the local matrix entry of gate $G_j$ along the path. The number of Boolean variables needed to describe a path is $O(r+s)$. To see this, keep the current bit label on every wire and introduce new labels only for the output wires of the next gate. A gate of bounded arity introduces only constantly many labels. Bits on the other wires retain their labels. Input and output conditions fix the labels at the boundary. \subsection{Grouping paths with the same weight} For a fixed finite gate set, there are only constantly many distinct nonzero gate entries. List them as $\beta_1,\ldots,\beta_R$, where $R$ is a constant. Discard paths containing a zero entry. If a path uses $\beta_j$ exactly $m_j$ times, its weight is $\prod_j\beta_j^{m_j}$. Hence \begin{equation} \bra{y}W\ket{x} =\sum_{\substack{\mathbf m\in\mathbb Z_{\geq0}^R\\ m_1+\cdots+m_R=s}} N_{\mathbf m}\prod_{j=1}^R\beta_j^{m_j}, \label{eq:grouped-paths} \end{equation} where $N_{\mathbf m}$ is the number of paths with the indicated multiplicities and boundary conditions. There are at most $(s+1)^R$ vectors to consider. For each $\mathbf m$, these conditions can be checked by a Boolean circuit of size $O(r+s)$. Each gate's local transition and entry type are determined by constantly many path bits. To count how often a given type occurs, add its $s$ indicator bits using a balanced binary tree of adders. At level $j$ there are $O(s/2^j)$ additions of $O(j)$-bit numbers, so the total number of Boolean gates is \[ O\!\left(\sum_{j\geq1}\frac{s j}{2^j}\right)=O(s). \] Comparison with the required multiplicities and checking the boundary conditions also fit within $O(r+s)$ gates. \subsection{Preserving the count in the conversion to 3-CNF} Introduce one auxiliary variable for each gate of this Boolean checking circuit, and impose clauses expressing its exact value. For example, $w=u\wedge v$ is expressed by \[ (\neg w\vee u)\ \wedge\ (\neg w\vee v)\ \wedge\ (w\vee\neg u\vee\neg v). \] The constraints for OR and NOT are equally small. Finally, require the checking circuit's output to equal $1$. For every assignment to the path bits, the auxiliary gate values are uniquely determined. Consequently, the number of satisfying assignments of the resulting $3$-CNF formula is exactly $N_{\mathbf m}$. The formula has $O(r+s)$ variables and clauses, with a constant clause-to-variable ratio. Theorem~\ref{thm:counting}(i) therefore computes each count in \[ \poly(r+s)\,2^{O((r+s)/\sqrt{\log(r+s)})} \] time. The polynomial number of multiplicity vectors does not change the exponential factor. All the $\beta_j$ lie in a fixed number field. Products of at most $s$ such entries, and their sums with the integer coefficients $N_{\mathbf m}\leq 2^{O(r+s)}$, have exact representations using polynomially many bits. Thus the arithmetic in~\eqref{eq:grouped-paths} adds only polynomial time. We have proved the following amplitude bound. \begin{proposition} \label{prop:linear-amplitude} For a fixed finite set of bounded-arity algebraic gates, an amplitude of an $r$-qubit, $s$-gate circuit can be computed exactly in \[ \poly(r+s)\,2^{O((r+s)/\sqrt{\log(r+s)})} \] deterministic time and polynomial space. \end{proposition} For a circuit in Theorem~\ref{thm:linear}, every $V_a$ from Lemma~\ref{lem:prefix-amplitude} has $r+s=O(n)$. Enlarging the fixed gate set by adjoints, CNOT, and $X$ preserves the hypotheses of Proposition~\ref{prop:linear-amplitude}. Every prefix probability is therefore available within~\eqref{eq:linear-time}. The chain rule and the random-choice implementation in Section~\ref{sec:randomness} prove Theorem~\ref{thm:linear}. \section{Few Hadamards: cubic polynomials over \texorpdfstring{$\Ftwo$}{F2}} \label{sec:few-h} For the gate set $\{H,Z,\CZ,\CCZ\}$, the path sum has a simpler form. Diagonal gates preserve the basis labels and contribute signs. Only Hadamards introduce new path variables. This is the reason that the number of Hadamards controls the number of variables even when there are many diagonal gates. \subsection{Montanaro's construction} Use the following form of Montanaro's circuit-polynomial correspondence \cite[Proposition~1]{Mon17}. Suppose an $r$-qubit circuit $C$ starts and ends with $H^{\otimes r}$, and its interior has $t$ Hadamards and $d$ diagonal gates. Give a variable to each wire segment between interior Hadamards. There are $N=r+t$ variables. Add a term to $f_C$ for each interior gate: \[ H:\ uv,\qquad Z:\ u,\qquad \CZ:\ uv,\qquad \CCZ:\ uvw, \] using the variables on its incident segments. Addition is over $\Ftwo$. The polynomial has degree at most three and at most $t+d$ monomials. Since \[ \bra{v}H\ket{u}=2^{-1/2}(-1)^{uv}, \] the path expansion gives \begin{equation} \bra{0^r}C\ket{0^r} =2^{-r-t/2}\Gap(f_C), \qquad \Gap(f)=\sum_{x\in\{0,1\}^N}(-1)^{f(x)}. \label{eq:montanaro} \end{equation} Writing $Z(f)=|\{x:f(x)=0\}|$, we have \begin{equation} \Gap(f)=2Z(f)-2^N. \label{eq:gap} \end{equation} An arbitrary $r$-qubit circuit $W$ can be put in the required form as $H^{\otimes r}(H^{\otimes r}WH^{\otimes r})H^{\otimes r}$, adding $4r$ Hadamards without changing $W$. For example, $H^{\otimes3}\CCZ H^{\otimes3}$ gives $f(x)=x_1x_2x_3$. It has seven zeros and one one, so its all-zero amplitude is $(7-1)/8=3/4$ and its all-zero output probability is $9/16$. \subsection{Counting a cubic polynomial with many monomials} The polynomial in~\eqref{eq:montanaro} may have many more monomials than variables. We distribute its monomials among linearly many equations, using only $O(N)$ additional variables. This makes the density in Theorem~\ref{thm:counting}(ii) proportional to the number of monomials per original variable. \begin{lemma} \label{lem:cubic-count} Fix $C>0$. Under the assumptions of Theorem~\ref{thm:counting}(ii), let $f$ be a degree-at-most-three polynomial over $\Ftwo$ on $N$ Boolean variables, specified by at most $M\leq CN^{11/10}$ monomials. Its number of zeros and its gap can be computed exactly in \[ N^{O_C(1)}2^{O_C(N\log(2+M/N)/\sqrt{\log N})} \] time and polynomial space. \end{lemma} \begin{proof} Constant polynomials can be handled directly. Otherwise, set $B=\max\{1,\lceil M/N\rceil\}$, partition the monomials into $q\leq N$ groups of at most $B$ terms, and write \[ f(x)=f_1(x)+\cdots+f_q(x) \qquad\text{over }\Ftwo. \] Introduce variables $y_1,\ldots,y_q$ for the successive partial sums and impose \begin{align} y_1+f_1(x)&=0,\notag\\ y_j+y_{j-1}+f_j(x)&=0 &&(2\leq j\leq q),\label{eq:partial-sums}\\ y_q&=0.\notag \end{align} Once $x$ is fixed, the first $q$ equations uniquely determine $y_j=\sum_{i\leq j}f_i(x)$. The last equation holds exactly when $f(x)=0$. The number of common zeros of~\eqref{eq:partial-sums} is therefore $Z(f)$, with no multiplicative correction. The system has $N'=N+q\in[N,2N]$ variables and at most $N+1$ equations. Every equation has degree at most three and at most $B+2$ monomials. Moreover, \[ B+2\leq CN^{1/10}+3\leq(C+3)(N')^{1/10}. \] Theorem~\ref{thm:counting}(ii) applies with fixed constants depending only on $C$. Since $N'=\Theta(N)$ and $\log(B+4)=O(\log(2+M/N))$, it gives $Z(f)$ in the stated time. Equation~\eqref{eq:gap} then gives $\Gap(f)$. \end{proof} The reduction uses one new variable per group. There are at most $N$ groups even as their size grows with the monomial density. \subsection{Applying the construction to prefix probabilities} Let $U$ have $h$ Hadamards and $d$ diagonal gates. All four gates in this gate set are self-adjoint. In the prefix circuit~\eqref{eq:prefix-circuit}, replace each CNOT and each $X$ by \[ \CNOT_{u\to v}=H_v\CZ_{u,v}H_v, \qquad X=HZH. \] For a prefix of length $\ell$, write $\wt(a)$ for its number of ones. The resulting $V_a$ acts on $r=n+\ell\leq 2n$ qubits and has \begin{align} h_a&=2h+2\ell+2\wt(a)\leq 2h+4n,\label{eq:prefix-h}\\ d_a&=2d+\ell+\wt(a)\leq 2d+2n.\label{eq:prefix-d} \end{align} Pad it with boundary Hadamards as above. Its number of interior Hadamards is $t_a=h_a+2r$, so Montanaro's polynomial has \begin{equation} N_a=r+t_a=h_a+3r=2h+3n+5\ell+2\wt(a) \label{eq:linear-variables} \end{equation} variables. In particular, $3n\leq N_a\leq(2A+10)n$. Its number $M_a$ of listed monomials satisfies \[ M_a\leq t_a+d_a =N_a+2d-n+\wt(a)\leq N_a+2d. \] Thus $d\leq Cn^{11/10}$ implies $M_a\leq(1+2C)N_a^{11/10}$, within the fixed-constant range of Lemma~\ref{lem:cubic-count}. Also \[ N_a=\Theta_A(n),\qquad \log(2+M_a/N_a)=O(\log(2+d/n)). \] Combining Lemma~\ref{lem:prefix-amplitude} with~\eqref{eq:montanaro} gives the exact prefix probability \begin{equation} p_U(a)=2^{-r-t_a/2}\bigl(2Z(f_a)-2^{N_a}\bigr). \label{eq:prefix-count} \end{equation} The integer $h_a$ is even, so $t_a$ is even and the denominator here is an integer power of two. Lemma~\ref{lem:cubic-count} computes this probability within~\eqref{eq:few-h-time}. Repeating for at most $n$ prefixes preserves that bound. The exact sampling procedure below completes the proof of Theorem~\ref{thm:few-h}. \section{Implementing the random choices} \label{sec:randomness} \subsection{Algebraic probabilities} For Theorem~\ref{thm:linear}, every prefix probability is a real element of a fixed number field whose coordinates use polynomially many bits. The same is true of a conditional probability $q\in[0,1]$ from~\eqref{eq:conditional}. Arithmetic and order comparisons in this fixed field take polynomial time in the bit length of their inputs. To generate a Bernoulli random variable with success probability $q$, expose independent fair bits of a uniform number $R\in[0,1]$. After $b$ bits, $R$ lies in a known half-open dyadic interval $I_b=[u_b,v_b)$ of length $2^{-b}$. If $v_b\leq q$, declare success; if $u_b\geq q$, declare failure. Otherwise expose another bit. The event $R=q$ has probability zero. The probability of being undecided after $b$ bits is at most $2^{-b}$. Each comparison costs $\poly(n+b)$ time, so the expected arithmetic overhead is polynomial in $n$. The procedure halts with probability one and makes the exact conditional choice. Together with the $n$ prefix computations, this proves the exact expected-time claim. For a worst-case bound, stop after $L=\lceil\log_2(n/\varepsilon)\rceil$ bits for each conditional choice, resolving any remaining ambiguity arbitrarily. Couple this procedure to the exact sampler using the same random bits. At each step the conditional chance of an unresolved comparison is at most $2^{-L}$; the chance of any discrepancy is at most $n2^{-L}\leq\varepsilon$. Consequently the output distribution $\widetilde p$ satisfies \[ \TV(p_U,\widetilde p) :=\frac12\sum_z|p_U(z)-\widetilde p(z)|\leq\varepsilon. \] The additional worst-case work is $\poly(n,\log(1/\varepsilon))$, as stated in Theorem~\ref{thm:linear}. \subsection{A finite exact sampler for the second gate set} For a circuit over $\{H,Z,\CZ,\CCZ\}$ with $h$ Hadamards, each path has weight $\pm2^{-h/2}$. Every output amplitude is therefore $A_z2^{-h/2}$ for an integer $A_z$, and \begin{equation} p_U(z)=\frac{A_z^2}{2^h},\qquad W(a):=2^h p_U(a)\in\mathbb Z_{\geq0}. \label{eq:integer-weights} \end{equation} Although the ratios in~\eqref{eq:conditional} need not be dyadic, all prefix weights in~\eqref{eq:integer-weights} are integers with a common denominator. This permits exact sampling with a fixed number of fair bits: \begin{enumerate} \item Draw a uniform integer $R\in\{0,\ldots,2^h-1\}$ using $h$ fair bits, and start with $a=\varnothing$. \item Compute $W(a0)$. If $R0$. Consider a bipartite tensor network whose edge indices are Boolean, with at most $C_0s$ edges, maximum degree at most $\lceil s^{9/10}\rceil$, and polynomially many vertices. Its entries belong to \[ (\mathbb Z/2^{P_0}\mathbb Z)[V]/(V^\ell), \qquad 1\leq P_0,\ell\leq C_0s. \] Suppose the network and its entry procedures have total description length $L$. Each entry must be computable uniformly in time $(s+L)^{b_0}2^{A_0s^{9/10}}$ and space $(s+L)^{b_0}$. The theorem computes the contraction deterministically in \[ (s+L)^{O(1)}2^{O(s/\sqrt{\log s})} \] time and polynomial space. The constants depend on the fixed constants in these hypotheses. In particular, tensors are specified by procedures for evaluating their entries; an explicit table of all entries is not required. A contraction sums, over all assignments to the edge indices, the product of the entries at the vertices. \subsection{Controlling variable occurrences} First multilinearize each input polynomial and cancel repeated monomials over $\Ftwo$. A constant-one equation makes the answer zero. Discard constant-zero equations, returning $2^N$ if none remain. Let $I_i$ be the set of variables occurring in $P_i$. Then \[ |I_i|\leq kB,\qquad E_0:=\sum_i|I_i|\leq kcNB. \] An incidence is a pair $(i,v)$ with $v\in I_i$. We first fix variables that occur in many equations. Put \[ \lambda=\lceil\log N\rceil,\qquad D_* = \max\{1,\lceil E_0/N\rceil\}\lceil\sqrt\lambda\rceil. \] At most $E_0/D_*\leq N/\sqrt\lambda$ variables occur in more than $D_*$ sets $I_i$. Enumerate their assignments, creating at most $2^{N/\sqrt\lambda}$ disjoint branches. On each branch normalize the remaining equations again. A constant-one equation gives branch count zero. Discard constant-zero equations; if none remain, the branch count is two to the power of the number of free variables. Every free variable now occurs in at most \[ D_*=O_{k,c}(B\sqrt{\log N}) \] equations, and each remaining equation still involves at most $kB$ variables. Free variables absent from every equation remain declared. We retain the original $N$ in all precision and size bounds, and use $a\leq cN$ for the number of remaining equations on a branch. \subsection{A bounded-degree expression for the count} For one branch, give each incidence $(i,v)$ its own formal variable $z_{iv}$. Let $L_i(z_i)$ be the integer polynomial obtained from $P_i$ by interpreting its monomials over the integers and replacing $x_v$ by $z_{iv}$. The parity lift in~\cite[Lemmas~5.1--5.2]{OAI26} provides integer polynomials $e_0,\ldots,e_N$ of degree at most one such that \begin{equation} \sum_{j=0}^N e_j(Y)\bigl(Y(Y-1)\bigr)^j \equiv \mathbf 1_{\{Y\text{ even}\}}\pmod{2^{N+1}} \qquad(Y\in\mathbb Z). \label{eq:parity-lift} \end{equation} Their coefficients have polynomial bit length and can be constructed in polynomial time. Work over the ring \[ \mathcal R=(\mathbb Z/2^{N+1}\mathbb Z)[V]/(V^{N+1}) \] and form \begin{equation} B_i(z_i,V)=\sum_{j=0}^N e_j\bigl(L_i(z_i)\bigr) \bigl(L_i(z_i)(L_i(z_i)-1)\bigr)^j V^j. \label{eq:lifted-test} \end{equation} Multilinearize each coefficient in the incidence variables. This leaves its values on Boolean inputs unchanged. Variables belonging to different equations are distinct, so \[ F(z,V)=\prod_{i=1}^a B_i(z_i,V) \] is multilinear in all incidence variables. The coefficient of $V^j$ has total incidence degree at most $k(a+2j)$: a product using exponents $j_1,\ldots,j_a$ has degree at most $\sum_i k(1+2j_i)$, and $\sum_i j_i=j$. Thus every incidence monomial surviving the truncation has degree at most \[ K=k(a+2N)=\Theta_{k,c}(N). \] Let $S_{N+1}$ sum the coefficients of $1,V,\ldots,V^N$ in $\mathcal R$. The branch count, modulo $2^{N+1}$, is \begin{equation} S_{N+1}\left( \sum_{x\text{ free Boolean}} F\bigl((z_{iv}=x_v)_{iv},V\bigr) \right). \label{eq:branch-count} \end{equation} To see this, first multiply the expressions in~\eqref{eq:parity-lift} with $Y=L_i(x)$. Their product is the indicator that all equations hold. Every factor $L_i(x)(L_i(x)-1)$ is even. Hence a term of total $V$-degree at least $N+1$ is divisible by $2^{N+1}$ and can be omitted. Summing the remaining coefficients gives~\eqref{eq:branch-count}. The coefficient-sum map is applied after multiplication. \subsection{Encoding the incidence monomials} Partition the equations and the free variables separately into $J=\lceil N^{1/4}\rceil$ groups of sizes differing by at most one. Write $T_g$ for an equation group and $X_h$ for a variable group. Let $E_{gh}$ count the incidences between these two groups, and set $E=\sum_{g,h}E_{gh}\leq E_0$. Enumerate the integer arrays $(d_{gh})$ with $0\leq d_{gh}\leq E_{gh}$ and $\sum_{g,h}d_{gh}\leq K$. There are at most \[ (K+1)^{J^2}=2^{O_{k,c}(\sqrt N\log N)} \] such arrays. For a fixed array, create one vertex for each group and join $T_g$ to $X_h$ by \[ \left\lceil\log\binom{E_{gh}}{d_{gh}}\right\rceil \] Boolean edges. The bits on these edges index a subset of $d_{gh}$ incidences, in a fixed order agreed by both endpoints. An index beyond the number of subsets gives entry zero. If the binomial coefficient is one, no edge is needed. Ranking and unranking these subsets use polynomial-time arithmetic on binomial coefficients of polynomial bit length. The number of edges is at most \begin{align*} J^2+\log\prod_{g,h}\binom{E_{gh}}{d_{gh}} &\leq J^2+\log\binom{E+K}{K}\\ &\leq J^2+K\log\left(\frac{e(E+K)}{K}\right)\\ &=O_{k,c}\bigl(N\log(B+2)\bigr). \end{align*} For the first inequality, the indexed choices are subsets of at most $K$ of the $E$ incidences. There are at most $\binom{E+K}{K}$ such subsets: encode one by a multiset of size $K$ from the $E$ incidences and one extra padding symbol. The final bound uses $E=O_{k,c}(NB)$ and $K=\Theta_{k,c}(N)$. This is the source of the factor $\log(B+2)$. We next specify the tensor entries. At an equation-group vertex, the incident edge values determine a subset $S_i\subseteq I_i$ for each $i\in T_g$. Write $z_{i,S_i}=\prod_{v\in S_i}z_{iv}$. The entry is the following element of $\mathcal R$: \[ \prod_{i\in T_g}[z_{i,S_i}]B_i(z_i,V). \] Each coefficient can be found from Boolean evaluations by \begin{equation} [z_{i,S_i}]B_i =\sum_{T\subseteq S_i}(-1)^{|S_i|-|T|}B_i(\mathbf1_T,V), \label{eq:mobius-entry} \end{equation} where $\mathbf1_T$ sets precisely the variables in $T$ to one and all other incidence variables of that equation to zero. Expanding a multilinear polynomial in this sum cancels every monomial except $z_{i,S_i}$. Since $|S_i|\leq kB$, there are at most $2^{kB}$ evaluations, each taking polynomial time using~\eqref{eq:lifted-test}. Compute and multiply the coefficients for the equations one at a time. An entry therefore takes $N^{O(1)}2^{O_k(B)}$ time and polynomial space. At a variable-group vertex, let $b_v$ be the number of selected incidences involving $v\in X_h$. Its entry is \[ \sum_{x\in\{0,1\}^{X_h}}\prod_{v\in X_h}x_v^{b_v} =2^{|\{v\in X_h:b_v=0\}|}\pmod{2^{N+1}}. \] An exponent zero contributes the constant one; a positive exponent requires $x_v=1$. This entry is computable in polynomial time and accounts for free variables absent from every equation. Every incidence monomial of $F$ belongs to exactly one degree array and has exactly one valid subset index for each pair of groups. The equation-group entries supply its coefficient, and the variable-group entries sum its value over assignments after the incidences of each variable are identified. Summing the contractions over all arrays therefore gives the expression inside $S_{N+1}$ in~\eqref{eq:branch-count}. \subsection{Checking the time and space bounds} An equation group contains $O_c(N^{3/4})$ equations, each with at most $kB$ incidences. A variable group contains $O(N^{3/4})$ variables, each in at most $D_*$ equations. Since $\lceil\log\binom{E_{gh}}{d_{gh}}\rceil\leq E_{gh}$, every vertex has degree at most \[ O_{k,c}\bigl(N^{3/4}B\sqrt{\log N}\bigr) \leq O_{k,c,C}\bigl(N^{17/20}\sqrt{\log N}\bigr). \] Set $s=\lceil N\log(B+2)\rceil$. For all sufficiently large $N$, this degree is at most $\lceil s^{9/10}\rceil$. There are $2J$ vertices and $O_{k,c}(s)$ edges. The graph and entry procedures have polynomial-size descriptions, and the precision and truncation order $N+1$ are $O(s)$. Finally, the entry cost $N^{O(1)}2^{O_k(B)}$ is within the allowed $N^{O(1)}2^{O(s^{9/10})}$, with polynomial space. The contraction theorem thus applies. Since $\log s=\Theta(\log N)$ throughout $1\leq B\leq CN^{1/10}$, each contraction takes \[ N^{O_{k,c,C}(1)}2^{O_{k,c,C}(s/\sqrt{\log s})} =N^{O_{k,c,C}(1)} 2^{O_{k,c,C}(N\log(B+2)/\sqrt{\log N})} \] time and polynomial space. Multiplying by the number of branches and degree arrays preserves this bound: their exponents are $O(N/\sqrt{\log N})$ and $O(\sqrt N\log N)$. Process the branches and arrays sequentially, applying $S_{N+1}$ and adding branch counts modulo $2^{N+1}$. All ring elements and accumulators have polynomial size. The total number of common zeros lies in $[0,2^N]$, so its least nonnegative residue modulo $2^{N+1}$ is the exact answer. This proves Theorem~\ref{thm:counting}(ii). \clearpage \begin{thebibliography}{OAI26} \bibitem[OAI26]{OAI26} OpenAI. \newblock \emph{The Exponential Time Hypothesis is False}. \newblock Manuscript, 17 October 2026; revised 25 October 2026. \newblock \href{https://github.com/openai/math/tree/main/preprints/The-Exponential-Time-Hypothesis-is-False-October-25-2026}{Manuscript and source}. The inputs used here are Theorem~1.1, Theorem~D.1, and Lemmas~5.1--5.2. The proof of Lemma~D.2 supplies the incidence construction extended in Appendix~\ref{app:density}. \bibitem[Den26]{Density26} \emph{Exact Quantum Sampling with More Diagonal Gates: A density extension with explicit hypotheses and parameter bounds}. \newblock Unpublished note, 30 October 2026. Theorem~1.1, Theorem~2.1, and Corollary~2.2. \bibitem[Mon17]{Mon17} Ashley Montanaro. \newblock Quantum circuits and low-degree polynomials over $\Ftwo$. \newblock \emph{Journal of Physics A: Mathematical and Theoretical}, 50(8):084002, 2017. \newblock \href{https://doi.org/10.1088/1751-8121/aa565f}{doi:10.1088/1751-8121/aa565f}. \href{https://arxiv.org/abs/1607.08473}{arXiv:1607.08473}. \bibitem[Ghe26]{Ghe26} Alexandru Gheorghiu. \newblock Announcement of joint work with Aparna Gupte. \newblock Comment on \emph{New Results Related to ETH}, ETH: Community Examination and Discussion, 3 November 2026. \newblock \href{https://ethdiscussion.blog/2026/11/01/announce-your-results/comment-page-1/#comment-55}{Online announcement}. \bibitem[Tul26]{Tul26} Vaibhav Tulsyan. \newblock \emph{Exact amplitudes of sparse quantum circuits in subexponential time, assuming the new \#SAT algorithms}. \newblock Hexagon preprint 2611.00090v1, 4 November 2026. \newblock \href{https://hexagonmath.org/2611.00090v1}{Manuscript}. \end{thebibliography} \end{document}