\documentclass[11pt]{amsart} \usepackage{amssymb,amsmath,booktabs} \usepackage{array} \usepackage{float} \usepackage[margin=1in]{geometry} \usepackage{microtype} \usepackage{tikz} \usetikzlibrary{calc,shapes.geometric} \definecolor{unknownK}{gray}{0.90} \definecolor{priorK}{RGB}{212,228,244} \definecolor{ruledBefore}{RGB}{236,170,166} \definecolor{ruledNow}{RGB}{194,44,40} \definecolor{holdsK}{RGB}{32,215,72} \usepackage[colorlinks=true,urlcolor=blue,linkcolor=black,citecolor=black]{hyperref} \usepackage[all]{hypcap} \hypersetup{pdftitle={Exact and Modular Counting Dichotomies for Group-Labeled Perfect Matchings},pdfauthor={Dave Goel}} \newtheorem{theorem}{Theorem}[section] \newtheorem{corollary}[theorem]{Corollary} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newcommand{\F}{\mathbb{F}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\C}{\mathbb{C}} \newcommand{\GR}{\mathrm{GR}} \newcommand{\Ab}{\mathrm{Ab}} \newcommand{\Cp}{\mathcal{C}_p} \newcommand{\Qf}{\mathcal{Q}_4} \newcommand{\M}{\mathcal{M}} \newcommand{\IS}{\mathrm{IS}} \newcommand{\Haf}{\operatorname{Haf}} \newcommand{\Pf}{\operatorname{Pf}} \newcommand{\Tr}{\operatorname{Tr}} \newcommand{\Ad}{\operatorname{Ad}} \newcommand{\Irr}{\operatorname{Irr}} \newcommand{\Arf}{\operatorname{Arf}} \newcommand{\ord}{\mathrm{ord}} \newcommand{\tw}{\operatorname{tw}} \newcommand{\PSL}{\mathrm{PSL}} \newcommand{\SL}{\mathrm{SL}} \newcommand{\GL}{\mathrm{GL}} \newcommand{\Sz}{\mathrm{Sz}} \newcommand{\id}{\mathrm{id}} \newcommand{\one}{\mathbf{1}} \newcommand{\paperversion}{1.00} \newcommand{\paperdate}{November 30, 2026} \newcommand{\paperfirstdate}{November 29, 2026} \title{Exact and Modular Counting Dichotomies for Group-Labeled Perfect Matchings} \author{Dave Goel} \gdef\fnone{\raggedright Expanded version, with further results~\cite{GoelExpanded}: \url{https://doi.org/10.5281/zenodo.24677022}\spacefactor=3000 } \skip\footins=7pt plus 11pt minus 3pt \renewcommand{\topfraction}{0.85} \renewcommand{\bottomfraction}{0.85} \renewcommand{\textfraction}{0.10} \renewcommand{\floatpagefraction}{0.60} \begin{document} \maketitle\footnotetext[1]{\fnone} \vspace{-12pt} \begin{center} \footnotesize First version: \paperfirstdate. This version (\paperversion): \paperdate. \end{center} \begin{abstract} We introduce and classify the counting complexity of edge-ordered group-labeled perfect matchings. Fix a finite group $\Gamma$ and an integer modulus $q \ge 2$. Given a simple graph $G = (V, E)$ with edge labels $w : E \to \Gamma$, a target $g^* \in \Gamma$, and a global edge ordering $e_1 < \dots < e_m$, let $\#\M_{g^*}^\Gamma(G)$ count the perfect matchings $M$ of $G$ whose ordered product $\prod_{e \in M}^{\ord} w(e)$ equals $g^*$. The order is arbitrary and may interleave edges across distinct components. While Kasteleyn's Pfaffian method solves this problem in polynomial time for abelian groups on planar graphs, the non-abelian case has not been classified. We establish two complete complexity classifications across every finite group $\Gamma$ and every modulus $q \ge 2$. First, on planar, bounded-treewidth ($\tw \le c$, $c \ge 2$), and $O(\log n)$-genus graphs (given a cellular embedding), modular counting $\#\M_{g^*}^\Gamma(G) \bmod q$ obeys a complete trichotomy: (I)~for abelian $\Gamma$, exact and modular counting lie in deterministic $\mathsf{NC}^2$ (planar and bounded treewidth) and $\mathsf{P}$ (genus $O(\log n)$); (II)~for non-abelian $\Gamma \in \Cp$ (having a normal Sylow $p$-subgroup with abelian quotient), counting modulo $q = p^e$ lies in deterministic $\mathsf{NC}^2$ (planar and bounded treewidth) and $\mathsf{P}$ (genus $O(\log n)$) via Galois rings and division-free Pfaffians, whereas any $q$ divisible by a prime $\ell \neq p$ is $\mathsf{Mod}_\ell\mathsf{P}$-hard even on simple planar bipartite treewidth-$2$ graphs; and (III)~for every $\Gamma \notin \bigcup_p \Cp$, there is no tractable modulus: counting modulo every $q \ge 2$ is $\mathsf{Mod}_\ell\mathsf{P}$-hard for every prime $\ell \mid q$, already on simple planar bipartite treewidth-$2$ graphs, via Frobenius's (1907) normal $p$-complement theorem. Second, on $2$-regular outerplanar bipartite graphs (to which maximum degree $\Delta \le 2$ reduces), exact integer counting lies in $\mathsf{P}$ if $\Gamma$ is abelian or a nilpotency-class-$2$ $2$-group of exponent at most $4$, and is $\#\mathsf{P}$-hard for every other finite group; at maximum degree $\Delta = 3$, every non-abelian group becomes $\#\mathsf{P}$-hard via disjoint copies of a $10$-vertex chorded cycle.\footnotemark[1] \end{abstract} \section{Introduction}\label{sec:intro} Counting perfect matchings on planar graphs stands at the historical origin of algebraic counting complexity. Kasteleyn~\cite{Kasteleyn1967} showed that the number of perfect matchings of any planar graph equals the Pfaffian of a suitably oriented adjacency matrix and is therefore computable in polynomial time---later parallelized to deterministic $\mathsf{NC}^2$ by Vazirani~\cite{Vazirani1989} and extended to bounded-genus surfaces by Galluccio and Loebl~\cite{GalluccioLoebl1999}---whereas Valiant~\cite{Valiant1979} proved that counting perfect matchings in general bipartite graphs is $\#\mathsf{P}$-complete. Subsequent landmark dichotomies, from Schaefer's~\cite{Schaefer1978} classification of Boolean satisfiability and Creignou and Hermann's~\cite{CreignouHermann1996} classification of $\#\mathrm{SAT}$ to the Holant and complex $\#\mathrm{CSP}$ dichotomies of Cai, Lu, and Xia~\cite{CaiLuXia2011} and Cai and Chen~\cite{CaiChen2017}, have established complete classifications as the benchmark of counting complexity. Modular counting reveals equally sharp algebraic phenomena, from Valiant's~\cite{Valiant2006} accidental algorithms modulo~$7$ to Curticapean, Dell, and Husfeldt's~\cite{CurticapeanDellHusfeldt2021} modular counting dichotomy for unlabeled $k$-matchings. \input{fig1_before_after} A closely related noncommutative algebraic dichotomy was established for the \emph{row-ordered determinant} over a fixed finite-dimensional algebra $A$: following Arvind and Srinivasan~\cite{ArvindSrinivasan2010} and Chien, Harsha, Sinclair, and Srinivasan~\cite{ChienHarshaSinclairSrinivasan2011}, Bl\"aser~\cite{Blaser2015} proved that over a finite field $\F_p$, computing determinants over $A$ lies in $\mathsf{P}$ if $A / \mathrm{rad}(A)$ is commutative and is $\mathsf{Mod}_p\mathsf{P}$-hard otherwise (and $\#\mathsf{P}$-hard over characteristic~$0$). For the group algebra $A = \F_p[\Gamma]$, commutativity of $A / \mathrm{rad}(A)$ holds precisely when $\Gamma \in \Cp$ (all irreducible $\overline{\F}_p$-representations are $1$-dimensional). The edge-ordered group-labeled perfect matching problem studied here differs fundamentally along four axes: (i)~weights are multiplied along an \emph{arbitrary} global edge ordering on undirected graphs (allowing edges incident to the same vertex to occupy independent positions in the product) rather than a bipartite matrix row order; (ii)~we work with Pfaffians of undirected planar, bounded-treewidth, and $O(\log n)$-genus graphs rather than general bipartite determinants, lifting tractability to arbitrary prime-power moduli $q = p^e$ over Galois rings in deterministic $\mathsf{NC}^2$ and $\mathsf{P}$; (iii)~our hardness reductions hold already on simple planar bipartite graphs of treewidth~$2$ across every off-prime and Class~III modulus; and (iv)~for exact integer counting on outerplanar bipartite graphs, our single-product $\Delta = 2$ model preserves a non-abelian tractable family ($\Qf$) before turning $\#\mathsf{P}$-hard at $\Delta = 3$, contrasting with systems of equations over finite groups (where deciding solvability is already $\mathsf{NP}$-complete~\cite{GoldmannRussell2002} and counting solutions is $\#\mathsf{P}$-complete~\cite{NordhJonsson2004} for every non-abelian group). Our results also contrast starkly with computational group theory for \emph{decision} problems. Even for groups as small as $S_4$ of order~$24$, the exact complexity of equation satisfiability (in particular $\mathsf{NP}$-completeness) remains open, while polynomial-time algorithms are ruled out under the Exponential Time Hypothesis~\cite{GoldmannRussell2002,FoldvariHorvath2020,IdziakEtAl2024,AichingerGrunbacher2025}. Recent work on group-labeled graphs such as Huynh~\cite{Huynh2026} treats vertex-disjoint paths over finite abelian groups, while the complementary general-graph decision problem for abelian $\{0, 1\}$-weighted perfect matchings (exact matching) is studied in~\cite{GoelExactMatching}. On interleaved disjoint cycles, Barrington's theorem~\cite{Barrington1989} implies polynomial-size counting hardness for non-solvable groups, leaving solvable non-abelian groups unstudied. Here we resolve the \emph{counting} complexity of group-labeled perfect matchings completely across all finite groups, both modulo every integer $q \ge 2$ on planar, bounded-treewidth ($c \ge 2$), and $O(\log n)$-genus graphs and over the integers on outerplanar bipartite graphs. \subsection{Problem statement and group classes} Let $\Gamma$ be a fixed finite group. We write $[g, h] := g h g^{-1} h^{-1}$ for the commutator, $\Gamma' = [\Gamma, \Gamma]$ for the derived subgroup, and $D_{2n}$ for the dihedral group of order $2n$ (so $D_8$ has order $8$ and $D_{10}$ has order $10$). An \emph{edge-ordered $\Gamma$-labeled graph} consists of a simple graph $G = (V, E)$ with $|V| = 2n$ and $|E| = m$, an arbitrary total ordering $e_1 < e_2 < \dots < e_m$ of $E$ (which may interleave edges across distinct connected components), and a labeling $w : E \to \Gamma$. For any perfect matching $M \in \M(G)$, its \emph{ordered product} is \[ w_{\ord}(M) \;:=\; \prod_{e_t \in M}^{\ord} w(e_t) \;\in\; \Gamma, \] taken in increasing order of the edge index $t$. Given a target element $g^* \in \Gamma$, we set \[ \M_{g^*}^\Gamma(G) \;:=\; \bigl\{M \in \M(G) : w_{\ord}(M) = g^*\bigr\}, \] and study the exact count $\#\M_{g^*}^\Gamma(G) \in \Z_{\ge 0}$ and the modular count $\#\M_{g^*}^\Gamma(G) \bmod q$ for every fixed integer modulus $q \ge 2$. (We omit the superscript $\Gamma$ when clear from context.) Allowing the edge ordering to interleave disjoint components is essential for non-abelian groups: on $2$-regular outerplanar graphs $G = \bigsqcup_i C_{2n_i}$, each even cycle acts as an independent Boolean switch whose matched edges occur at prescribed positions in a group word, turning $G$ into a $\Gamma$-program. Two explicit families of finite groups govern the entire landscape (illustrated in Figure~\ref{fig:group-universe}): \begin{itemize} \item For each prime $p$, let $\Cp$ denote the class of all finite groups $\Gamma$ possessing a normal Sylow $p$-subgroup $P \trianglelefteq \Gamma$ with abelian quotient $\Gamma / P$. Equivalently, by the Schur--Zassenhaus theorem, $\Gamma = P \rtimes A$ where $P$ is a finite $p$-group and $A$ is a finite abelian $p'$-group ($p \nmid |A|$). Thus $\Cp$ contains all finite abelian groups, all finite $p$-groups (such as $Q_8, D_8$, and the Heisenberg group $H_3(\F_p)$), and non-nilpotent semidirect products such as $S_3 \in \mathcal{C}_3$, $A_4, \SL(2,3) \in \mathcal{C}_2$, and $D_{2p^a} \in \Cp$ ($p$ odd, $a \ge 1$). Every non-abelian group in $\bigcup_p \Cp$ belongs to $\Cp$ for a \emph{unique} prime $p$ (its derived subgroup $\Gamma' \neq \{1\}$ lies inside $P$, forcing $p$ to be the unique prime dividing $|\Gamma'|$). \item Let $\Ab$ denote the class of all finite abelian groups, and let $\Qf$ denote the \emph{Clifford exponent-$4$ class} of all finite $2$-groups $Q$ of nilpotency class at most $2$ and exponent at most $4$. Any $Q \in \Qf$ automatically satisfies $\exp(Q') \le 2$: in nilpotency class $2$, $[y, x]^4 = [y^4, x] = 1$ and $1 = (xy)^4 = x^4 y^4 [y, x]^{\binom{4}{2}} = [y, x]^6 = [y, x]^2$ for all $x, y \in Q$. This class includes $Q_8$, $D_8$, all extraspecial $2$-groups $2_\pm^{1+2m}$, and all central products of copies of $Q_8$, $D_8$, and $\Z_4$. \end{itemize} \subsection{Main results} Our first main theorem classifies modular counting $\#\M_{g^*}^\Gamma(G) \bmod q$ across all finite groups $\Gamma$ and moduli $q \ge 2$. \begin{theorem}[Complete modular counting trichotomy]\label{thm:mod-trichotomy} Let $\Gamma$ be any finite group and let $q \ge 2$ be any integer modulus. Every finite group $\Gamma$ falls into exactly one of three classes: \begin{enumerate} \item[\textup{(I)}] \emph{Abelian ($\Gamma \in \Ab$):} Computing the exact integer count $\#\M_{g^*}^\Gamma(G)$---and hence $\#\M_{g^*}^\Gamma(G) \bmod q$ for every $q \ge 2$---runs in deterministic $\mathsf{NC}^2 \subseteq \mathsf{P}$ on all planar graphs and all graphs of bounded treewidth $\tw(G) \le c$, and in deterministic $\mathsf{P}$ on all graphs given a cellular embedding on an orientable surface of genus $g = O(\log n)$. \item[\textup{(II)}] \emph{Non-abelian $\Gamma = P \rtimes A \in \Cp$ (unique prime $p$):} \begin{enumerate} \item[\textup{(a)}] If $q = p^e$ is a power of $p$ ($e \ge 1$), then computing $\#\M_{g^*}^\Gamma(G) \bmod p^e$ runs in deterministic $\mathsf{NC}^2 \subseteq \mathsf{P}$ on all planar graphs and all graphs of bounded treewidth $\tw(G) \le c$, and in deterministic $\mathsf{P}$ on all graphs given a cellular embedding on an orientable surface of genus $g = O(\log n)$. \item[\textup{(b)}] If $q$ has any prime divisor $\ell \neq p$, then computing $\#\M_{g^*}^\Gamma(G) \bmod q$ is $\mathsf{Mod}_\ell\mathsf{P}$-hard under deterministic polynomial-time non-adaptive Turing reductions making at most $|P| = O_\Gamma(1)$ oracle queries (only $2$ queries when $\Gamma$ is nilpotent), even on simple planar bipartite treewidth-$2$ graphs. \end{enumerate} \item[\textup{(III)}] \emph{Outside $\bigcup_p \Cp$ ($\Gamma \notin \bigcup_p \Cp$):} There is \emph{no} tractable modulus. For every integer $q \ge 2$ and every prime divisor $\ell \mid q$, computing $\#\M_{g^*}^\Gamma(G) \bmod q$ is $\mathsf{Mod}_\ell\mathsf{P}$-hard under $O_\Gamma(1)$ non-adaptive queries, even on simple planar bipartite treewidth-$2$ graphs. \end{enumerate} Assuming $\mathsf{Mod}_\ell\mathsf{P} \not\subseteq \mathsf{P}$ for all primes $\ell$, computing $\#\M_{g^*}^\Gamma(G) \bmod q$ on planar bipartite treewidth-$2$ graphs lies in $\mathsf{P}$ if and only if either $\Gamma$ is abelian or $\Gamma \in \Cp$ and $q = p^e$ for some $e \ge 1$. \end{theorem} Theorem~\ref{thm:mod-trichotomy} shows that for every Class~III group---beginning at the minimum Class~III order~$24$ with $S_4$, $D_{24} \cong \Z_3 \rtimes D_8$, and $\mathrm{Dic}_6 \cong \Z_3 \rtimes Q_8$, and continuing through $A_5$, $S_3 \times A_4$, $Q_8 \times S_3$, and the faithful order-$72$ semidirect products $\Z_3^2 \rtimes Q_8$ and $\Z_3^2 \rtimes D_8$---every modulus $q \ge 2$ is hard already on planar bipartite graphs of treewidth~$2$. Restricting the graph class one step further to $2$-regular outerplanar bipartite graphs (disjoint unions of even cycles) strictly enlarges the tractable modular pairs: in Class~II this already occurs at order~$8$ (for $Q_8, D_8 \bmod 3$, by Theorem~\ref{thm:outerplanar-exact}(a)), and inside Class~III our next theorem proves a separation starting already at the minimum Class~III order~$24$ ($D_{24}$ and $\mathrm{Dic}_6$) and reaching its smallest faithful, non-nilpotent-by-abelian instances at order~$72$ ($\Z_3^2 \rtimes Q_8$ and $\Z_3^2 \rtimes D_8$). \begin{theorem}[Graph-class separation between $2$-regular outerplanar and treewidth-$2$ graphs]\label{thm:order72} Let $\Gamma = P \rtimes Q$ where $P$ is a finite $p$-group for an odd prime $p \ge 3$ and $Q$ is a non-abelian nilpotency-class-$2$ $2$-group with $Z(Q) \cong \Z_2$. This family includes the order-$24$ Class~III semidirect products $D_{24} \cong \Z_3 \rtimes D_8$ and $\mathrm{Dic}_6 \cong \Z_3 \rtimes Q_8$ (with non-faithful action on $\Z_3$) and the smallest faithful (non-nilpotent-by-abelian) instances $\Z_3^2 \rtimes Q_8$ and $\Z_3^2 \rtimes D_8$ of order~$72$ (where $Q_8, D_8 \le \GL(2, 3)$). Then computing $\#\M_{g^*}^\Gamma(G) \bmod p$ is: \begin{enumerate} \item[\textup{(a)}] $\mathsf{Mod}_p\mathsf{P}$-hard on simple planar bipartite treewidth-$2$ graphs (by Theorem~\ref{thm:mod-trichotomy}\textup{(II)(b)} on $Q \le \Gamma$, and by Theorem~\ref{thm:mod-trichotomy}\textup{(III)} whenever $P$ is non-abelian or $Q$ acts non-trivially on $P$), yet \item[\textup{(b)}] computable in deterministic polynomial time $O_\Gamma(m^{\nu(P)}(mk + k^3))$ on all simple $2$-regular outerplanar bipartite graphs $G = \bigsqcup_{i=1}^k C_{2n_i}$ with arbitrary global edge ordering and arbitrary $\Gamma$-labels, where $\nu(P) \le |P| - 1$ is the largest integer with $I_P^{\nu(P)} \neq 0$ (so $I_P^{\nu(P)+1} = 0$) for the augmentation ideal $I_P$ of $\F_p[P]$. \end{enumerate} \end{theorem} Our third main theorem delivers a second complete classification across all finite groups: exact integer counting $\#\M_{g^*}^\Gamma(G)$ on outerplanar bipartite graphs, with a sharp transition between maximum degree $\Delta = 2$ and $\Delta = 3$, together with linear-size hardness modulo every prime for every non-solvable group. \begin{theorem}[Complete exact counting dichotomy on outerplanar bipartite graphs]\label{thm:outerplanar-exact} Let $\Gamma$ be any finite group. \begin{enumerate} \item[\textup{(a)}] \emph{Complete $\Delta = 2$ dichotomy:} On simple $2$-regular outerplanar bipartite graphs ($G = \bigsqcup_{i=1}^k C_{2n_i}$ with $m$ edges and arbitrary global edge ordering), computing exact integer $\#\M_{g^*}^\Gamma(G)$ runs in deterministic polynomial time ($O_\Gamma(mk + k^3)$ Gaussian-integer operations) if $\Gamma \in \Ab \cup \Qf$, and is $\#\mathsf{P}$-hard for every other finite group $\Gamma \notin \Ab \cup \Qf$. \item[\textup{(b)}] \emph{Linear-size non-solvable hardness:} For every finite non-solvable group $\Gamma$, even on simple $2$-regular outerplanar bipartite graphs, computing $\#\M_{g^*}^\Gamma(G)$ is $\#\mathsf{P}$-hard and for every prime $\ell \ge 2$ computing $\#\M_{g^*}^\Gamma(G) \bmod \ell$ is $\mathsf{Mod}_\ell\mathsf{P}$-hard via a direct linear-size, constant-commutator-depth reduction (avoiding the polynomial blowup of Barrington's theorem~\cite{Barrington1989}). \item[\textup{(c)}] \emph{Sharp $\Delta = 2$ vs.\ $\Delta = 3$ transition:} On simple outerplanar bipartite graphs of maximum degree $\Delta = 3$ (specifically disjoint unions of even cycles and copies of the $10$-vertex chorded cycle $O_{10} = C_{10} + \{v_1, v_4\}$), computing exact integer $\#\M_{g^*}^\Gamma(G)$ runs in deterministic $\mathsf{NC}^2 \subseteq \mathsf{P}$ if $\Gamma$ is abelian, and is $\#\mathsf{P}$-hard for every non-abelian finite group $\Gamma$. \end{enumerate} \end{theorem} Table~\ref{tab:before-after} summarizes the complete classification across representative groups. Further algorithmic extensions to bounded-apex and clique-sum graphs via planar mimicking rank laws, together with bounded-treewidth decision and matching-equivalence results, appear in the companion expanded version~\cite[Theorems~1.4--1.6]{GoelExpanded}. \begin{table}[htbp] \centering \scriptsize \renewcommand{\arraystretch}{1.15} \setlength{\tabcolsep}{3.0pt} \resizebox{\textwidth}{!}{% \begin{tabular}{@{}llllll@{}} \toprule Group $\Gamma$ & Class & Before & Mod $q$ (pl./tw-$c$/gen.) & Exact ($\Delta = 2$) & Exact ($\Delta = 3$) \\ \midrule $\Z_m,\; \Z_2^r$ & I ($\Ab$) & $\mathsf{NC}^2$, $\mathsf{P}$ \cite{Kasteleyn1967,Vazirani1989,GalluccioLoebl1999,BodlaenderHagerup1998,ElberfeldJakobyTantau2010,MahajanSubramanyaVinay2004,ChiuDavidaLitow2001} & $\mathsf{NC}^2$ (pl./tw-$c$), $\mathsf{P}$ (gen.) & $\mathsf{NC}^2$ & $\mathsf{NC}^2$ \\ $Q_8,\; D_8,\; 2_\pm^{1+2m}$ & II ($\mathcal{C}_2 \cap \Qf$) & Not studied & $q=2^e$: $\mathsf{NC}^2$/$\mathsf{P}$; odd $\ell$ hard & $\mathsf{P}$ ($\Z_4$-Gauss) & $\#\mathsf{P}$-hard ($O_{10}$) \\ $H_3(\F_p)$ ($p \ge 3$) & II ($\Cp \setminus \Qf$) & Not studied & $q=p^e$: $\mathsf{NC}^2$/$\mathsf{P}$; $\ell\neq p$ hard & $\#\mathsf{P}$-hard & $\#\mathsf{P}$-hard \\ $S_3,\; A_4,\; \SL(2,3)$ & II (non-nilp.\ $\Cp$) & Not studied & $q=p^e$: $\mathsf{NC}^2$/$\mathsf{P}$; $\ell\neq p$ hard & $\#\mathsf{P}$-hard & $\#\mathsf{P}$-hard \\ $D_{24}, \mathrm{Dic}_6, S_3\!\times\!A_4, Q_8\!\times\!S_3$ & III (nilp.-by-ab.) & Not studied & Hard all $q$ ($\mathrm{mod}\, 3\!\in\!\mathsf{P}$ on $\Delta=2$ for $D_{24}, \mathrm{Dic}_6$) & $\#\mathsf{P}$-hard & $\#\mathsf{P}$-hard \\ $\Z_3^2\!\rtimes\!Q_8,\; \Z_3^2\!\rtimes\!D_8$ & III (Fit.~2, faithful) & Not studied & Hard all $q$ ($\mathrm{mod}\, 3\!\in\!\mathsf{P}$ on $\Delta=2$) & $\#\mathsf{P}$-hard & $\#\mathsf{P}$-hard \\ $S_4$ & III (solv., Fit.\ $3$) & Not studied & Hard for \emph{all} $q \ge 2$ & $\#\mathsf{P}$-hard & $\#\mathsf{P}$-hard \\ $A_5, \PSL(2,r)\; (r\ge 4), \Sz(2^t)\; (t\ge 3\text{ odd})$ & III (non-solvable) & Hard \cite{Barrington1989} & Hard all $q$ (linear-size $\Delta=2$) & $\#\mathsf{P}$-hard & $\#\mathsf{P}$-hard \\ \bottomrule \end{tabular}% } \vspace{4pt} \caption{Before-and-after complexity summary across representative finite groups (Theorems~\ref{thm:mod-trichotomy}--\ref{thm:outerplanar-exact}; for the related row-ordered determinant over $\F_p[\Gamma]$, see~\cite{Blaser2015}). Here ``pl./tw-$c$/gen.'' denotes planar, treewidth $\le c$ ($c \ge 2$), and cellular $O(\log n)$-genus graphs (with ``$\mathsf{NC}^2$/$\mathsf{P}$'' meaning $\mathsf{NC}^2$ on planar/tw-$c$ and $\mathsf{P}$ on genus $O(\log n)$); ``hard'' means $\mathsf{Mod}_\ell\mathsf{P}$-hard on planar bipartite treewidth-$2$ graphs for every prime $\ell \mid q$ (off-prime $\ell \neq p$ in Class~II, all $\ell \mid q$ in Class~III); ``nilp.-by-ab.'' denotes nilpotent-by-abelian, ``Fit.'' denotes Fitting length, $r \ge 4$ is a prime power, and $\Sz(2^t)$ ($t \ge 3$ odd) denotes the Suzuki simple groups. For non-solvable groups, polynomial-size hardness on interleaved $\Delta = 2$ graphs follows from Barrington~\cite{Barrington1989}, and Theorem~\ref{thm:outerplanar-exact}(b) gives a direct linear-size, constant-commutator-depth proof.} \label{tab:before-after} \end{table} \section{Prime-Power Modular Algorithms via Galois Rings}\label{sec:upper} In this section we prove the algorithmic upper bounds of Theorem~\ref{thm:mod-trichotomy}(I) and (II)(a). Throughout, let $G = (V, E)$ be a simple graph with $|V| = 2n$, $|E| = m$, edge ordering $e_1 < \dots < e_m$, edge labels $w : E \to \Gamma$, and target $g^* \in \Gamma$. \subsection{Class I: Abelian groups} Assume $\Gamma$ is finite abelian. Every ordered product is independent of edge ordering, so $\one[w_{\ord}(M) = g^*]$ depends only on the group-algebra element $\prod_{e \in M} w(e) \in \Z[\Gamma]$. \begin{itemize} \item \emph{Planar graphs ($g = 0$):} Compute a Kasteleyn orientation of $G$ in deterministic $\mathsf{NC}^2$~\cite{Kasteleyn1967,Vazirani1989}; all perfect matchings then share a single global sign $\varepsilon \in \{\pm 1\}$ fixed by the vertex ordering. Because $\#\M_{g^*}(G) \le (2n)! < 2^{2n \log_2(2n)}$, choose the first $M := \lceil 2n \log_2(2n) \rceil$ odd primes $p_1, \dots, p_M$ satisfying $p_i \equiv 1 \pmod{\exp(\Gamma)}$ (for the fixed constant $\exp(\Gamma) = O_\Gamma(1)$, all $p_i = O_\Gamma(n \log^2 n)$ and are found in parallel in $\mathsf{NC}^1$). Over each $\F_{p_i}$, the group algebra splits completely as $\F_{p_i}[\Gamma] \cong \F_{p_i}^{|\Gamma|}$ via the $|\Gamma|$ characters $\chi : \Gamma \to \F_{p_i}^\times$, reducing $\varepsilon \cdot \#\M_{g^*}(G) \bmod p_i$ to $|\Gamma| = O_\Gamma(1)$ signed scalar Pfaffians over $\F_{p_i}$. Each signed Pfaffian is computed division-free in deterministic $\mathsf{NC}^2$ by Mahajan, Subramanya, and Vinay~\cite{MahajanSubramanyaVinay2004}. Reconstructing the signed integer $\varepsilon \cdot \#\M_{g^*}(G)$ by Chinese remaindering in $\mathsf{NC}^1$~\cite{ChiuDavidaLitow2001} and taking its absolute value yields $\#\M_{g^*}(G)$ in deterministic $\mathsf{NC}^2$. \item \emph{Bounded-genus graphs ($g = O(\log n)$):} Using the $4^g$-Pfaffian Arf-invariant formula of Galluccio and Loebl~\cite{GalluccioLoebl1999} on the given cellular embedding of $G$ on $\Sigma_g$, each odd prime $p_i > 2$ evaluates $|\Gamma| \cdot 4^g = \operatorname{poly}(n)$ signed scalar Pfaffians in deterministic polynomial time, and CRT recovers the exact integer count $\#\M_{g^*}(G)$ in deterministic $\mathsf{P}$. \item \emph{Bounded-treewidth graphs ($\tw(G) \le c$):} Compute a width-$\le 3c+2$, depth-$O(\log n)$ balanced tree decomposition in deterministic $\mathsf{NC}^2$~\cite{BodlaenderHagerup1998,ElberfeldJakobyTantau2010} and run standard Miller--Reif parallel tree-contraction DP with $2^{O(c)} \times 2^{O(c)}$ transfer matrices over $\F_{p_i}[\Gamma]$ for each $p_i$, followed by $\mathsf{NC}^1$ CRT~\cite{ChiuDavidaLitow2001}, yielding exact integer counting in deterministic $\mathsf{NC}^2$. \end{itemize} This proves Theorem~\ref{thm:mod-trichotomy}(I). \subsection{Class II: Galois-ring expansion and division-free evaluation mod \texorpdfstring{$p^e$}{p\^{}e}} Now fix a prime $p \ge 2$, a non-abelian group $\Gamma = P \rtimes A \in \Cp$ ($P$ a $p$-group, $A$ an abelian $p'$-group), and an integer $e \ge 1$. Write each edge label as $w(e_t) = (u_t, a_t) \in P \rtimes A$ ($t = 1, \dots, m$), the target as $g^* = (u^*, a^*)$, and for any $M \subseteq E(G)$ set $x_t := \one[e_t \in M] \in \{0, 1\}$. \begin{lemma}[Galois-ring nilpotent factorized indicator]\label{lem:galois-expansion} There exists a finite commutative local ring $R = \GR(p^e, s)$ of characteristic $p^e$ and constant size $|R| = p^{es} = O_{\Gamma, e}(1)$, an integer $\nu_e(P) \le e(\nu(P) + 1) - 1 \le e|P| - 1$, and an explicitly computable index set $\mathcal{I}_e$ of size $|\mathcal{I}_e| = O_{\Gamma, e}((m + 1)^{\nu_e(P)})$ such that for every $M \subseteq E(G)$, \begin{equation}\label{eq:galois-indicator} \one\bigl[w_{\ord}(M) = g^*\bigr] \;=\; \sum_{\tau \in \mathcal{I}_e} c_\tau \cdot \prod_{r = 1}^m v_{\tau, r}(x_r) \qquad \text{in } \{0, 1\} \subseteq R, \end{equation} where each $c_\tau \in R$, each $\tau$ specifies a subset $S_\tau = \{t_1 < \dots < t_d\} \subseteq [m]$ ($0 \le d \le \nu_e(P)$), and the unary edge factors satisfy $v_{\tau, r}(0) = 0$ for $r \in S_\tau$, $v_{\tau, r}(0) = 1$ for $r \notin S_\tau$, and $v_{\tau, r}(1) \in R^\times$ for all $r \in [m]$. \end{lemma} \begin{proof} Since $\gcd(\exp(A), p) = 1$, the cyclotomic polynomial $\Phi_{\exp(A)}(t)$ is separable over $\F_p$. Let $\bar{f}(t) \in \F_p[t]$ be an irreducible factor of $\Phi_{\exp(A)}(t) \bmod p$ of degree $s = O_\Gamma(1)$, so $\F_{p^s} = \F_p[t]/(\bar{f}(t))$ contains a primitive $\exp(A)$-th root of unity. Lift $\bar{f}$ to any monic polynomial $f(t) \in (\Z/p^e\Z)[t]$ of degree $s$, and form the Galois ring $R := \GR(p^e, s) = (\Z/p^e\Z)[t]/(f(t))$, which is a finite commutative local ring with unique maximal ideal $pR$ and residue field $R / pR \cong \F_{p^s}$. By Hensel's lemma, the primitive $\exp(A)$-th root of unity in $\F_{p^s}^\times$ lifts uniquely to an element $\hat{\zeta} \in R^\times$ of exact multiplicative order $\exp(A)$, generating the Teichm\"uller cyclic subgroup $\langle\hat{\zeta}\rangle \subset R^\times$. Because $p \nmid |A|$, $|A|$ is a unit in $R$. Let $\widehat{A} := \operatorname{Hom}(A, \langle\hat{\zeta}\rangle)$ ($|\widehat{A}| = |A|$). For every non-trivial $\chi \in \widehat{A}$ and $a_0 \in A$ with $\chi(a_0) \neq 1$, we have $\chi(a_0) \not\equiv 1 \pmod{pR}$ (since the projection $\langle\hat{\zeta}\rangle \to \F_{p^s}^\times$ is injective), so $\chi(a_0) - 1 \in R^\times$ and hence $\sum_{a \in A} \chi(a) = 0$ in $R$. Consequently, the indicator of $a(M) := \prod_{r=1}^m a_r^{x_r} = a^*$ in $A$ obeys \[ \one\bigl[a(M) = a^*\bigr] \;=\; \frac{1}{|A|} \sum_{\chi_0 \in \widehat{A}} \chi_0(a^*)^{-1} \chi_0\bigl(a(M)\bigr) \;\in\; \{0, 1\} \subseteq R. \] Next, consider the group ring $R[P]$ and its augmentation ideal $I_P := \operatorname{span}_R\{u - 1 : u \in P\}$. Over the residue field $R/pR = \F_{p^s}$, the augmentation ideal of a finite $p$-group is nilpotent: letting $\nu(P) \le |P| - 1$ be the largest integer with $I_P^{\nu(P)} \neq 0$, we have $I_P^{\nu(P) + 1} = 0$ in $\F_{p^s}[P]$. Lifting back to $R[P]$ gives $I_P^{\nu(P) + 1} \subseteq p \cdot R[P]$; raising to the $e$-th power yields \[ I_P^{e(\nu(P) + 1)} \;\subseteq\; p^e \cdot R[P] \;=\; 0 \qquad \text{in } R[P], \] so $I_P^{\nu_e(P) + 1} = 0$ for some $\nu_e(P) \le e(\nu(P) + 1) - 1 \le e|P| - 1$. The conjugation action $\Ad_a(u) := a u a^{-1}$ of $A$ on $R[P]$ preserves $I_P$. Using the orthogonal character idempotents $e_\chi := \frac{1}{|A|} \sum_{a \in A} \chi(a)^{-1} \Ad_a$ ($\chi \in \widehat{A}$), which satisfy $\sum_\chi e_\chi = \id$, $e_\chi^2 = e_\chi$, $e_\chi e_{\chi'} = 0$ ($\chi \neq \chi'$), and $\Ad_a(e_\chi(z)) = \chi(a) e_\chi(z)$ in $R[P]$, decompose $u_t - 1 = \sum_{\chi \in \widehat{A}} \Delta_{t, \chi}$ with $\Delta_{t, \chi} := e_\chi(u_t - 1) \in I_P$. Setting $a_{< t}(M) := \prod_{r < t} a_r^{x_r} \in A$, the semidirect-product multiplication law in $P \rtimes A$ gives $w_{\ord}(M) = (u(M), a(M))$ where \[ u(M) \;=\; \prod_{t = 1}^m a_{< t}(M)\, u_t^{x_t}\, a_{< t}(M)^{-1} \;=\; \prod_{t = 1}^m \left(1 + x_t \sum_{\chi \in \widehat{A}} \chi\bigl(a_{< t}(M)\bigr)\, \Delta_{t, \chi}\right) \;\in\; R[P]. \] Because $I_P^{\nu_e(P) + 1} = 0$, expanding the product truncates identically at degree $d \le \nu_e(P)$. Extracting the coefficient $[u^*](\cdot)$ of $u^* \in P$ and multiplying by $\one[a(M) = a^*]$ yields~\eqref{eq:galois-indicator}, indexed by tuples $\tau = (d;\, 1 \le t_1 < \dots < t_d \le m;\, \chi_0, \chi_1, \dots, \chi_d \in \widehat{A})$ ($0 \le d \le \nu_e(P)$), with \[ c_\tau \;:=\; \frac{1}{|A|}\, \chi_0(a^*)^{-1} [u^*]\bigl(\Delta_{t_1, \chi_1} \cdots \Delta_{t_d, \chi_d}\bigr) \;\in\; R, \qquad \psi_{\tau, r} \;:=\; \chi_0 \prod_{j :\, t_j > r} \chi_j \;\in\; \widehat{A}, \] and unary factors $v_{\tau, r}(0) = 0$ if $r \in S_\tau := \{t_1, \dots, t_d\}$ (and $1$ otherwise) and $v_{\tau, r}(1) = \psi_{\tau, r}(a_r) \in R^\times$. The index count is $|\mathcal{I}_e| \le |A| \sum_{d=0}^{\nu_e(P)} \binom{m}{d} |A|^d = O_{\Gamma, e}((m + 1)^{\nu_e(P)})$. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:mod-trichotomy}\textup{(II)(a)}] Summing~\eqref{eq:galois-indicator} over all $M \in \M(G)$ yields \[ \#\M_{g^*}^\Gamma(G) \cdot 1_R \;=\; \sum_{\tau \in \mathcal{I}_e} c_\tau \cdot Z_\tau(G) \;\in\; \Z/p^e\Z \subseteq R, \qquad Z_\tau(G) \;:=\; \sum_{M \in \M(G)} \prod_{r = 1}^m v_{\tau, r}(x_r). \] Fix any $\tau \in \mathcal{I}_e$ with forced edge set $F_\tau := \{e_r : r \in S_\tau\}$ ($|F_\tau| \le \nu_e(P) = O_{\Gamma, e}(1)$). If two edges of $F_\tau$ share an endpoint, then $Z_\tau(G) = 0$. Otherwise, let $U_\tau := \bigcup_{e \in F_\tau} e$, and define scalar edge weights $\widehat{w}_\tau : E(G) \to R$ on the \emph{unmodified} graph $G$ by \[ \widehat{w}_\tau(e_r) \;:=\; \begin{cases} 0 & \text{if } e_r \notin F_\tau \text{ and } e_r \cap U_\tau \neq \emptyset, \\ v_{\tau, r}(1) & \text{otherwise.} \end{cases} \] Because every edge incident to $U_\tau$ outside $F_\tau$ has weight $0$, any perfect matching $M \in \M(G)$ with nonzero $\widehat{w}_\tau$-weight must contain $F_\tau$, giving $Z_\tau(G) = \Haf(G; \widehat{w}_\tau)$ identically in $R$---where $\Haf(G; w) := \sum_{M \in \M(G)} \prod_{e \in M} w(e)$ denotes the weighted matching sum (Hafnian)---without modifying $G$, its embedding, or its tree decomposition. We evaluate $\Haf(G; \widehat{w}_\tau)$ over $R$ for all $|\mathcal{I}_e| = \operatorname{poly}(n)$ indices $\tau$: \begin{itemize} \item \emph{Planar graphs ($g = 0$):} Compute a single Kasteleyn orientation of the unmodified graph $G$ in deterministic $\mathsf{NC}^2$~\cite{Vazirani1989}. Determine its global vertex-ordering sign $\varepsilon \in \{\pm 1\}$ \emph{once} by evaluating the integer all-ones Pfaffian $\Pf(K(G; \one)) = \varepsilon |\M(G)| \in \Z$ in $\mathsf{NC}^2$ (via~\cite{MahajanSubramanyaVinay2004} over small primes and $\mathsf{NC}^1$ CRT~\cite{ChiuDavidaLitow2001}): if $0$, then $\M(G) = \emptyset$ and we output $0$; otherwise $\varepsilon = \operatorname{sgn}(\Pf(K(G; \one)))$. Then for every $\tau \in \mathcal{I}_e$ in parallel, evaluate $\Haf(G; \widehat{w}_\tau) = \varepsilon \Pf(K(G; \widehat{w}_\tau)) \in R$ using the division-free algorithm of Mahajan, Subramanya, and Vinay~\cite{MahajanSubramanyaVinay2004} (requiring only ring additions and multiplications in $R$, avoiding all zero-divisors of $R$, in $O(n^4)$ sequential ring operations and deterministic $\mathsf{NC}^2$ parallel time; summing the $|\mathcal{I}_e|$ terms in $\mathsf{NC}^1$ keeps total parallel depth $\mathsf{NC}^2$). \item \emph{Bounded-genus graphs ($g = O(\log n)$):} On the given cellular embedding of unmodified $G$ on $\Sigma_g$, Galluccio and Loebl~\cite{GalluccioLoebl1999} construct $4^g$ Pfaffian orientations $K_\alpha$ ($\alpha \in \F_2^{2g}$) satisfying the exact integral polynomial identity \[ \sum_{\alpha \in \F_2^{2g}} (-1)^{\Arf(\alpha)}\, \Pf\bigl(K_\alpha(G; X)\bigr) \;=\; 2^g \varepsilon\, \Haf(G; X) \qquad \text{in } \Z[X_e], \] where the shared global sign $\varepsilon \in \{\pm 1\}$ is determined once from the integer evaluation at $X \equiv \one$ (if $0$, output $0$; else $\varepsilon$ is the sign of the sum). When $p \ge 3$ is odd, $2 \in R^\times$, so we evaluate the $4^g = \operatorname{poly}(n)$ division-free Pfaffians directly in $R$ and multiply by $\varepsilon\, 2^{-g} \in R^\times$. When $p = 2$, $2$ is a zero-divisor in $R = \GR(2^e, s)$, so we lift the scalar weights $\widehat{w}_\tau(e) \in R$ arbitrarily to the higher-precision Galois ring $\widetilde{R} := \GR(2^{e + g}, s)$ (lifting the same degree-$s$ monic polynomial $f$ modulo $2^{e+g}$; since $g = O(\log n)$ and $s = O_\Gamma(1)$, elements of $\widetilde{R}$ have $O_\Gamma(e + \log n)$ bits). Evaluating the $4^g$ division-free Pfaffians over $\widetilde{R}$ gives the exact multiple $2^g \varepsilon \Haf(G; \widetilde{w}_\tau) \in 2^g \widetilde{R}$; dividing each coefficient in the free $\Z/2^{e+g}\Z$-basis $\{1, \bar{t}, \dots, \bar{t}^{s-1}\}$ by $2^g$, multiplying by $\varepsilon$, and reducing modulo $2^e$ recovers $\Haf(G; \widehat{w}_\tau) \in R$ exactly in deterministic polynomial time $O_{\Gamma, e}(4^g n^4 m^{\nu_e(P)} \operatorname{poly}(e + \log n))$. \item \emph{Bounded-treewidth graphs ($\tw(G) \le c$):} Compute a width-$\le 3c+2$, depth-$O(\log n)$ balanced tree decomposition in deterministic $\mathsf{NC}^2$~\cite{BodlaenderHagerup1998,ElberfeldJakobyTantau2010}; since $R$ has constant size $O_{\Gamma, e}(1)$, Miller--Reif parallel tree-contraction DP with constant-size $2^{O(c)} \times 2^{O(c)}$ transfer matrices over $R$ (division-free) computes $\Haf(G; \widehat{w}_\tau) \in R$ for all $|\mathcal{I}_e| = \operatorname{poly}(n)$ indices $\tau$ in parallel in deterministic $\mathsf{NC}^2$, and summing in $\mathsf{NC}^1$ keeps total parallel depth $\mathsf{NC}^2$. \end{itemize} Summing $c_\tau Z_\tau(G)$ over all $\tau \in \mathcal{I}_e$ in $R$ outputs $\#\M_{g^*}^\Gamma(G) \bmod p^e$. \end{proof} \section{Universal Off-Prime and Class-III Hardness on Treewidth-\texorpdfstring{$2$}{2} Graphs}\label{sec:hardness} We now prove Theorem~\ref{thm:mod-trichotomy}(II)(b) and (III): every off-prime modulus in Class~II and every modulus in Class~III is $\mathsf{Mod}_\ell\mathsf{P}$-hard even on simple planar bipartite treewidth-$2$ graphs. \subsection{Parsimonious 1-in-3-SAT, \texorpdfstring{$\#\IS \bmod \ell$}{\#IS mod ell}, and two treewidth-\texorpdfstring{$2$}{2} gadgets} We first record two self-contained $\mathsf{Mod}_\ell\mathsf{P}$-completeness foundations and two planar bipartite treewidth-$2$ gadgets. \begin{lemma}[Parsimonious distinct-variable Positive 1-in-3-SAT and $\#\IS \bmod \ell$]\label{lem:modl-complete} For every prime $\ell \ge 2$, both counting satisfying assignments of a distinct-variable \textup{\textsc{Positive 1-in-3-SAT}} formula modulo $\ell$ and counting independent sets $\#\IS(H) \bmod \ell$ of a simple graph $H$ are $\mathsf{Mod}_\ell\mathsf{P}$-complete under deterministic polynomial-time many-one reductions. \end{lemma} \begin{proof} For any polynomial-time nondeterministic Turing machine witness circuit (composed of $\mathrm{NOT}$ and $\mathrm{AND}$ gates), introduce four distinct constant Boolean variables $z_0, z'_0, z''_0, z_1$ constrained by the three distinct-variable positive 1-in-3 clauses \[ z_0 + z'_0 + z_1 = 1, \qquad z'_0 + z''_0 + z_1 = 1, \qquad z''_0 + z_0 + z_1 = 1. \] If $z_1 = 0$, summing the three equations yields $2(z_0 + z'_0 + z''_0) = 3$, impossible in $\Z$; thus uniquely $(z_0, z'_0, z''_0, z_1) = (0, 0, 0, 1)$. For each wire $x$, enforce $\bar{x} = 1 - x$ uniquely by $x + \bar{x} + z_0 = 1$. For each gate $y = a \land b$, introduce four fresh indicator variables $s_{00}, s_{01}, s_{10}, s_{11}$ with the four positive 1-in-3 clauses \[ a + s_{00} + s_{01} = 1, \quad b + s_{00} + s_{10} = 1, \quad \bar{a} + s_{10} + s_{11} = 1, \quad \bar{b} + s_{01} + s_{11} = 1, \] and set $y := s_{11}$. Direct inspection on all four pairs $(a, b) \in \{0, 1\}^2$ confirms a unique auxiliary tuple with $s_{ab} = 1$ and the other three equal to $0$. Enforcing the output wire via $y_{\mathrm{out}} + z_0 + z'_0 = 1$ yields a parsimonious reduction to distinct-variable \textsc{Positive 1-in-3-SAT} (every clause has three distinct variables), proving $\mathsf{Mod}_\ell\mathsf{P}$-completeness for every prime $\ell \ge 2$~\cite{Schaefer1978,CreignouHermann1996}. Now given a distinct-variable \textsc{Positive 1-in-3-SAT} instance $\Phi$ on variables $x_1, \dots, x_n$ and clauses $C_j = \{a_j, b_j, c_j\}$ ($j = 1, \dots, m$), form a simple graph $H$ on vertex set $\{u_1, \dots, u_n\}$ together with $m$ fresh disjoint cliques $K_{\ell - 1}$ ($\ell - 1 \ge 1$) as follows: for each clause $C_j = \{a_j, b_j, c_j\}$, include the three edges $\{u_{a_j}, u_{b_j}\}$, $\{u_{a_j}, u_{c_j}\}$, $\{u_{b_j}, u_{c_j}\}$ (merging parallel edges between clauses that share a pair into a single simple edge, which forbids $x_{a_j} + x_{b_j} + x_{c_j} \ge 2$) and connect all $\ell - 1$ vertices of the $j$-th clique $K_{\ell - 1}$ to $u_{a_j}, u_{b_j}, u_{c_j}$. When $x_{a_j} + x_{b_j} + x_{c_j} = 1$, all vertices of the $j$-th clique are forced out ($1$ extension); when $x_{a_j} + x_{b_j} + x_{c_j} = 0$, the $j$-th clique contributes $1 + (\ell - 1) = \ell \equiv 0 \pmod \ell$ extensions. Because the $m$ cliques are pairwise disjoint and independent given $(u_1, \dots, u_n)$, summing over all extensions gives \[ \#\IS(H) \;\equiv\; \#\text{1-in-3-SAT}(\Phi) \pmod \ell \] for every prime $\ell \ge 2$ (including $\ell = 2$). \end{proof} \input{fig2_gadgets} \begin{lemma}[Exact planar bipartite treewidth-$\le 2$ compilation]\label{lem:gadgets} \leavevmode \begin{enumerate} \item[\textup{(a)}] \emph{Outerplanar fan-cycle $H_\ell^*$ (every odd prime $\ell \ge 3$):} Take the $2\ell$-cycle $u_1 - v_1 - u_2 - v_2 - \dots - u_\ell - v_\ell - u_1$ with $\ell - 2$ fan chords $\{u_k, v_\ell\}$ ($2 \le k \le \ell - 1$), and subdivide the two \emph{outer} cycle edges $\{u_1, v_\ell\}$ and $\{u_\ell, v_\ell\}$ by two vertices each ($u_1 - p_1 - q_1 - v_\ell$ and $u_\ell - p_2 - q_2 - v_\ell$). Then $H_\ell^*$ is simple, bipartite, \emph{outerplanar} (treewidth $2$), and has exactly $\ell$ perfect matchings $M^{(1)}, \dots, M^{(\ell)}$, with two edges $\{u_1, p_1\}, \{q_1, v_\ell\}$ exclusive to $M^{(1)}$ and two edges $\{u_\ell, p_2\}, \{q_2, v_\ell\}$ exclusive to $M^{(\ell)}$. \item[\textup{(b)}] \emph{Series--parallel theta gadget $B_{p, d'}$ (every prime $p \ge 2$, integer $d' \ge 1$):} Join two poles $r, r'$ by $p$ internally disjoint odd paths of length $2d' + 1$, $r - w_{k, 1} - \dots - w_{k, 2d'} - r'$ ($k = 0, \dots, p - 1$). Then $B_{p, d'}$ is simple, planar, bipartite, series--parallel (treewidth $2$), and has exactly $p$ perfect matchings $M^{(0)}, \dots, M^{(p - 1)}$, where path $k$ carries $d'$ exclusive odd edges for value $y = k$. \item[\textup{(c)}] \emph{Word compilation:} Any word $W(z_1, \dots, z_N;\, y_1, \dots, y_M) \in \Gamma$ of length $L$ in Boolean variables $z_i \in \{0, 1\}$ (each occurring $d_i$ times), $p$-ary variables $y_j \in \{0, \dots, p - 1\}$ (each occurring $d'_j$ times), and constant factors $g_0 \in \Gamma$ compiles in polynomial time into a simple planar bipartite graph $G$ of treewidth at most $2$ (disjoint union of even cycles $C_{2\max(d_i, 2)}$ for each $z_i$, copies of $B_{p, \max(d'_j, 1)}$ for each $y_j$, and single edges $K_2$ for each constant $g_0$, with global edge ordering interleaving the exclusive edges in their exact word positions) such that $\#\M_g(G) = \#\{(z, y) : W(z, y) = g\}$ identically in $\Z$ for every $g \in \Gamma$. \end{enumerate} \end{lemma} \begin{proof} In~(a), all $2\ell + 4$ vertices lie on the outer cycle and all chords $\{u_k, v_\ell\}$ are incident to $v_\ell$ without crossing (Figure~\ref{fig:gadgets}(a)), so $H_\ell^*$ is outerplanar and bipartite. Matching $v_\ell$ to $q_1$ forces $\{u_1, p_1\}$ and leaves the even path $v_1 - u_2 - \dots - u_\ell - p_2 - q_2$, which has a unique perfect matching ($M^{(1)}$); symmetrically matching $v_\ell$ to $q_2$ yields $M^{(\ell)}$ uniquely; matching $v_\ell$ to $u_k$ ($2 \le k \le \ell - 1$) forces $\{p_1, q_1\}, \{p_2, q_2\}$ and leaves two disjoint even paths $u_1 - \dots - v_{k-1}$ and $v_k - \dots - u_\ell$, each with a unique perfect matching ($M^{(k)}$). Thus $H_\ell^*$ has exact count $\ell$, with $\{u_1, p_1\}, \{q_1, v_\ell\}$ exclusive to $M^{(1)}$ and $\{u_\ell, p_2\}, \{q_2, v_\ell\}$ exclusive to $M^{(\ell)}$. In~(b), matching $r$ along path $k^*$ forces all $d' + 1$ odd edges on path $k^*$ (matching $r'$) and all $d'$ even edges on every other path $k \neq k^*$, giving exact count $p$ (Figure~\ref{fig:gadgets}(b)). In~(c), each $z_i$ occurring $d_i$ times uses $C_{2\max(d_i, 2)}$ (two perfect matchings $M_i^{(0)}, M_i^{(1)}$, labeling $d_i$ edges of $M_i^{(1)}$---or of $M_i^{(0)}$ for $1 - z_i$---and $1_\Gamma$ elsewhere), each $y_j$ uses $B_{p, \max(d'_j, 1)}$ (placing its $p$ mutually exclusive edges for each occurrence---one per path $k$, labeled for $y_j = k$---consecutively in that word slot), and each constant $g_0$ uses a single disjoint $K_2$ labeled $g_0$ ($1$ matching, without spurious factors). Placing the labeled edges in their exact left-to-right word slots in the global edge ordering (and placing all $1_\Gamma$-labeled edges at the end) gives a bijection between $\M(G)$ and $\{0, 1\}^N \times \{0, \dots, p - 1\}^M$ preserving $w_{\ord}$ identically. \end{proof} \subsection{Proof of Theorem~\ref{thm:mod-trichotomy}\textup{(II)(b)}: Off-prime hardness in \texorpdfstring{$\Cp$}{C\_p}} Let $\Gamma = P \rtimes A \in \Cp$ be non-abelian and let $\ell \neq p$ be any prime divisor of $q$. Since knowing $\#\M_g(G) \bmod q$ immediately determines $\#\M_g(G) \bmod \ell$, it suffices to reduce a $\mathsf{Mod}_\ell\mathsf{P}$-complete problem to $\#\M_g(G) \bmod \ell$ on simple planar bipartite treewidth-$2$ graphs. We treat two exhaustive cases: $\Gamma$ non-nilpotent, and $\Gamma$ nilpotent. In the second case, since $P$ is a normal Sylow $p$-subgroup and $A$ is an abelian $p'$-complement, nilpotency forces $\Gamma = P \times A$ with $P$ a non-abelian $p$-group; restricting all edge labels to the subgroup $P \le \Gamma$ reduces immediately to $P$. \medskip\noindent\textbf{Subcase II-A: $\Gamma = P \rtimes A$ is non-nilpotent.} Because $\Gamma$ is non-nilpotent, $A$ acts non-trivially by conjugation on $P$. Since $\gcd(|A|, |P|) = 1$, Burnside's coprime-action theorem implies that $A$ acts non-trivially on the Frattini quotient $V := P / \Phi(P)$ (an $\F_p$-vector space). Pick an element $a \in A$ whose conjugation action on $V$ has prime order $q' \neq p$ (possible by lifting any prime-order element of the non-trivial abelian $p'$-group $A / C_A(V)$), and pick $u \in P$ whose image $v_0 := \bar{u} \in V$ is not fixed by $a$; write $v_k := a^k v_0 a^{-k} \in V$. Any linear functional $\psi : V \to \F_p$ lifts via $P \twoheadrightarrow V$ to a group homomorphism $\widetilde{\psi} : P \to \F_p$. For any compiled graph $G$ whose matching products all lie in $P$, put \[ N_r \;:=\; \sum_{g \in P :\, \widetilde{\psi}(g) = r} \#\M_g(G) \qquad (r \in \F_p), \] computable modulo $\ell$ via at most $|P| = O_\Gamma(1)$ non-adaptive oracle queries. \emph{Case $p = 2$ (so $\ell \ge 3$ and $q' \ge 3$ are odd primes):} Because $a v_0 \neq v_0$ and $q' \ge 3$ is an odd prime ($\gcd(2, q') = 1$), the three vectors $v_0, v_{-1}, v_{-2} \in V$ are nonzero and pairwise distinct. Over $\F_2$, $\operatorname{span}_{\F_2}(v_{-1}, v_{-2}) = \{0, v_{-1}, v_{-2}, v_{-1} + v_{-2}\}$, giving two exhaustive possibilities: \begin{itemize} \item \emph{If $v_0 + v_{-1} + v_{-2} = 0$:} Applying $a$ gives $v_1 + v_0 + v_{-1} = 0$, so $v_1 = v_{-2}$, forcing $q' = 3$. Choose $\psi : V \to \F_2$ with $\psi(v_0) = 0$ and $\psi(v_1) = \psi(v_2) = 1$. Given a distinct-variable \textsc{Positive 1-in-3-SAT} instance $\Phi$ ($m$ clauses $C_j = \{a_j, b_j, c_j\}$), put $u_j := x_{a_j} + x_{b_j} + x_{c_j} - 1 \in \{-1, 0, 1, 2\}$ (so $u_j \equiv 0 \pmod 3 \iff u_j = 0$) and form the word \[ W(x, y) \;:=\; \prod_{j = 1}^m a^{u_j} u^{y_j} a^{-u_j} \;=\; \prod_{j = 1}^m a^{x_{a_j}} a^{x_{b_j}} a^{x_{c_j}} a^{-1}\, u^{y_j}\, a\, a^{-x_{c_j}} a^{-x_{b_j}} a^{-x_{a_j}} \;\in\; P, \] with fresh Boolean variables $y_j \in \{0, 1\}$. Compiled via Lemma~\ref{lem:gadgets}(c), we obtain $\widetilde{\psi}(W(x, y)) = \sum_{j=1}^m y_j \psi(v_{u_j \bmod 3})$ in $\F_2$, so summing $(-1)^{\widetilde{\psi}(W)}$ over $y \in \{0, 1\}^m$ yields $N_0 - N_1 = 2^m \cdot \#\text{1-in-3-SAT}(\Phi)$ in $\Z$. Since $\ell$ is odd, multiplying $(N_0 - N_1) \bmod \ell$ by $2^{-m} \bmod \ell$ computes $\#\text{1-in-3-SAT}(\Phi) \bmod \ell$ (Lemma~\ref{lem:modl-complete}). \item \emph{If $v_0 \notin \operatorname{span}_{\F_2}(v_{-1}, v_{-2})$:} Choose $\psi : V \to \F_2$ with $\psi(v_0) = 1$ and $\psi(v_{-1}) = \psi(v_{-2}) = 0$. Given any simple graph $H = ([n], E_H)$ ($|E_H| = m$), set $u_j := x_{a_j} + x_{b_j} - 2 \in \{-2, -1, 0\}$ for each edge $e_j = \{a_j, b_j\} \in E_H$ and compile $W(x, y) := \prod_{j=1}^m a^{u_j} u^{y_j} a^{-u_j} \in P$. For each edge $e_j$, summing $(-1)^{y_j \psi(v_{u_j})}$ over $y_j \in \{0, 1\}$ gives $2$ if $(x_{a_j}, x_{b_j}) \neq (1, 1)$ ($u_j \in \{-2, -1\}$) and $0$ if $(x_{a_j}, x_{b_j}) = (1, 1)$ ($u_j = 0$). Hence $N_0 - N_1 = 2^m \cdot \#\IS(H)$ in $\Z$; multiplying by $2^{-m} \bmod \ell$ computes $\#\IS(H) \bmod \ell$ (Lemma~\ref{lem:modl-complete}). \end{itemize} \emph{Case $p \ge 3$ odd ($\ell \neq p$ arbitrary, including $\ell = 2$):} Given a distinct-variable \textsc{Positive 1-in-3-SAT} instance $\Phi$ ($m$ clauses, $u_j := x_{a_j} + x_{b_j} + x_{c_j} - 1 \in \{-1, 0, 1, 2\}$), note that for every odd prime $p \ge 3$, $u_j \equiv 0 \pmod p \iff u_j = 0$. Introduce $m$ fresh $p$-ary variables $y_1, \dots, y_m \in \{0, \dots, p - 1\}$: \begin{itemize} \item \emph{If $a$ has an eigenvector $v_0 \in V \setminus \{0\}$ with eigenvalue $\lambda \in \F_p^\times \setminus \{1\}$} (automatic when $q' = 2$, since $a^2$ acts trivially on $V$ and splits $V = V_{+1} \oplus V_{-1}$ with $V_{-1} \neq \{0\}$): lift $v_0$ to a representative $u \in P$, pick $\psi : V \to \F_p$ with $\psi((\lambda - 1) v_0) = 1$, and compile \[ W(x, y) \;:=\; \prod_{j = 1}^m \bigl[a^{x_{a_j}}, u^{y_j}\bigr]\bigl[a^{x_{b_j}}, u^{y_j}\bigr]\bigl[a^{x_{c_j}}, u^{y_j}\bigr]\bigl[a, u^{-y_j}\bigr] \;\in\; P \] via Lemma~\ref{lem:gadgets}(c) using $B_{p, 8}$ for each $y_j$ (8 occurrences per $y_j$). Since $\widetilde{\psi}([a^x, u^y]) = x y \pmod p$ for all $x \in \{0, 1\}$, we obtain $\widetilde{\psi}(W(x, y)) = \sum_{j=1}^m y_j u_j \pmod p$. \item \emph{Otherwise:} Having no eigenvector with eigenvalue in $\F_p^\times \setminus \{1\}$ forces $q' \ge 3$ odd and, for the non-fixed vector $v_0 = \bar{u}$ chosen above, forces $v_1 = a v_0 a^{-1} \notin \F_p v_0$ (else $v_0$ would be an eigenvector with eigenvalue $\neq 1$). In the quotient $\overline{V} := V / \F_p v_0$ ($d_0 := \dim_{\F_p} \overline{V} \ge 1$), the three images $\bar{v}_{-1}, \bar{v}_1, \bar{v}_2$ are all nonzero: $\bar{v}_1 \neq 0$ by assumption; $v_{-1} = \mu v_0$ would imply $v_1 = \mu^{-1} v_0$; and $v_2 = \mu v_0$ would imply $a^2 v_0 = \mu v_0$, whence $v_1 = a v_0 \in \F_p v_0$ because $\gcd(2, q') = 1$ for odd prime $q' \ge 3$. The three proper hyperplanes $K_r := \{\phi \in \overline{V}^* : \phi(\bar{v}_r) = 0\}$ ($r \in \{-1, 1, 2\}$) all contain $0 \in \overline{V}^*$, so $|K_{-1} \cup K_1 \cup K_2| \le 3 p^{d_0 - 1} - 2 < p^{d_0}$ for every $p \ge 3$. Hence there exists $\psi : V \to \F_p$ with $\psi(v_0) = 0$ and $\psi(v_{-1}), \psi(v_1), \psi(v_2) \neq 0$. Compiling $W(x, y) := \prod_{j=1}^m a^{u_j} u^{y_j} a^{-u_j} \in P$ via Lemma~\ref{lem:gadgets}(c) (using $B_{p, 1}$ for each $y_j$) gives $\widetilde{\psi}(W(x, y)) = \sum_{j=1}^m y_j \psi(v_{u_j}) \pmod p$. \end{itemize} In both subcases, writing $\omega_p := e^{2\pi i / p}$, summing $\omega_p^{\widetilde{\psi}(W(x, y))}$ over all $y \in \{0, \dots, p - 1\}^m$ collapses each unsatisfied clause ($u_j \neq 0$) to $0$ and each satisfied clause ($u_j = 0$) to $p$, yielding \[ \sum_{r = 0}^{p - 1} N_r \omega_p^r \;=\; p^m \cdot \#\text{1-in-3-SAT}(\Phi) \qquad \text{in } \Z[\omega_p]. \] Since $\Phi_p(X) = 1 + X + \dots + X^{p - 1}$ is irreducible over $\Q$, this forces $N_1 = N_2 = \dots = N_{p - 1}$ and the exact integer identity $N_0 - N_1 = p^m \cdot \#\text{1-in-3-SAT}(\Phi)$. Reducing modulo $\ell \neq p$ and multiplying by $p^{-m} \bmod \ell$ computes $\#\text{1-in-3-SAT}(\Phi) \bmod \ell$ (Lemma~\ref{lem:modl-complete}). \medskip\noindent\textbf{Subcase II-B: $\Gamma = P \times A$ is nilpotent (labels restricted to $P \le \Gamma$; $\ell \neq p$).} Because $P$ is a non-abelian $p$-group, the second center strictly exceeds the center ($Z_2(P) \supsetneq Z(P)$). Choose $a_0 \in Z_2(P) \setminus Z(P)$ and $b \in P$ with $[a_0, b] \in Z(P) \setminus \{1\}$ of order $p^{k+1}$ ($k \ge 0$). Since $x \mapsto [x, b]$ is a homomorphism on $\langle a_0 \rangle$, setting $a := a_0^{p^k}$ gives $z := [a, b] \in Z(P)$ of exact prime order $p$, satisfying $[a^t, b^{r(1 - x)}] = z^{rt(1 - x)} \in \langle z \rangle \cong \Z_p$ for all $t, x \in \{0, 1\}$ and $r \in \Z$. Work in the finite commutative cyclotomic quotient ring $R_{p, \ell} := \Z[\omega_p] / (\ell) \cong \F_\ell[X]/(\Phi_p(X))$, which is a free $\F_\ell$-module of rank $p - 1$ with basis $\{1, \omega_p, \dots, \omega_p^{p - 2}\}$ (and $\omega_p^{p - 1} = -\sum_{r = 0}^{p - 2} \omega_p^r$). Let $\mu_{p,\ell} := |R_{p, \ell}^\times| = O_{p, \ell}(1)$ be the order of its unit group. Given any simple graph $H = ([n], E_H)$ ($|E_H| = m$), compile each vertex variable $x_u \in \{0, 1\}$ on an even cycle $C_{2\max(2 \mu_{p,\ell} \deg_H(u), 2)}$ putting $b, b^{-1}$ on edges of $M_u^{(0)}$ (active when $x_u = 0$), and for each edge $e = \{u, v\} \in E_H$ introduce $\mu_{p,\ell}$ independent edge gadgets whose commutator blocks occupy disjoint contiguous intervals of the global edge ordering: \begin{itemize} \item \emph{If $\ell \ge 3$ is odd ($\ell \neq p$):} For each edge $e$, take $\mu_{p,\ell}$ disjoint copies of the outerplanar fan-cycle $H_\ell^*$ (Lemma~\ref{lem:gadgets}(a)), choosing $(t_1, t_2) = (1, 0)$ on $M^{(1)}$, $(0, 1)$ on $M^{(\ell)}$, and $(0, 0)$ on $M^{(2)}, \dots, M^{(\ell - 1)}$, and interleaving the two exclusive edges of $M^{(1)}$ with $(b^{1 - x_u}, b^{-(1 - x_u)})$ and the two exclusive edges of $M^{(\ell)}$ with $(b^{1 - x_v}, b^{-(1 - x_v)})$ to form $[a^{t_1}, b^{1 - x_u}][a^{t_2}, b^{1 - x_v}] = z^{t_1(1 - x_u) + t_2(1 - x_v)}$. Summing $\omega_p^{t_1(1 - x_u) + t_2(1 - x_v)}$ over the $\ell$ matchings of each copy in $R_{p, \ell}$ gives \[ F_{\mathrm{odd}}(x_u, x_v) \;=\; (\ell - 2) + \omega_p^{1 - x_u} + \omega_p^{1 - x_v} \;\equiv\; \begin{cases} 2(\omega_p - 1) & \text{if } (x_u, x_v) = (0, 0), \\ \omega_p - 1 & \text{if } (x_u, x_v) \in \{(1, 0), (0, 1)\}, \\ 0 \pmod \ell & \text{if } (x_u, x_v) = (1, 1). \end{cases} \] Because $\ell$ is odd and $N_{\Q(\omega_p)/\Q}(1 - \omega_p) = \Phi_p(1) = p \not\equiv 0 \pmod \ell$, both $2$ and $\omega_p - 1$ are units in $R_{p, \ell}$. Thus $F_{\mathrm{odd}}(x_u, x_v)^{\mu_{p,\ell}} = \one[(x_u, x_v) \neq (1, 1)]$ in $R_{p, \ell}$. \item \emph{If $\ell = 2$ ($p \ge 3$ odd):} Take $\mu_{p,2}$ disjoint $4$-cycles $C_4$ (two matchings $M^{(1)}, M^{(2)}$, giving a $2$-regular outerplanar bipartite graph), choosing $(t_1, t_2) = (1, 0)$ on $M^{(1)}$ and $(0, 1)$ on $M^{(2)}$ and inserting $[a^{t_1}, b^{1 - x_u}][a^{t_2}, b^{2(1 - x_v)}]$ ($b^2, b^{-2}$ on $M_v^{(0)}$). Summing over the two matchings of each $C_4$ in $R_{p, 2}$ gives \[ F_2(x_u, x_v) \;=\; \omega_p^{1 - x_u} + \omega_p^{2(1 - x_v)} \;=\; \begin{cases} \omega_p(1 + \omega_p) & \text{if } (x_u, x_v) = (0, 0), \\ 1 + \omega_p^2 & \text{if } (x_u, x_v) = (1, 0), \\ 1 + \omega_p & \text{if } (x_u, x_v) = (0, 1), \\ 2 \equiv 0 \pmod 2 & \text{if } (x_u, x_v) = (1, 1). \end{cases} \] Because $p$ is odd, for $k \in \{1, 2\}$ we have the explicit inverse $(1 + \omega_p^k)\sum_{j = 0}^{(p - 1)/2} \omega_p^{2jk} = 1$ in $\Z[\omega_p]$ (the exponents cover $\{0, \dots, p - 1\}$ once each, summing to $0$, plus $\omega_p^{pk} = 1$), so $1 + \omega_p$ and $1 + \omega_p^2$ are units in $R_{p, 2}$. Thus $F_2(x_u, x_v)^{\mu_{p,2}} = \one[(x_u, x_v) \neq (1, 1)]$ in $R_{p, 2}$. \end{itemize} In both cases, the entire product lies in $\langle z \rangle$ and obeys $\sum_{r = 0}^{p - 1} \#\M_{z^r}(G)\, \omega_p^r = \#\IS(H) \cdot 1$ in $R_{p, \ell}$. Expanding $\omega_p^{p - 1} = -\sum_{r = 0}^{p - 2} \omega_p^r$ and reading the basis-$1$ coefficient yields \[ \#\IS(H) \;\equiv\; \#\M_1(G) - \#\M_{z^{p - 1}}(G) \pmod \ell, \] using just $2$ non-adaptive oracle queries and completing Theorem~\ref{thm:mod-trichotomy}(II)(b) by Lemma~\ref{lem:modl-complete}. \subsection{Proof of Theorem~\ref{thm:mod-trichotomy}\textup{(III)}: Class III via Frobenius's normal \texorpdfstring{$p$}{p}-complement theorem} Let $\Gamma$ be any finite group with $\Gamma \notin \bigcup_p \Cp$ (in particular, $\Gamma$ is non-abelian and not a $p$-group). Call a prime $p$ \emph{active} in $\Gamma$ if $\Gamma$ contains a non-abelian subgroup belonging to $\Cp$ (such a subgroup is non-nilpotent, or it contains a non-abelian $p$-subgroup). \begin{lemma}[Two active primes]\label{lem:two-primes} Every finite group $\Gamma \notin \bigcup_p \Cp$ has at least two distinct active primes $p_1 \neq p_2$. \end{lemma} \begin{proof} Suppose for contradiction that at most one prime $p$ is active in $\Gamma$ (taking any prime $p$ if none is active). Then for every prime $r \neq p$: \begin{enumerate} \item Every Sylow $r$-subgroup of $\Gamma$ is abelian (otherwise $r$ is active). \item For every $r$-subgroup $Q \le \Gamma$, the quotient $N_\Gamma(Q) / C_\Gamma(Q)$ is an $r$-group: otherwise some element $x \in N_\Gamma(Q) \setminus C_\Gamma(Q)$ of prime-power order $s^a$ ($s \neq r$ prime) acts non-trivially on $Q$, making the subgroup $Q \rtimes \langle x \rangle \le \Gamma$ a non-nilpotent group with normal Sylow $r$-subgroup $Q$ and cyclic abelian $r'$-complement $\langle x \rangle$---that is, a non-abelian subgroup in $\mathcal{C}_r$, contradicting the inactivity of $r$. \end{enumerate} By Frobenius's normal $p$-complement theorem~\cite{Frobenius1907}, for every prime $r \neq p$ the group $\Gamma$ possesses a normal $r$-complement $K_r \trianglelefteq \Gamma$ (a normal subgroup of index $|\Gamma|_r$ with $\Gamma / K_r$ isomorphic to a Sylow $r$-subgroup of $\Gamma$, hence abelian). Put $P := \bigcap_{r \neq p} K_r \trianglelefteq \Gamma$. Because every $r$-part ($r \neq p$) divides $[\Gamma : K_r]$ and $p \nmid [\Gamma : K_r]$, $P$ is a normal Sylow $p$-subgroup of $\Gamma$. Moreover, the diagonal homomorphism $\Gamma / P \hookrightarrow \prod_{r \neq p} (\Gamma / K_r)$ embeds $\Gamma / P$ into a direct product of abelian groups, forcing $\Gamma / P$ to be an abelian $p'$-group. By Schur--Zassenhaus, $\Gamma = P \rtimes A \in \Cp$, contradicting $\Gamma \notin \bigcup_p \Cp$. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:mod-trichotomy}\textup{(III)}] Given any integer $q \ge 2$ and any prime divisor $\ell \mid q$, Lemma~\ref{lem:two-primes} supplies two distinct active primes $p_1 \neq p_2$ in $\Gamma$. At least one of them satisfies $p_i \neq \ell$. Restricting edge labels to the active non-abelian subgroup $H \le \Gamma$ in $\mathcal{C}_{p_i}$ and invoking Subcase~II-A or II-B of Theorem~\ref{thm:mod-trichotomy}(II)(b) yields $\mathsf{Mod}_\ell\mathsf{P}$-hardness of $\#\M_{g^*}^\Gamma(G) \bmod q$ on simple planar bipartite treewidth-$2$ graphs. \end{proof} \section{Graph-Class Separation on \texorpdfstring{$2$}{2}-Regular Outerplanar Graphs}\label{sec:order72} We now prove Theorem~\ref{thm:order72}: while every Class~III group is hard modulo every prime on planar bipartite treewidth-$2$ graphs, every $\Gamma = P \rtimes Q$ with odd-$p$ $p$-group $P$ and non-abelian class-$2$ $2$-group $Q$ having $Z(Q) \cong \Z_2$---starting in Class~III at order~$24$ with $D_{24} \cong \Z_3 \rtimes D_8$ and $\mathrm{Dic}_6 \cong \Z_3 \rtimes Q_8$, and reaching its smallest faithful non-nilpotent-by-abelian instances at order~$72$ with $\Z_3^2 \rtimes Q_8$ and $\Z_3^2 \rtimes D_8$---admits a deterministic polynomial-time mod-$p$ algorithm on all $2$-regular outerplanar bipartite graphs. \begin{proof}[Proof of Theorem~\ref{thm:order72}] Part~(a) holds unconditionally by restricting edge labels to the non-abelian $2$-subgroup $Q \le \Gamma$ and applying Theorem~\ref{thm:mod-trichotomy}(II)(b) (Subcase~II-B) at the odd prime $p \neq 2$. Moreover, whenever $P$ is non-abelian or $Q$ acts non-trivially on $P$---in particular for $D_{24} \cong \Z_3 \rtimes D_8$, $\mathrm{Dic}_6 \cong \Z_3 \rtimes Q_8$, and the faithful order-$72$ semidirect products $\Z_3^2 \rtimes Q_8$ and $\Z_3^2 \rtimes D_8$---both $2$ and $p$ are active, placing $\Gamma$ in Class~III of Theorem~\ref{thm:mod-trichotomy} so that every modulus $q \ge 2$ is hard on planar bipartite treewidth-$2$ graphs. For Part~(b), let $G = \bigsqcup_{i = 1}^k C_{2n_i}$ be any simple $2$-regular outerplanar bipartite graph with $m = |E(G)|$ and arbitrary global edge ordering $e_1 < \dots < e_m$. Each cycle $C_{2n_i}$ has exactly two perfect matchings, parameterized by a bit $y_i \in \F_2$, so $\M(G) \cong \F_2^k$ and each edge indicator $x_s = \one[e_s \in M]$ equals $y_{i(s)}$ or $1 - y_{i(s)}$. Let $Z(Q) = \{1, z\} \cong \Z_2$. Because $Q$ has nilpotency class $2$ and $Z(Q) \cong \Z_2$, for all $x, y \in Q$ we have $[x^2, y] = [x, y]^2 = 1$, so $x^2 \in Z(Q)$ and the quotient $Q / Z(Q) \cong \F_2^r$ is elementary abelian ($r = 2$ for $Q_8$ and $D_8$). Fix a finite splitting field $\F_{p^s}$ of $Q$ ($p \ge 3$ odd implies $p \nmid |Q|$). \begin{enumerate} \item \emph{Maschke and augmentation-ideal expansion over $\F_{p^s}$:} Write $w(e_t) = (u_t, h_t) \in P \rtimes Q$ and $g^* = (u^*, h^*)$. Since $p \nmid |Q|$, Maschke's theorem decomposes the $Q$-conjugation module $I_P \subset \F_{p^s}[P]$ into irreducible $\F_{p^s}[Q]$-representations $\rho \in \Irr(Q)$, expressing \[ h\,(u_t - 1)\,h^{-1} \;=\; \sum_{\rho \in \Irr(Q)} \sum_{a, b = 1}^{d_\rho} \rho(h)_{a, b}\, \Delta_{t, \rho, a, b} \qquad (\Delta_{t, \rho, a, b} \in I_P), \] while $\one[h(M) = h^*] = \frac{1}{|Q|} \sum_{\rho \in \Irr(Q)} d_\rho \Tr(\rho(h^*)^{-1} \rho(h(M)))$ in $\F_{p^s}$. Because $I_P^{\nu(P) + 1} = 0$ in $\F_{p^s}[P]$, expanding $u(M) = \prod_{t=1}^m (1 + x_t h_{< t}(M)(u_t - 1) h_{< t}(M)^{-1})$ truncates at degree $d \le \nu(P)$ and expresses $\one[w_{\ord}(M) = g^*] \in \F_{p^s}$ as a sum of $O_\Gamma(m^{\nu(P)})$ terms of the form \[ c_\tau \cdot x_{t_1} \cdots x_{t_d} \cdot \rho_0\bigl(h(M)\bigr)_{a_0, b_0} \prod_{j = 1}^d \rho_j\bigl(h_{< t_j}(M)\bigr)_{a_j, b_j} \qquad (0 \le d \le \nu(P)). \] \item \emph{Exact $\F_2$-quadratic normal form for prefix products $h_{< t}(y) \in Q$:} Fix coset lifts $g_1, \dots, g_r \in Q$ of a basis of $Q / Z(Q) \cong \F_2^r$, with $g_\alpha^2 = z^{\kappa_\alpha}$ and $[g_\beta, g_\alpha] = z^{\mu_{\beta, \alpha}}$ ($\alpha < \beta$; $\kappa_\alpha, \mu_{\beta, \alpha} \in \F_2$). Write each edge factor $h_s = z^{w_s} g_1^{a_{s, 1}} \cdots g_r^{a_{s, r}}$ ($w_s, a_{s, \alpha} \in \{0, 1\}$). Collecting $g_1, \dots, g_r$ left-to-right across $s < t$ and using the exact binary identity $\lfloor N / 2 \rfloor \equiv \binom{N}{2} = \sum_{s_1 < s_2} b_{s_1} b_{s_2} \pmod 2$ for any sum $N = \sum_s b_s$ of bits $b_s \in \{0, 1\}$ yields \[ h_{< t}(x) \;=\; z^{\Phi_{< t}(x)}\, g_1^{A_{< t, 1}(x) \bmod 2} \cdots g_r^{A_{< t, r}(x) \bmod 2}, \] where $A_{< t, \alpha}(x) := \sum_{s < t} a_{s, \alpha} x_s$ is $\F_2$-affine in $y$ and \[ \Phi_{< t}(x) \;:=\; \sum_{s < t} w_s x_s + \sum_{s_1 < s_2 < t} \sum_{\alpha < \beta} \mu_{\beta, \alpha} a_{s_1, \beta} a_{s_2, \alpha} x_{s_1} x_{s_2} + \sum_{\alpha = 1}^r \kappa_\alpha \sum_{s_1 < s_2 < t} a_{s_1, \alpha} a_{s_2, \alpha} x_{s_1} x_{s_2} \pmod 2 \] is an exact degree-$\le 2$ polynomial in $y \in \F_2^k$. Its constant term, linear vector, and $k \times k$ quadratic-form matrix are assembled in $O_\Gamma(mk)$ time (rather than $O(m^2)$) by sweeping $s_2 = 1, \dots, t - 1$ while maintaining the $r$ running $\F_2$-affine forms $A_{< s_2, \beta}(y) = c_\beta + \langle v_\beta, y \rangle$ ($c_\beta \in \F_2$, $v_\beta \in \F_2^k$). At each edge $s_2$, updating each $(c_\beta, v_\beta)$ takes $O(1)$ time, and accumulating the product of $x_{s_2} \in \{y_{i(s_2)}, 1 + y_{i(s_2)}\}$ with $\sum_{\alpha < \beta} \mu_{\beta, \alpha} a_{s_2, \alpha} A_{< s_2, \beta}(y) + \sum_{\alpha = 1}^r \kappa_\alpha a_{s_2, \alpha} A_{< s_2, \alpha}(y)$ into the constant, linear (folding $y_{i(s_2)}^2 = y_{i(s_2)}$), and row-$i(s_2)$ quadratic entries of $\Phi_{< t}(y)$ takes $O_\Gamma(k)$ time. For every $\rho \in \Irr(Q)$, Schur's lemma gives $\rho(z) = (-1)^{\varepsilon_\rho} I_{d_\rho}$ ($\varepsilon_\rho \in \{0, 1\}$), while the matrix entry $\rho(g_1^{A_1 \bmod 2} \cdots g_r^{A_r \bmod 2})_{a, b}$ expands by finite Fourier transform on $\F_2^r$ into an $\F_{p^s}$-linear combination of the $2^r = O_\Gamma(1)$ characters $(-1)^{\sum_\alpha \lambda_\alpha A_{< t, \alpha}(y)}$. \item \emph{Exact $O(mk + k^3)$ Dickson quadratic Gauss sum evaluation:} In each of the $O_\Gamma(m^{\nu(P)})$ expanded terms, the indicator product $x_{t_1} \cdots x_{t_d}$ pins at most $d \le \nu(P)$ cycle bits (returning $0$ if two factors conflict on the same cycle), leaving $k' \ge k - \nu(P)$ free bits $y' \in \F_2^{k'}$ and a single $\F_2$-quadratic polynomial $Q_\tau(y') \in \F_2[y']_{\le 2}$ assembled in $O_\Gamma(mk)$ time whose sum is $\sum_{y' \in \F_2^{k'}} (-1)^{Q_\tau(y')} \in \Z \pmod p$. Form its associated alternating bilinear form $B(u, v) := Q_\tau(u + v) + Q_\tau(u) + Q_\tau(v) + Q_\tau(0)$ and compute its radical $R := \ker(B)$ ($\dim R = k' - 2r_0$) by $\F_2$-Gaussian elimination in $O(k^3)$ time~\cite{Dickson1901,EhrenfeuchtKarpinski1990}. If the linear map $v \mapsto Q_\tau(v) + Q_\tau(0)$ is nonzero on $R$, the sum vanishes identically; otherwise, extracting a symplectic basis $(e_1, f_1, \dots, e_{r_0}, f_{r_0})$ of $\F_2^{k'}/R$ in $O(k^3)$ time gives the exact integer sum $(-1)^{Q_\tau(0) + \sum_{j=1}^{r_0} a_j b_j} \cdot 2^{k' - r_0}$ (where $a_j = Q_\tau(e_j) + Q_\tau(0)$ and $b_j = Q_\tau(f_j) + Q_\tau(0)$). Summing all $O_\Gamma(m^{\nu(P)})$ terms in $\F_{p^s}$ outputs $\#\M_{g^*}^\Gamma(G) \bmod p$ in deterministic $O_\Gamma(m^{\nu(P)}(mk + k^3))$ time. \qedhere \end{enumerate} \end{proof} \section{Exact Integer Counting Dichotomy on Outerplanar Bipartite Graphs}\label{sec:outerplanar} We now prove Theorem~\ref{thm:outerplanar-exact}, establishing a complete exact counting dichotomy across all finite groups on outerplanar bipartite graphs, linear-size all-prime hardness for every non-solvable group, and the sharp $\Delta = 2$ vs.\ $\Delta = 3$ transition. We begin with an elementary closure property used throughout the hardness proofs. \begin{lemma}[Subquotient closure]\label{lem:subquotient} Let $H \trianglelefteq S \le \Gamma$ be any subquotient of a finite group $\Gamma$. For any simple graph $G$ with edge labels in $S/H$, lifting each edge label arbitrarily to a coset representative in $S \le \Gamma$ satisfies \[ \#\M_{\bar{g}}^{S/H}(G) \;=\; \sum_{g \in \bar{g} H} \#\M_g^\Gamma(G) \qquad \text{in } \Z \] (and hence modulo every integer $\ell \ge 2$), using $|H| = O_\Gamma(1)$ non-adaptive queries without division. \end{lemma} \begin{proof} Every perfect matching $M \in \M(G)$ has ordered product $w_{\ord}(M) \in S$, whose image under the quotient map $\pi : S \twoheadrightarrow S/H$ equals the ordered product of the $S/H$-labels of $M$. Thus $\pi(w_{\ord}(M)) = \bar{g} \iff w_{\ord}(M) \in \bar{g} H$. \end{proof} \subsection{Tractable regime on \texorpdfstring{$\Delta = 2$}{Delta = 2}: \texorpdfstring{$\Gamma \in \Ab \cup \Qf$}{Gamma in Ab U Q\_4} via \texorpdfstring{$\Z_4$}{Z\_4}-quadratic Gauss sums} If $\Gamma \in \Ab$, Theorem~\ref{thm:mod-trichotomy}(I) already places exact counting in deterministic $\mathsf{NC}^2$, and on $G = \bigsqcup_{i=1}^k C_{2n_i}$ the $O_\Gamma(mk + k^3)$ bound holds even more sharply: since $\Gamma$ is abelian, computing the two matching products $(g_{i,0}, g_{i,1}) \in \Gamma^2$ of each cycle in one $O(m)$ pass and running dynamic programming over $i = 1, \dots, k$ on a count vector in $\Z_{\ge 0}^\Gamma$ computes $\#\M_{g^*}^\Gamma(G)$ in $O(m + |\Gamma|k)$ operations on $O(k)$-bit integers. On any simple graph of maximum degree $\Delta \le 2$, every odd-vertex component (isolated vertex, odd path, or odd cycle) forces $\#\M_{g^*}(G) = 0$, while every even path has a unique forced perfect matching whose edges stay in place as fixed constant slots $x_s = 1$ in the ordered product $h(x)$ below (if no even cycles remain, we simply test whether this unique matching has product $g^*$; otherwise the fixed slots are handled directly in the same prefix scan as $2$-regular cycles), so counting on $\Delta \le 2$ reduces immediately to $2$-regular outerplanar bipartite graphs $G = \bigsqcup_{i=1}^k C_{2n_i}$. Assume $\Gamma = Q \in \Qf$ (a class-$2$ $2$-group with $\exp(Q) \le 4$, hence automatically $\exp(Q') \le 2$) and $G = \bigsqcup_{i=1}^k C_{2n_i}$ ($\M(G) \cong \{0, 1\}^k$, $x_s \in \{y_{i(s)}, 1 - y_{i(s)}\}$). \begin{lemma}[Deterministic $O(k^3)$ $\Z_4$-quadratic Gauss sum elimination]\label{lem:z4-gauss} Given a symmetric zero-diagonal matrix $M \in \{0, 1\}^{k \times k}$ and a vector $a \in \{0, 1, 2, 3\}^k$, the Gaussian-integer sum \[ S(M, a) \;:=\; \sum_{y \in \{0, 1\}^k} i^{\,2\sum_{u < v} M_{uv} y_u y_v + \sum_{u = 1}^k a_u y_u} \;\in\; \Z[i] \] is computable exactly in deterministic $O(k^3)$ arithmetic operations on $O(k)$-bit Gaussian integers. \end{lemma} \begin{proof} Proceed recursively on $k$ (returning $1$ at $k = 0$), cf.~\cite{DehaeneDeMoor2003,CaiChenLiptonLu2010}: \begin{itemize} \item \emph{Case 1 (some $a_u \in \{1, 3\}$ is odd):} Let $S_u := \{v \neq u : M_{uv} = 1\}$, $N := \sum_{v \in S_u} y_v$, $L_u := N \bmod 2 \in \{0, 1\}$, and $c := (a_u + 2) \bmod 4 \in \{1, 3\}$. Summing over $y_u \in \{0, 1\}$ gives $1 + i^{a_u}(-1)^{L_u} = (1 + i^{a_u}) i^{c L_u}$ (directly verified for both $L_u \in \{0, 1\}$ and $a_u \in \{1, 3\}$). Using $L_u \equiv N^2 = \sum_{v \in S_u} y_v + 2\sum_{v < w \in S_u} y_v y_w \pmod 4$ and $2c \equiv 2 \pmod 4$, eliminating $y_u$ multiplies the running scalar by $(1 + i^{a_u})$, adds $c \pmod 4$ to $a_v$ for every $v \in S_u$, flips $M_{vw} \mapsto M_{vw} \oplus 1$ for all distinct $v, w \in S_u$, and reduces $k \to k - 1$ in $O(k^2)$ time. \item \emph{Case 2 (all $a_r \in \{0, 2\}$ are even and some $M_{uv} = 1$):} Put $b_r := a_r / 2 \in \{0, 1\}$, $L_u := \sum_{w \neq u, v} M_{uw} y_w$, and $L_v := \sum_{w \neq u, v} M_{vw} y_w$. Summing over $(y_u, y_v) \in \{0, 1\}^2$ gives \[ \sum_{y_u, y_v \in \{0, 1\}} (-1)^{y_u y_v + y_u(b_u + L_u) + y_v(b_v + L_v)} \;=\; 2(-1)^{(b_u + L_u)(b_v + L_v)}, \] updating $M, a$ on the remaining $k - 2$ variables in $O(k^2)$ time. \item \emph{Case 3 (all $a_r \in \{0, 2\}$ are even and $M = 0$):} Return $0$ if some $a_r = 2$, and $2^k$ otherwise. \end{itemize} At every step $|S| \le 2^k$, so all intermediate Gaussian integers have $O(k)$ bits, giving deterministic $O(k^3)$ operations. \end{proof} To prove the upper bound of Theorem~\ref{thm:outerplanar-exact}(a) for $Q \in \Qf$, observe that $\exp(Q') \le 2$ gives $[x^2, y] = [x, y]^2 = 1$, so $Q/Z(Q) \cong \F_2^r$. Fixing coset lifts $g_1, \dots, g_r$ and writing $h_s = z_s g_1^{a_{s,1}} \cdots g_r^{a_{s,r}}$ ($z_s \in Z(Q)$), left-to-right collection yields \[ h(x) \;=\; \Bigl(\prod_s z_s^{x_s}\Bigr) \Bigl(\prod_{\alpha < \beta} [g_\beta, g_\alpha]^{\sum_{s_1 < s_2} a_{s_1,\beta} a_{s_2,\alpha} x_{s_1} x_{s_2}}\Bigr) \Bigl(\prod_\alpha (g_\alpha^2)^{\lfloor A_\alpha(x)/2 \rfloor}\Bigr) g_1^{A_1(x) \bmod 2} \cdots g_r^{A_r(x) \bmod 2}. \] Because $\exp(Q) \le 4$, every irreducible representation $\rho \in \Irr(Q)$ satisfies $\rho(z_s) = i^{w_s} I$, $\rho([g_\beta, g_\alpha]) = i^{2\mu_{\beta,\alpha}} I$, $\rho(g_\alpha^2) = i^{2\kappa_\alpha} I$, and $\Tr(\rho(g)) \in \Z[i]$ (a sum of $4$th roots of unity). Using $\lfloor A_\alpha / 2 \rfloor \equiv \binom{A_\alpha}{2} \pmod 2$ and finite Fourier expansion on $\F_2^r$ ($2^r = O_Q(1)$ characters), the scaled count $|Q|\, 2^r\, \#\M_{h^*}^Q(G)$ is an $O_Q(1)$ $\Z[i]$-linear combination of sums $S(M, a)$. Exactly as in Section~\ref{sec:order72}, each $(M, a)$ is assembled by a single $O_Q(mk)$ incremental prefix scan over the $m$ edges, and then evaluated by Lemma~\ref{lem:z4-gauss}, giving total deterministic runtime $O_Q(mk + k^3)$ Gaussian-integer operations. \subsection{Intractable non-nilpotent groups and linear-size non-solvable hardness} \begin{proposition}[Non-nilpotent intractability and non-solvable all-prime hardness]\label{prop:non-nilpotent} Let $\Gamma$ be any finite non-nilpotent group. Then on simple $2$-regular outerplanar bipartite graphs: \begin{enumerate} \item[\textup{(a)}] Computing exact integer $\#\M_{g^*}^\Gamma(G)$ is $\#\mathsf{P}$-hard. \item[\textup{(b)}] If $\Gamma$ is non-solvable, then computing $\#\M_{g^*}^\Gamma(G) \bmod \ell$ is additionally $\mathsf{Mod}_\ell\mathsf{P}$-hard for every prime $\ell \ge 2$. \end{enumerate} \end{proposition} \begin{proof} Pick a minimal non-nilpotent subgroup $S \le \Gamma$. By Schmidt's theorem~\cite{Schmidt1924} (see~\cite[Satz~III.5.2]{Huppert1967} or~\cite[Theorem~9.1.9]{Robinson1996}), $S = P \rtimes \langle a \rangle$ where $P = O_p(S) \trianglelefteq S$ is a normal Sylow $p$-subgroup ($p$ prime), $\langle a \rangle$ is a cyclic Sylow $q'$-subgroup ($q' \neq p$ prime), $a^{q'} \in Z(S)$, and $V := P/\Phi(P) \cong \F_p^d$ ($d \ge 1$) is a non-trivial irreducible $\F_p[\langle\bar{a}\rangle]$-module with $C_V(\bar{a}) = \{0\}$. Quotienting $S$ by $\Phi(P)\langle a^{q'} \rangle \trianglelefteq S$ yields the Frobenius subquotient \[ \bar{S} \;:=\; V \rtimes \langle \bar{a} \rangle \;\cong\; \F_p^d \rtimes \Z_{q'} \qquad (p \neq q' \text{ distinct primes},\; C_V(\bar{a}) = \{0\}). \] By Lemma~\ref{lem:subquotient}, both exact and mod-$\ell$ counting over $\bar{S}$ reduce to $\Gamma$. Fix any $v \in V \setminus \{0\}$. Because $C_V(\bar{a}) = \{0\}$, the linear map $\bar{a} - 1$ is invertible on $V$, so $u_0 := (\bar{a} - 1)^2 v \in V \setminus \{0\}$. Choose a character $\chi : V \to \C^\times$ with $\chi(u_0) = \omega_p := e^{2\pi i / p}$, and write $\chi(g) = \omega_p^{c(g)}$ ($c(g) \in \F_p$) for $g \in V$. For any simple graph $H = ([n], E_H)$ ($|E_H| = m_H$) and Boolean variables $x_u \in \{0, 1\}$ ($u \in [n]$), $y_e \in \{0, 1\}$ ($e = \{u, v\} \in E_H$), form the $10$-letter double-commutator word in $\bar{S}$: \[ w_e(x_u, x_v, y_e) \;:=\; \bigl[\bar{a}^{x_v},\; [\bar{a}^{x_u}, v^{y_e}]\bigr] \;=\; \bar{a}^{x_v}\bar{a}^{x_u} v^{y_e} \bar{a}^{-x_u} v^{-y_e} \bar{a}^{-x_v} v^{y_e} \bar{a}^{x_u} v^{-y_e} \bar{a}^{-x_u} \;=\; u_0^{\,y_e x_u x_v} \;\in\; V. \] Direct check on all four pairs $(x_u, x_v) \in \{0, 1\}^2$ confirms $[\bar{a}^{x_u}, v^{y_e}] = ((\bar{a}-1)v)^{y_e x_u}$ and hence $w_e = ((\bar{a}-1)^2 v)^{y_e x_u x_v} = u_0^{y_e x_u x_v}$. Each block uses $4$ letters of $x_u$, $2$ of $x_v$, and $4$ of $y_e$; compiling each $x_u$ on $C_{2\max(4\deg_H(u), 4)}$ and each $y_e$ on $C_8$ gives a simple $2$-regular outerplanar bipartite graph $G$ with total ordered product $u_0^{\sum_e y_e x_u x_v} \in V$: \begin{itemize} \item \emph{Case $p = 2$ ($\omega_2 = -1$):} Summing $\chi(g) \#\M_g^{\bar{S}}(G)$ over $g \in V$ ($|V|$ queries) yields \[ \sum_{g \in V} \chi(g)\, \#\M_g^{\bar{S}}(G) \;=\; \sum_{x \in \{0, 1\}^n} \prod_{e = \{u, v\} \in E_H} \bigl(1 + (-1)^{x_u x_v}\bigr) \;=\; 2^{m_H} \cdot \#\IS(H) \qquad \text{in } \Z. \] This proves both $\#\mathsf{P}$-hardness~\cite{Valiant1979SICOMP} and $\mathsf{Mod}_\ell\mathsf{P}$-hardness for every odd prime $\ell \ge 3$ (dividing by $2^{m_H} \bmod \ell$, Lemma~\ref{lem:modl-complete}). \item \emph{Case odd $p \ge 3$:} \begin{enumerate} \item \emph{Exact $\#\mathsf{P}$-hardness:} For each $k \in \{1, \dots, m_H + 1\}$, place $k$ conjugate midpoint pairs $(y_{e,j}, y'_{e,j})$ per edge (using $+v$ on $y_{e,j}$ and $-v$ on $y'_{e,j}$, scaling each vertex cycle to length $2\max(8k\deg_H(u), 4)$). Summing $\chi$ over $y, y'$ assigns each edge weight $4^k$ when $x_u x_v = 0$ and $(1 + \omega_p)^k(1 + \omega_p^{-1})^k = (4\cos^2(\pi/p))^k$ when $x_u x_v = 1$. Writing $e_H(x) := |\{\{u, v\} \in E_H : x_u = x_v = 1\}|$ and dividing by $4^{k m_H}$ evaluates $P_H(\lambda_k) := \sum_{x \in \{0,1\}^n} \lambda_k^{e_H(x)}$ at $m_H + 1$ strictly distinct values $\lambda_k := \cos^{2k}(\pi/p) \in (0, 1)$. Exact Vandermonde interpolation over the fixed-degree number field $\Q(\omega_p)$ recovers $P_H(0) = \#\IS(H)$, proving $\#\mathsf{P}$-hardness~\cite{Valiant1979SICOMP}. \item \emph{$\oplus\mathsf{P}$-hardness ($\mathrm{mod}\, 2$):} Appending one $y_e$-edge labeled $u_0^{-1}$ to each block gives $w'_e = u_0^{y_e(x_u x_v - 1)}$ ($y_e$ on $C_{10}$). Summing $y_e \in \{0, 1\}$ in $R_{p, 2} = \Z[\omega_p]/(2)$ gives $2 \equiv 0 \pmod 2$ if $x_u x_v = 1$, and the cyclotomic unit $1 + \omega_p^{-1} \in R_{p, 2}^\times$ if $x_u x_v = 0$. Placing $\mu_{p,2} := |R_{p, 2}^\times| = O_p(1)$ copies per edge (on vertex cycles of length $2\max(4 \mu_{p,2} \deg_H(u), 4)$) yields $\sum_{g \in V} \omega_p^{c(g)} (\#\M_g^{\bar{S}}(G) \bmod 2) = (\#\IS(H) \bmod 2) \cdot 1$ in $R_{p, 2}$, whose basis-$1$ coefficient extracts $\#\IS(H) \bmod 2$ identically to Subcase~II-B (Lemma~\ref{lem:modl-complete}). \end{enumerate} \end{itemize} This proves Part~(a). For Part~(b), every finite non-solvable group $\Gamma$ contains a minimal simple subquotient $L$ (take a minimal non-solvable subgroup and quotient by a maximal normal subgroup). By Thompson's classification of minimal simple groups~\cite{Thompson1968}, $L$ belongs to one of five families, and every single one contains \emph{both} a $2$-primary Schmidt subquotient $\F_2^d \rtimes \Z_{q'}$ ($q'$ odd) and an odd-primary Schmidt subquotient $\F_r^e \rtimes \Z_{q''}$ ($r \ge 3$ odd, $q'' \neq r$): \begin{enumerate} \item $\PSL(2, 2^t)$ ($t \ge 2$ prime): Borel $\F_{2^t} \rtimes \Z_{2^t - 1} \ge \F_{2^t} \rtimes \Z_{q'}$ ($q' \mid 2^t - 1$), and $D_{2(2^t + 1)} \ge \Z_r \rtimes \Z_2$ ($r \mid 2^t + 1$ odd); \item $\PSL(2, 3^t)$ ($t \ge 3$ odd prime): $\PSL(2, 3) \cong A_4 = \F_2^2 \rtimes \Z_3$, and Borel $\F_{3^t} \rtimes \Z_{(3^t - 1)/2} \ge \F_{3^t} \rtimes \Z_{q''}$ (since $(3^t - 1)/2 \ge 13$ is odd and coprime to $3$); \item $\PSL(2, p)$ ($p > 3$ with $5 \mid (p^2 + 1)$; in fact for every prime $p \ge 5$): contains $A_4 = \F_2^2 \rtimes \Z_3$~\cite[II.8.27]{Huppert1967}, and Borel $\F_p \rtimes \Z_{(p - 1)/2} \ge \F_p \rtimes \Z_{q''}$ ($p \ge 7$) or $D_{10} = \Z_5 \rtimes \Z_2$ ($p = 5$); \item $\Sz(2^t)$ ($t \ge 3$ odd prime): Borel $Q \rtimes \Z_{2^t - 1} \twoheadrightarrow (Q/\Phi(Q)) \rtimes \Z_{q'} \cong \F_{2^t} \rtimes \Z_{q'}$ ($q' \mid 2^t - 1$), and split-torus normalizer $D_{2(2^t - 1)} \ge \Z_r \rtimes \Z_2$ ($r \mid 2^t - 1$ odd); \item $\PSL(3, 3)$: contains $S_4$, hence both $A_4 = \F_2^2 \rtimes \Z_3$ and $S_3 = \Z_3 \rtimes \Z_2$. \end{enumerate} By the two cases above, the $2$-primary subquotient yields $\#\mathsf{P}$-hardness and $\mathsf{Mod}_\ell\mathsf{P}$-hardness for every odd prime $\ell \ge 3$, while the odd-primary subquotient yields $\oplus\mathsf{P}$-hardness ($\ell = 2$), using linear-size graphs and constant commutator depth $2$ (bypassing Barrington's~\cite{Barrington1989} polynomial formula blowup). \end{proof} \subsection{The three nilpotent cases and the \texorpdfstring{$\Delta = 2$}{Delta = 2} vs.\ \texorpdfstring{$\Delta = 3$}{Delta = 3} transition} \begin{proof}[Completion of Theorem~\ref{thm:outerplanar-exact}] To complete Part~(a), let $\Gamma = P_2 \times \prod_{p \ge 3} P_p$ be any finite nilpotent group with $\Gamma \notin \Ab \cup \Qf$. Then $\Gamma$ is non-abelian and falls into at least one of three exhaustive cases on simple $2$-regular outerplanar bipartite graphs (compiling each vertex $x_u$ of a simple graph $H = ([n], E_H)$, $|E_H| = m_H$, on an even cycle of sufficient length): \begin{enumerate} \item \emph{Case 1 (some odd Sylow subgroup $P_p$, $p \ge 3$, is non-abelian):} Pick $a \in Z_2(P_p) \setminus Z(P_p)$ and $b \in P_p$ (power-adjusted as in Subcase~II-B) so that $z := [a, b] \in Z(P_p)$ has exact odd prime order $p$, and choose a character $\psi$ of $Z(P_p)$ with $\psi(z) = \omega_p = e^{2\pi i / p}$. For each $k \in \{1, \dots, m_H + 1\}$ and each edge $e = \{u, v\} \in E_H$, place $k$ conjugate midpoint pairs $(y_{e, j}, y'_{e, j})$ (each on $C_8$) forming $[a^{y_{e, j}}, b^{x_u}][a^{y_{e, j}}, b^{-x_v}][a^{-y'_{e, j}}, b^{x_u}][a^{-y'_{e, j}}, b^{-x_v}] = z^{(y_{e, j} - y'_{e, j})(x_u - x_v)} \in Z(P_p)$. Summing $\psi$ over $(y_{e, j}, y'_{e, j}) \in \{0, 1\}^2$ gives weight $4^k$ when $x_u = x_v$ and $(1 + \omega_p)^k(1 + \omega_p^{-1})^k = (4\cos^2(\pi/p))^k$ when $x_u \neq x_v$ (with $\frac{1}{4} \le \cos^2(\pi/p) < 1$ for every odd prime $p \ge 3$). Writing $e_{\mathrm{mono}}(x) := |\{\{u, v\} \in E_H : x_u = x_v\}|$ and dividing by $4^{k m_H}\cos^{2k m_H}(\pi/p)$ evaluates the ferromagnetic Ising partition function $Z_H^{\mathrm{Ising}}(\beta_k) = \sum_{x \in \{0,1\}^n} \beta_k^{e_{\mathrm{mono}}(x)}$ at $m_H + 1$ strictly distinct values $\beta_k = \cos^{-2k}(\pi/p) > 1$, recovering the cut-size polynomial of $H$ via Vandermonde interpolation over $\Q(\omega_p)$ ($\#\mathsf{P}$-hard~\cite{JaegerVertiganWelsh1990,JerrumSinclair1993}; note that Subcase~II-B at $\ell = 2$ also gives $\oplus\mathsf{P}$-hardness on $2$-regular outerplanar graphs). \item \emph{Case 2 ($P_2$ is non-abelian and $\Gamma$ contains an element $c$ of order $m \nmid 4$):} Pick $a_0 \in Z_2(P_2) \setminus Z(P_2)$ and $b \in P_2$ with $[a_0, b] \in Z(P_2)$ of order $2^e \ge 2$; setting $a := a_0^{2^{e - 1}}$ yields $z := [a, b] \in Z(P_2)$ of exact order $2$. Replacing $c$ by a power, assume $c \in \Gamma$ has order $m \in \{8\} \cup \{p \ge 3 \text{ prime}\}$; since $z \in Z(P_2) \le Z(\Gamma)$, $z$ commutes with $c$. Choose a character $\psi$ of abelian $\langle z, c \rangle$ with $\psi(z) = -1$ and $\psi(c) = \omega_m$ (consistent even when $m = 8$ and $z = c^4$, since $\omega_8^4 = -1$). For each $k \in \{1, \dots, m_H + 1\}$ and each edge $e = \{u, v\} \in E_H$, place a midpoint cycle $y_e$ (on $C_{2(8k + 4)}$) forming $[a^{y_e}, b^{x_u}][a^{y_e}, b^{x_v}] = z^{y_e(x_u + x_v)}$ and $4k$ pendant cycles $p_{e, j}$ (each on $C_6$) forming $[a^{y_e}, b^{p_{e, j}}] c^{p_{e, j}} = z^{y_e p_{e, j}} c^{p_{e, j}} \in \langle z, c \rangle$. Summing $p_{e, j}$ and $y_e$ yields \[ (1 + \omega_m)^{4k} + (-1)^{x_u + x_v}(1 - \omega_m)^{4k} \;=\; (1 + \omega_m)^{4k}\bigl(1 + (-1)^{x_u + x_v} r^{4k}\bigr), \] where $r := \tan(\pi / m) \in (0, \sqrt{3}] \setminus \{1\}$ (since $(1 - \omega_m)/(1 + \omega_m) = -i\tan(\pi/m)$ and $m \ge 3, m \neq 4$). This evaluates $Z_H^{\mathrm{Ising}}(\beta_k) = \sum_{x \in \{0,1\}^n} \beta_k^{e_{\mathrm{mono}}(x)}$ at $m_H + 1$ strictly distinct real values $\beta_k = (1 + r^{4k})/(1 - r^{4k})$ (negative when $m = 3$, since $r = \sqrt{3} > 1$), recovering the cut-size polynomial by Vandermonde interpolation ($\#\mathsf{P}$-hard~\cite{JaegerVertiganWelsh1990,JerrumSinclair1993}). \item \emph{Case 3 ($\Gamma = P_2$ has exponent $\le 4$ and nilpotency class $\ge 3$):} Pick $a_0 \in Z_3(P_2) \setminus Z_2(P_2)$ and $b, c \in P_2$ with $[[a_0, b], c] \in Z(P_2)$ of order $2^e \ge 2$. For any $x_1, x_2 \in Z_3(P_2)$, $[x_1, b] \in Z_2(P_2) \implies [[x_1, b], x_2] \in Z(P_2)$, so $x \mapsto [x, b] \bmod Z(P_2)$ is a homomorphism $Z_3(P_2) \to Z_2(P_2)/Z(P_2)$ and $[\cdot, c] : Z_2(P_2)/Z(P_2) \to Z(P_2)$ is a homomorphism. Setting $a := a_0^{2^{e - 1}}$ therefore gives $z := [[a, b], c] = [[a_0, b], c]^{2^{e - 1}} \in Z(P_2)$ of exact order $2$, with $[[a^{y_e}, b^{x_u}], c^{x_v}] = z^{y_e x_u x_v}$. Summing over $y_e \in \{0, 1\}$ gives $\#\M_1(G) - \#\M_z(G) = 2^{m_H} \#\IS(H)$ ($\#\mathsf{P}$-hard~\cite{Valiant1979SICOMP}). \end{enumerate} Since every nilpotent group outside $\Ab \cup \Qf$ either has a non-abelian odd Sylow subgroup (Case~1), or has $P_2$ non-abelian and an element of order not dividing $4$ (Case~2, covering both nontrivial odd Sylow factors and $\exp(P_2) \ge 8$), or is a $2$-group of exponent $\le 4$ and nilpotency class $\ge 3$ (Case~3), these three cases together with Proposition~\ref{prop:non-nilpotent}(a) exhaust every $\Gamma \notin \Ab \cup \Qf$, completing Part~(a). \input{fig3_o10_cliff} For Part~(c), abelian groups lie in $\mathsf{NC}^2$ on all planar graphs (Theorem~\ref{thm:mod-trichotomy}(I)), and every $\Gamma \notin \Ab \cup \Qf$ is already $\#\mathsf{P}$-hard at $\Delta = 2$ by Part~(a) (appending one disjoint $1_\Gamma$-labeled copy of $O_{10}$, multiplying the count by $3$, if exact maximum degree~$3$ is demanded). It remains to prove $\#\mathsf{P}$-hardness at $\Delta = 3$ for every non-abelian $\Gamma \in \Qf$. Pick $a, b \in \Gamma$ with $z := [a, b] \in Z(\Gamma)$ of exact order $2$, and choose a character $\psi$ of $Z(\Gamma)$ with $\psi(z) = -1$. Consider the $10$-vertex simple outerplanar bipartite graph of maximum degree $3$ formed by adding one chord to a $10$-cycle: \[ O_{10} \;:=\; C_{10} + \{v_1, v_4\} \qquad \text{(vertices $v_1, \dots, v_{10}$ in cyclic order)}. \] Direct enumeration (Figure~\ref{fig:o10-cliff}) shows that $O_{10}$ has \emph{exact} matching count $3$: \begin{align*} M_0 &= \bigl\{\{v_1,v_2\}, \{v_3,v_4\}, \{v_5,v_6\}, \{v_7,v_8\}, \{v_9,v_{10}\}\bigr\}, \\ M_1 &= \bigl\{\{v_2,v_3\}, \{v_4,v_5\}, \{v_6,v_7\}, \{v_8,v_9\}, \{v_{10},v_1\}\bigr\}, \\ M_2 &= \bigl\{\{v_1,v_4\}, \{v_2,v_3\}, \{v_5,v_6\}, \{v_7,v_8\}, \{v_9,v_{10}\}\bigr\}. \end{align*} Crucially, the four edges $\{v_4,v_5\}, \{v_6,v_7\}, \{v_8,v_9\}, \{v_{10},v_1\}$ belong \emph{exclusively} to $M_1$. Given any simple graph $H = ([n], E_H)$ and $k \in \{1, \dots, m_H + 1\}$, compile each vertex $x_u \in \{0, 1\}$ on an even cycle of length $2\max(2k\deg_H(u), 4)$ and place $k$ disjoint copies of $O_{10}$ per edge $e = \{u, v\} \in E_H$. On each copy, label the four exclusive $M_1$-edges by $(a, a^{-1}, a, a^{-1})$ interleaved in the global edge ordering with $(b^{x_u}, b^{-x_u})$ and $(b^{x_v}, b^{-x_v})$, and label all other edges $1_\Gamma$. Then $M_0$ and $M_2$ each evaluate to $1_\Gamma$, while $M_1$ evaluates to $[a, b^{x_u}][a, b^{x_v}] = z^{x_u + x_v} \in Z(\Gamma)$. Summing $\psi(g)\#\M_g(G)$ over $g \in Z(\Gamma)$ ($|Z(\Gamma)| = O_\Gamma(1)$ queries) multiplies each copy by $2 + (-1)^{x_u + x_v}$, which equals $3$ when $x_u = x_v$ and $1$ when $x_u \neq x_v$. Across $k$ copies per edge, this computes the exact ferromagnetic Ising partition function $Z_H^{\mathrm{Ising}}(3^k) = \sum_{x \in \{0,1\}^n} (3^k)^{e_{\mathrm{mono}}(x)}$ at $m_H + 1$ strictly distinct values $\beta_k = 3^k$, recovering the cut-size polynomial of $H$ via Vandermonde interpolation ($\#\mathsf{P}$-hard~\cite{JaegerVertiganWelsh1990,JerrumSinclair1993}). \end{proof} \input{fig4_group_universe} \section{Discussion and Open Directions}\label{sec:discussion} Theorems~\ref{thm:mod-trichotomy}, \ref{thm:order72}, and~\ref{thm:outerplanar-exact} map the landscape of modular and exact perfect-matching counting across all finite groups (Figure~\ref{fig:group-universe}). On planar, bounded-treewidth ($\tw \le c$ for $c \ge 2$), and $O(\log n)$-genus graphs, assuming $\mathsf{Mod}_\ell\mathsf{P} \not\subseteq \mathsf{P}$ for all primes $\ell$, tractability extends beyond abelian groups if and only if $\Gamma$ lies in $\Cp$ and the modulus is a power of $p$, where Galois-ring augmentation-ideal nilpotency and division-free Pfaffians carry the count in deterministic $\mathsf{P}$ (and $\mathsf{NC}^2$ on planar and bounded-treewidth graphs); everywhere else, counting is $\mathsf{Mod}_\ell\mathsf{P}$-hard on simple planar bipartite treewidth-$2$ graphs---for non-abelian $\Gamma \in \Cp$ at every modulus with a prime divisor $\ell \neq p$, and for $\Gamma \notin \bigcup_p \Cp$ at every modulus $q \ge 2$, where Frobenius's normal $p$-complement theorem forces two active primes. On outerplanar bipartite graphs, exact integer counting isolates the Clifford exponent-$4$ class $\Qf$ at $\Delta = 2$ via $\Z_4$-quadratic Gauss sums before restricting tractability to abelian groups alone at $\Delta = 3$ via disjoint copies of the $10$-vertex chorded cycle $O_{10}$. Several natural questions merit further investigation. For modular counting on $2$-regular outerplanar bipartite graphs, Theorem~\ref{thm:order72} proves mod-$p$ tractability for $P \rtimes Q$ with odd-$p$ $P$ and non-abelian class-$2$ $2$-group $Q$ having $Z(Q) \cong \Z_2$ (starting in Class~III at order~$24$ with $D_{24}, \mathrm{Dic}_6$ and reaching faithful actions at order~$72$), whereas the proof of Proposition~\ref{prop:non-nilpotent} already shows hardness modulo every integer $q \ge 2$ for every finite group containing both a $2$-primary and an odd-primary Schmidt subquotient (covering every non-solvable group as well as solvable Class~III groups such as $S_4$ and $S_3 \times A_4$). We do not determine here the complete modular counting classification at $\Delta = 2$ for the remaining solvable groups. A second open direction is parallelizing the bounded-genus orientation and Arf-invariant construction of Galluccio and Loebl~\cite{GalluccioLoebl1999} so that the $g = O(\log n)$ upper bounds of Theorem~\ref{thm:mod-trichotomy} reach deterministic $\mathsf{NC}^2$ unconditionally. Finally, whereas modular counting on planar, bounded-treewidth ($c \ge 2$), and $O(\log n)$-genus graphs is now completely settled for every finite group, the corresponding decision problem (testing $\M_{g^*}^\Gamma(G) \neq \emptyset$) on bounded-treewidth and $2$-regular outerplanar graphs remains open for several solvable groups outside $\bigcup_p \Cp$ (see~\cite[Theorem~1.6]{GoelExpanded} for bounded-treewidth matching-equivalence). This contrasts sharply with $S_4$, where compiling each variable via the $5$-bit surjection $((12)(34))^{b_1}((13)(24))^{b_2}(123)^{b_3}(123)^{b_4}(12)^{b_5} : \{0, 1\}^5 \twoheadrightarrow S_4$ reduces polynomial-equation satisfiability $\mathrm{PolSat}(S_4)$ directly to $\M_{g^*}^{S_4}(G) \neq \emptyset$ on $2$-regular outerplanar graphs, ruling out polynomial time under the Exponential Time Hypothesis via the $\mathrm{PolSat}(S_4)$ lower bounds of~\cite{IdziakEtAl2024,AichingerGrunbacher2025}. \section*{Acknowledgments} This work was done overwhelmingly by AI models, steered by the author in a continuous critical dialogue, variously with Anthropic's Claude, OpenAI's ChatGPT and Google's Gemini. The author takes full responsibility for the paper. {\raggedright\begin{thebibliography}{99} \bibitem{AichingerGrunbacher2025} E.~Aichinger and S.~Gr\"unbacher, \emph{On the complexity of solving equations over $S_4$}, preprint (2025), \mbox{\url{https://arxiv.org/abs/2503.07285}} \bibitem{ArvindSrinivasan2010} V.~Arvind and S.~Srinivasan, \emph{On the hardness of the noncommutative determinant}, in 42nd Annual ACM Symposium on Theory of Computing (STOC 2010), ACM, 2010, pp.~677--686. \bibitem{Barrington1989} D.~A. Barrington, \emph{Bounded-width polynomial-size branching programs recognize exactly those languages in $\mathrm{NC}^1$}, J. Comput. System Sci. \textbf{38} (1989), no.~1, 150--164. \bibitem{Blaser2015} M.~Bl\"aser, \emph{Noncommutativity makes determinants hard}, Inform. and Comput. \textbf{243} (2015), 133--144 (preliminary version in ICALP 2013, pp.~172--183). \bibitem{BodlaenderHagerup1998} H.~L. Bodlaender and T.~Hagerup, \emph{Parallel algorithms with optimal speedup for bounded treewidth}, SIAM J. Comput. \textbf{27} (1998), no.~6, 1725--1746. \bibitem{CaiChen2017} J.-Y. Cai and X.~Chen, \emph{Complexity of counting CSP with complex weights}, J. ACM \textbf{64} (2017), no.~3, Art.~19, 19:1--19:39. \bibitem{CaiChenLiptonLu2010} J.-Y. Cai, X.~Chen, R.~J. Lipton, and P.~Lu, \emph{On tractable exponential sums}, in 4th International Workshop on Frontiers in Algorithmics (FAW 2010), LNCS \textbf{6213}, Springer, 2010, pp.~148--159. \bibitem{CaiLuXia2011} J.-Y. Cai, P.~Lu, and M.~Xia, \emph{Computational complexity of Holant problems}, SIAM J. Comput. \textbf{40} (2011), no.~4, 1101--1132. \bibitem{ChienHarshaSinclairSrinivasan2011} S.~Chien, P.~Harsha, A.~Sinclair, and S.~Srinivasan, \emph{Almost settling the hardness of noncommutative determinant}, in 43rd Annual ACM Symposium on Theory of Computing (STOC 2011), ACM, 2011, pp.~499--508. \bibitem{ChiuDavidaLitow2001} A.~Chiu, G.~Davida, and B.~Litow, \emph{Division in logspace-uniform $\mathrm{NC}^1$}, RAIRO Theor. Inform. Appl. \textbf{35} (2001), no.~3, 259--275. \bibitem{CreignouHermann1996} N.~Creignou and M.~Hermann, \emph{Complexity of generalized satisfiability counting problems}, Inform. and Comput. \textbf{125} (1996), no.~1, 1--12. \bibitem{CurticapeanDellHusfeldt2021} R.~Curticapean, H.~Dell, and T.~Husfeldt, \emph{Modular counting of subgraphs: Matchings, matching-splittable graphs, and paths}, in 29th Annual European Symposium on Algorithms (ESA 2021), LIPIcs \textbf{204}, Schloss Dagstuhl, 2021, pp.~34:1--34:17. \bibitem{DehaeneDeMoor2003} J.~Dehaene and B.~De Moor, \emph{The Clifford group, stabilizer states, and linear and quadratic operations over $\mathrm{GF}(2)$}, Phys. Rev. A \textbf{68} (2003), 042318, 9~pp. \bibitem{Dickson1901} L.~E. Dickson, \emph{Linear Groups: With an Exposition of the Galois Field Theory}, Teubner, Leipzig, 1901. \bibitem{EhrenfeuchtKarpinski1990} A.~Ehrenfeucht and M.~Karpinski, \emph{The computational complexity of (XOR, AND)-counting problems}, Technical Report 8543-CS, Universit\"at Bonn, 1990. \bibitem{ElberfeldJakobyTantau2010} M.~Elberfeld, A.~Jakoby, and T.~Tantau, \emph{Logspace versions of the theorems of Bodlaender and Courcelle}, in 51st Annual IEEE Symposium on Foundations of Computer Science (FOCS 2010), IEEE, 2010, pp.~143--152. \bibitem{FoldvariHorvath2020} A.~F\"oldv\'ari and G.~Horv\'ath, \emph{The complexity of the equation solvability and equivalence problems over finite groups}, Internat. J. Algebra Comput. \textbf{30} (2020), no.~3, 607--623. \bibitem{Frobenius1907} F.~G. Frobenius, \emph{\"Uber einen Fundamentalsatz der Gruppentheorie, II}, Sitzungsber. Preuss. Akad. Wiss. Berlin (1907), 428--437. \bibitem{GalluccioLoebl1999} A.~Galluccio and M.~Loebl, \emph{On the theory of Pfaffian orientations. I. Perfect matchings and permanents}, Electron. J. Combin. \textbf{6} (1999), Research Paper R6, 18~pp. \bibitem{GoelExactMatching} D.~Goel, \emph{Exact Matching in Subexponential Time}, Hexagon Math (2026), \mbox{\url{https://hexagonmath.org/2611.01193}} \bibitem{GoelExpanded} D.~Goel, \emph{Expanded Version of ``Exact and Modular Counting Dichotomies for Group-Labeled Perfect Matchings''}, Zenodo (2026), \url{https://doi.org/10.5281/zenodo.24677022} \bibitem{GoldmannRussell2002} M.~Goldmann and A.~Russell, \emph{The complexity of solving equations over finite groups}, Inform. and Comput. \textbf{178} (2002), no.~1, 253--262. \bibitem{Huppert1967} B.~Huppert, \emph{Endliche Gruppen. I}, Grundlehren der mathematischen Wissenschaften \textbf{134}, Springer, Berlin, 1967. \bibitem{Huynh2026} T.~Huynh, \emph{The $k$-disjoint paths problem for group-labelled graphs}, preprint (2026), \mbox{\url{https://arxiv.org/abs/2611.34307}} \bibitem{IdziakEtAl2024} P.~M. Idziak, P.~Kawa\l ek, J.~Krzaczkowski, and A.~Wei\ss, \emph{Equation satisfiability in solvable groups}, Theory Comput. Syst. \textbf{68} (2024), no.~4, 740--757. \bibitem{JaegerVertiganWelsh1990} F.~Jaeger, D.~L. Vertigan, and D.~J.~A. Welsh, \emph{On the computational complexity of the Jones and Tutte polynomials}, Math. Proc. Cambridge Philos. Soc. \textbf{108} (1990), no.~1, 35--53. \bibitem{JerrumSinclair1993} M.~Jerrum and A.~Sinclair, \emph{Polynomial-time approximation algorithms for the Ising model}, SIAM J. Comput. \textbf{22} (1993), no.~5, 1087--1116. \bibitem{Kasteleyn1967} P.~W. Kasteleyn, \emph{Graph theory and crystal physics}, in \emph{Graph Theory and Theoretical Physics}, Academic Press, London, 1967, pp.~43--110. \bibitem{MahajanSubramanyaVinay2004} M.~Mahajan, P.~R. Subramanya, and V.~Vinay, \emph{The combinatorial approach yields an NC algorithm for computing Pfaffians}, Discrete Appl. Math. \textbf{143} (2004), no.~1--3, 1--16. \bibitem{NordhJonsson2004} G.~Nordh and P.~Jonsson, \emph{The complexity of counting solutions to systems of equations over finite semigroups}, in 10th Annual International Computing and Combinatorics Conference (COCOON 2004), LNCS \textbf{3106}, Springer, 2004, pp.~370--379. \bibitem{Robinson1996} D.~J.~S. Robinson, \emph{A Course in the Theory of Groups}, 2nd ed., Graduate Texts in Mathematics \textbf{80}, Springer, New York, 1996. \bibitem{Schaefer1978} T.~J. Schaefer, \emph{The complexity of satisfiability problems}, in 10th Annual ACM Symposium on Theory of Computing (STOC 1978), ACM, 1978, pp.~216--226. \bibitem{Schmidt1924} O.~Yu. Schmidt, \emph{Groups all of whose subgroups are special}, Mat. Sb. \textbf{31} (1924), 366--372. \bibitem{Thompson1968} J.~G. Thompson, \emph{Nonsolvable finite groups all of whose local subgroups are solvable}, Bull. Amer. Math. Soc. \textbf{74} (1968), no.~3, 383--437. \bibitem{Valiant1979} L.~G. Valiant, \emph{The complexity of computing the permanent}, Theor. Comput. Sci. \textbf{8} (1979), no.~2, 189--201. \bibitem{Valiant1979SICOMP} L.~G. Valiant, \emph{The complexity of enumeration and reliability problems}, SIAM J. Comput. \textbf{8} (1979), no.~3, 410--421. \bibitem{Valiant2006} L.~G. Valiant, \emph{Accidental algorithms}, in 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2006), IEEE, 2006, pp.~509--517. \bibitem{Vazirani1989} V.~V. Vazirani, \emph{NC algorithms for computing the number of perfect matchings in $K_{3,3}$-free graphs and related problems}, Inform. and Comput. \textbf{80} (1989), no.~2, 152--164. \end{thebibliography}} \end{document}