Homological-code Hamiltonians ============================= Geometry and degrees --------------------- Let :math:`\Lambda` be a d-dimensional periodic cubical lattice with lengths :math:`L_0,\ldots,L_{d-1}` and spatial volume :math:`V=\prod_iL_i`. A canonically oriented k-cell is :math:`(x,I)`, with integer anchor x and a strictly increasing k-tuple of axes I. Its boundary is .. math:: \partial(x,I)=\sum_{r=1}^{k}(-1)^{r-1} \left[(x+e_{i_r},I\setminus i_r)-(x,I\setminus i_r)\right]. Anchors are periodic. If upper and lower terms coincide, combine their signed integer coefficients before reducing modulo N. This matters on length-one axes. The geometry satisfies :math:`\partial^2=0` over the integers. Chains :math:`C_k(\Lambda;\mathbb Z_N)` are coefficients on k-cells; cochains :math:`C^k` are functions on them. Evaluation pairs a cochain with a chain. The coboundary is :math:`d=\partial^\top`. A cycle has zero boundary; a cocycle has zero coboundary. They are different conditions. Use the unaugmented complex, :math:`C_{-1}=0` and :math:`\partial_0=0`. Physical N-state qudits occupy p-cells. There are :math:`n_q=\binom dp V` physical qudits. For ordinary higher-degree models :math:`1\leq p