Exact spatial logical-bit marginalization ========================================= The higher-degree production engine integrates selected logical shifts analytically. It still samples the remaining spacetime background with Markov updates. This page specifies its target and physical estimators. An orbit identity ------------------- Let w(phi) be the original positive finite-M weight. Let c1,...,cr be independent binary cocycles acting by addition on phi. For lambda in :math:`\mathbb F_2^r`, write :math:`c_\lambda=\sum_j\lambda_jc_j`. Define the weight on redundant representatives .. math:: \widetilde w(\phi)=2^{-r}\sum_\lambda w(\phi+c_\lambda),\qquad \overline O(\phi)= \frac{\sum_\lambda w(\phi+c_\lambda)O(\phi+c_\lambda)} {\sum_\lambda w(\phi+c_\lambda)}. Each shift permutes the full configuration set, so .. math:: \sum_\phi\widetilde w(\phi)=\sum_\phi w(\phi),\qquad \frac{\sum_\phi\widetilde w(\phi)\overline O(\phi)} {\sum_\phi\widetilde w(\phi)} =\frac{\sum_\phi w(\phi)O(\phi)}{\sum_\phi w(\phi)}. This is a finite-sum proof. It needs neither an equal-weight physical-sector assumption nor canonical representative selection. The sampled phi remains a redundant representative. Using raw O(phi) with this target would generally measure the wrong expectation. Coordinate sheets and factorization ------------------------------------- On the spatial d-torus there are :math:`r=\binom dp` coordinate logical cocycles. For each spatial orientation I, its sheet S_I consists of all spacetime p-cells of orientation I with :math:`x_i=0` for every i in I, arbitrary transverse coordinates and every time slice. Shifting that sheet has zero coboundary. Different sheets have different orientations and are disjoint sets of spins. Let :math:`q_I=\sum_{e\in S_I}\sigma_e` and separate the action into .. math:: S(\phi)=S_{\rm inv}(\phi)+h_s\sum_Iq_I(\phi). The invariant part contains all face terms, all temporal-spin terms and the spatial-spin terms outside the sheets. A sheet shift changes q_I to -q_I. Consequently .. math:: \widetilde w(\phi)=C\,e^{S_{\rm inv}(\phi)} \prod_I\cosh(h_s q_I),\qquad \lambda_I^{\rm mean}=\tanh(h_s q_I). The final symbol denotes the conditional mean of the **sign** :math:`(-1)^{\lambda_I}`, not the conditional mean of the bit lambda_I. Conditionally on phi, the signs are independent with probabilities proportional to exp(h_s*q_I*sign). Physical logical shifts need not have equal weights. The implemented action is :math:`S_{\rm inv}+\sum_I\log[2\cosh(h_sq_I)]`. It differs from log(tilde_w/C) by the constant r*log(2), which cancels in Metropolis ratios. When reconstructing the normalized full partition weight, subtract that constant. The six sheets in d=4,p=2 give six integer sums; the factorization avoids an explicit 64-configuration sum on every proposal. Characters and joint estimates -------------------------------- A supported sign observable transforms by a binary logical character chi: .. math:: O(\phi+c_\lambda)=O(\phi)(-1)^{\chi\cdot\lambda},\qquad \overline O(\phi)=O(\phi)\prod_{I:\chi_I=1}\tanh(h_sq_I). For a spatial support, chi_I is its mod-two overlap with the corresponding sheet on the measurement slice. A deterministic decoded observable has the same character as its raw support, because the syndrome and correction rule are shift invariant. For A and B, the compiler uses character XOR for the product: .. math:: a=\overline A,\quad b=\overline B,\quad d=\overline{AB}=A(\phi)B(\phi) \prod_{I:(\chi_A\mathbin\oplus\chi_B)_I=1}\tanh(h_sq_I). It then estimates f=mean(d)-mean(a)*mean(b). At h_s=0, a nontrivial character has conditional mean zero. If A=B is a sign with such a character, a=b=0 but d=1 exactly. Setting d=a*b would replace a known joint operator by the wrong quantity. Likewise :math:`\mathbb E[\overline O^2]` generally differs from :math:`\mathbb E[\overline{O^2}]`. Use the conditional estimator's variation for Monte Carlo uncertainty and the actual product insertion for physical second moments. Scope of the marginalization ------------------------------ Only the spatial coordinate logical shifts are integrated. This is not a sum over equally weighted boundary twists, nor a computation of all separate sector partition functions. Temporal/background degrees of freedom remain in the Markov chain. Exact logical averaging does not prove useful finite-time mixing for them. At zero longitudinal source, finite-volume symmetry can force a noncontractible Wilson mean to vanish even when a different paired/decoded observable is useful for an ordering question. Interpret the chosen observable and limiting procedure before translating a vanishing mean into a phase statement.