Class sums and finite Hecke families
Hypothesis (class sums). Let $K$ be a number field with involution, and let $$K_{\rm c}=\{a\in K:\sigma(\bar a)=\overline{\sigma(a)}\text{ for every }\sigma:K\hookrightarrow\mathbb C\}.$$ A class-sum datum consists of a finite set $C$, a finite-dimensional $K$-vector space $V$ with its restricted $\mathcal O_K$-module structure and a specified finite basis, a sesquilinear pairing $b:V\times V\to K$ conjugate-linear in its first variable, and, for each $c\in C$, a finite group $\Gamma_c$, a representation $\rho_c:\Gamma_c\to\operatorname{End}_K(V)$ and two $\mathcal O_K$-submodules $N_c,D_c\subset V$. Its space of forms and weighted pairing are $$\mathcal F=\{f:C\to V:\rho_c(\gamma)f(c)=f(c)\text{ for all }c,\gamma\},\qquad (f,g)=\sum_{c\in C}\frac{b(f(c),g(c))}{|\Gamma_c|}.$$ Fix a basis of $\mathcal F$ whose values have coordinates in $K_{\rm c}$ whenever such a basis exists; otherwise fix an arbitrary basis. Denote its coordinate evaluation map by $I:K^{\dim\mathcal F}\to(C\to V)$ and the Gram matrix of the displayed pairing by $H$. The two coordinate integral modules are $\{x:I(x)(c)\in N_c\ \forall c\}$ and $\{x:I(x)(c)\in D_c\ \forall c\}$. No positivity, symmetry or lattice condition is included in the definition of these data.
Rational families. Fix a finite group $G$, sets $\mathcal P,\mathcal I,\mathcal A,\mathcal T$, and a finite set $J$. A block datum $B$ over $\mathcal P$ consists of a class-sum datum with form space $\mathcal F$, a $K$-linear representation $\rho$ of $G$ on $\mathcal F$, a set $\mathcal P_B$ with a map $p_B:\mathcal P_B\to\mathcal P$, natural numbers $n_B,t_B$, a function $q_B:\mathcal P_B\to\mathbb N$, endomorphisms $T^B_{P,d}$ of $\mathcal F$ for $P\in\mathcal P_B,d\in\mathbb N$, and a finite list of functions $\nu_{B,s}:\mathcal P_B\to K$. Additional inert data consist of a set $\mathcal I_B$, a map $i_B:\mathcal I_B\to\mathcal I$ and endomorphisms $U^B_{P,a}$ of $\mathcal F$ for $P\in\mathcal I_B,a\in\mathcal A$.
A rational family consists of an infinite place $v_0$ of $K$, a base tuple $t_0\in\mathcal T$, a finite set $\mathcal X\subset K^G$, a right block datum $B^R_t$ for every $t\in\mathcal T$, a lifted block datum $B^L_{j,t}$ for every $j\in J,t\in\mathcal T$, inert data on each of these block data, and maps $$\tau_j:(\mathcal P\to K[X])\longrightarrow(\mathcal P\to K[X]),\qquad \tau_j^I:(\mathcal I\times\mathcal A\to K)\longrightarrow(\mathcal I\times\mathcal A\to K).$$ Write $R_t$ and $L_{j,t}$ for the right and lifted form spaces. A full spectral label is a pair $(S,u)$ of a function $S:\mathcal P\to K[X]$ and a function $u:\mathcal I\times\mathcal A\to K$; its transfer at $j$ is $(\tau_j(S),\tau_j^I(u))$.
Finite Hecke families. A particular class of rational families has $J=\{0,\ldots,m-1\}$ for a natural number $m$, and $\mathcal A=\mathbb N^{<\omega}$ is the set of finite sequences of natural numbers. Choose natural numbers $r_A,t_A$, natural numbers $q_P$ for $P\in\mathcal P$, units $\mu_{j,t,P},\eta_P\in K^\times$, and subsets $\mathcal P_t\subset\mathcal P$, $\mathcal I_t\subset\mathcal I$. For the right and lifted block data at $t$, take $\mathcal P_B=\mathcal P_t$, $\mathcal I_B=\mathcal I_t$, both place maps to be inclusions, and $q_B(P)=q_P$. Use the degrees, block lists and polynomial transfer specified below; choose the class-sum data, representations, endomorphisms and inert transfer maps arbitrarily.
For a family of operators $T_a$, its joint generalized eigenspace with eigenvalues $x_a$ is $\bigcap_a\bigcup_{n\ge0}\ker(T_a-x_a)^n$. For a predicate on eigenvalue functions, the associated spectral sum is the sum of the joint generalized eigenspaces satisfying that predicate.
For any block datum, the Hecke polynomial at $P\in\mathcal P_B$ for an eigenvalue function $x$ is $$H_{B,x,P}(X)=\sum_{d=0}^{n_B}(-1)^dq_B(P)^{d(d-1)/2}x_{P,d}X^d.$$ Its block product is $$B_P(X)=\prod_s\prod_{a=0}^{t_B-1}(1-\nu_{B,s}(P)q_B(P)^aX).$$ The distinguished block subspace is the spectral sum for which $B_P$ divides $H_{B,x,P}$ at every $P$. For a polynomial label $S$, its residual spectral subspace is the spectral sum for which $H_{B,x,P}=S(p_B(P))B_P$ for every $P$.
For the finite Hecke families, the right block datum at $t$ uses $n_B=r_A+mt_A$, $t_B=t_A$ and first entries $$\nu^R_{j,t,P}=\mu_{j,t,P}q_P^{\lfloor(r_A+(m-1)t_A)/2\rfloor}\qquad(0\le j<m).$$ The lifted block datum at $j,t$ uses $n_B=r_A+t_A$, $t_B=t_A$ and one first entry $$\nu^L_{j,t,P}=\mu_{j,t,P}^{-1}\eta_Pq_P^{\lfloor(r_A+1)/2\rfloor}.$$ Its polynomial transfer is $$\tau_j(S)(P)=\operatorname{lc}(S(P))^{-1}\operatorname{rev}(S(P))\bigl(\eta_Pq_P^{\lfloor(2r_A+(m+1)t_A-1)/2\rfloor}X\bigr)$$ when $S(P)\ne0$, and $\tau_j(S)(P)=0$ when $S(P)=0$. Here $\operatorname{lc}$ and $\operatorname{rev}$ mean leading coefficient and polynomial reversal. Subtraction inside the natural-number exponents is truncated at zero, and $0^0=1$.
In the group algebra $K[G]$, whose basis element at $g$ is denoted by $[g]$, put $$e_{\mathcal X}=\sum_{\chi\in\mathcal X}\frac{\chi(1)}{|G|}\sum_{g\in G}\chi(g^{-1})[g].$$ For a representation $\rho$ of $G$ on a form space, let $A_{\mathcal X}$ be the action of $e_{\mathcal X}$ on that space. Its image is the selected finite-group image. A polynomial label $S$ occurs if it equals $1$ outside the image of $p_B$ and its residual spectral subspace meets $\operatorname{im}A_{\mathcal X}$ nontrivially. For a full label $(S,u)$, take the joint spectral sum with residual polynomial $S$ and inert eigenvalues $u(i_B(P),a)$. The full label occurs if this sum meets $\operatorname{im}A_{\mathcal X}$ nontrivially, $S$ equals $1$ outside the image of $p_B$, and $u$ vanishes outside the image of $i_B$. At $t_0$, for either kind of right label take all occurring labels if their set is finite, and the empty set otherwise.