nDot.io physics
07-ilang-weight / 04-weight-of-bond
04weight of bondverified

Determines the bond profile of two held bodies bound only through the field and the weight of the pair in the field of a distant source, and whether the bond is weighed like the costs of the bodies.

Code of version 3 · current

check_weight_of_bond.py27 KB · raw
"""Check of 07-ilang-weight/04-weight-of-bond, derivation v3.

N_f = 1 field object, t_f = 1, held pair (g1 at x1, g2 at x2 = x1 + r) and held
source (g_s at x_s = 0).  The exact lowest eigenvalue of h = C_1 + sum_i g_i P_{x_i}
(dense diagonalisation) is compared with the formulas (4.1)-(4.13); the exact
finite-rank equation (4.15) is checked; and distance sweeps compare exact eigenpairs
(sparse Lanczos; g_s-derivative by Hellmann-Feynman, |psi_0(x_s)|^2) with (4.2), (4.5),
(4.10), (4.12) on larger graphs.  v3 adds the exact mirrored ratios (4.14) and the
fixed-place decomposition (4.17) on the square torus.
Run from the project root:
  .venv/Scripts/python.exe 07-ilang-weight/04-weight-of-bond/code/v3/check_weight_of_bond.py
"""
import itertools
from pathlib import Path

import numpy as np
import scipy.sparse as sp
from scipy.linalg import eigh
from scipy.optimize import brentq
from scipy.sparse.linalg import eigsh

OUT = Path(__file__).parent / "output"
OUT.mkdir(exist_ok=True)
LOG = []


def log(s=""):
    print(s)
    LOG.append(s)


def hop(D, L):
    """C_1 = -t_f * adjacency of the D-torus of side L (t_f = 1)."""
    N = L ** D
    co = np.array(list(itertools.product(range(L), repeat=D)))
    H = np.zeros((N, N))
    for mu in range(D):
        sh = co.copy()
        sh[:, mu] = (sh[:, mu] + 1) % L
        j = np.ravel_multi_index(sh.T, (L,) * D)
        H[np.arange(N), j] -= 1.0
        H[j, np.arange(N)] -= 1.0
    return H


def tables(D, L):
    """ell = Lambda^+ and ell2 = (Lambda^+)^2 as functions of the displacement (FFT)."""
    k = 2 * np.pi * np.fft.fftfreq(L)
    g = np.meshgrid(*([k] * D), indexing="ij")
    om = sum(4 * np.sin(x / 2) ** 2 for x in g)
    inv = np.zeros_like(om)
    inv[om > 1e-12] = 1 / om[om > 1e-12]
    return np.real(np.fft.ifftn(inv)), np.real(np.fft.ifftn(inv ** 2))


def site(x, L):
    return int(np.ravel_multi_index(tuple(np.mod(x, L)), (L,) * len(x)))


def emin(H0, pts, top=False):
    H = H0.copy()
    for i, g in pts:
        H[i, i] += g
    n = H.shape[0]
    idx = [n - 1, n - 1] if top else [0, 0]
    return eigh(H, eigvals_only=True, subset_by_index=idx)[0]


class Graph:
    def __init__(self, D, L, build=True):
        self.D, self.L, self.X = D, L, L ** D
        self.l, self.l2 = tables(D, L)
        self.H0 = hop(D, L) if build else None

    def ell(self, a):
        return self.l[tuple(np.mod(a, self.L))]

    def ell2(self, a):
        return self.l2[tuple(np.mod(a, self.L))]

    def S(self, x1, x2, xs):
        """bracket of (4.6) without the x1-independent ell2(r) term."""
        l12, l1s, l2s = self.ell(x2 - x1), self.ell(x1 - xs), self.ell(x2 - xs)
        return l12 * (l1s + l2s) + l1s * l2s - (self.ell2(x1 - xs) + self.ell2(x2 - xs)) / self.X

    def rho0(self, x1, r, rp, e, xs):
        """leading-order ratio (4.10), lattice differences."""
        num = (self.S(x1 + e, x1 + e + r, xs) - self.S(x1, x1 + r, xs)) - (
            self.S(x1 + e, x1 + e + rp, xs) - self.S(x1, x1 + rp, xs))
        den = 2 * (self.ell(r) - self.ell(rp)) * (self.ell(x1 + e - xs) - self.ell(x1 - xs))
        return num / den

    def rho0_mid(self, xb, r, rp, e, xs):
        """leading-order ratio (4.12) with the midpoint xb as the place (r, rp with even components)."""
        S = lambda y, rr: self.S(y - rr // 2, y + rr // 2, xs)
        num = (S(xb + e, r) - S(xb, r)) - (S(xb + e, rp) - S(xb, rp))
        den = 2 * (self.ell(r) - self.ell(rp)) * (self.ell(xb + e - xs) - self.ell(xb - xs))
        return num / den


# Model D levels: M_k = m + 2 pi k / (N lambda_0), m = 1, N = 4, lambda_0 = pi
def Mk(k):
    return 1.0 + 0.5 * k


GAM2 = 0.6  # gamma_2 / gamma_1 (unequal bodies)
CHOICES = {  # (k1, s1, k2, s2) and the second level of each body used for its cost difference
    "A (k1,s1,k2,s2)=(0,+,1,+)": ((0, 1, 1, 1), ((1, 1), (2, 1))),
    "B (k1,s1,k2,s2)=(2,-,3,+)": ((2, -1, 3, 1), ((2, 1), (0, 1))),
}
ETAS = [0.08, 0.04, 0.02]


def run_exact(G, x1, r, rp, e, xb, rm, rmp, label):
    D, L, X = G.D, G.L, G.X
    xs = np.zeros(D, int)
    l0 = G.ell(np.zeros(D, int))
    gs = 0.01 / l0
    n = 1.0 / X
    s = lambda x: site(x, L)
    log(f"\n--- {label}: L={L}, x1={x1.tolist()}, r={r.tolist()}, r'={rp.tolist()}, e={e.tolist()}; "
        f"midpoint version: xbar={xb.tolist()}, r={rm.tolist()}, r'={rmp.tolist()}; ell_0={l0:.4f}, g_s={gs:.4g}")
    log(" choice | eta | rel.dev bond profile (4.2) | rel.dev W_1 (4.5) | rel.dev W_b (4.6) | "
        "rho_ex(full grip) | rho0 (4.10) | rho_ex(a)/[(1+n g1)/(n g1) rho0] (4.13) | rho_mid_ex vs rho0_mid (4.12)")
    rho_th = G.rho0(x1, r, rp, e, xs)
    rho_mid_th = G.rho0_mid(xb, rm, rmp, e, xs)
    for cname, ((k1, s1, k2, s2), lev2) in CHOICES.items():
        devs = []
        for eta in ETAS:
            gam1 = eta / l0 / 2.5
            gam = (gam1, GAM2 * gam1)
            g1, g2 = s1 * gam[0] * Mk(k1), s2 * gam[1] * Mk(k2)

            def E(pts, src):
                return emin(G.H0, pts + ([(s(xs), src)] if src else []))

            def coef(pts):  # coefficient of g_s (symmetric difference)
                return (E(pts, gs) - E(pts, -gs)) / (2 * gs)

            def Wb_ex(y1, y2):
                return (coef([(s(y1), g1), (s(y2), g2)]) - coef([(s(y1), g1)])
                        - coef([(s(y2), g2)]) + coef([]))

            def Wb_th(y1, y2):
                return 2 * n * g1 * g2 * (G.S(y1, y2, xs) - G.ell2(y2 - y1) / X)

            # item 1: bond profile
            Bex = E([(s(x1), g1), (s(x1 + r), g2)], 0) - E([(s(x1), g1), (s(x1 + rp), g2)], 0)
            Bth = -2 * n * g1 * g2 * (G.ell(r) - G.ell(rp))
            # item 2: single body 1 and bond part
            W1ex = coef([(s(x1 + e), g1)]) - coef([(s(x1), g1)])
            W1th = sum(sgn * (-2 * n * g1 * G.ell(y) + n * g1 ** 2 * (2 * l0 * G.ell(y) + G.ell(y) ** 2
                                                                     - 2 * G.ell2(y) / X))
                       for sgn, y in ((1, x1 + e), (-1, x1)))
            Wex = {}
            for tag, y1, y2 in (("r", x1, x1 + r), ("rp", x1, x1 + rp), ("er", x1 + e, x1 + e + r),
                                ("erp", x1 + e, x1 + e + rp)):
                Wex[tag] = (Wb_ex(y1, y2), Wb_th(y1, y2))
            num_ex = (Wex["er"][0] - Wex["r"][0]) - (Wex["erp"][0] - Wex["rp"][0])
            dWb_ex = Wex["er"][0] - Wex["r"][0]
            dWb_th = Wex["er"][1] - Wex["r"][1]

            # single-body place function F_i from level differences (full grip and coupling (a))
            def F(i, coupling, y):
                kk, ss = ((k1, s1), (k2, s2))[i]
                kq, sq = lev2[i]
                ga = gam[i]
                gA, gB = ss * ga * Mk(kk), sq * ga * Mk(kq)
                rest = (ss * Mk(kk) - sq * Mk(kq)) if coupling == "a" else 0.0
                dW = (coef([(s(y + e), gA)]) - coef([(s(y), gA)])) - (
                    coef([(s(y + e), gB)]) - coef([(s(y), gB)]))
                dC = rest + E([(s(y), gA)], 0) - E([(s(y), gB)], 0)
                return dW / dC

            rho_fg = [num_ex / (Bex * F(i, "fg", x1)) for i in (0, 1)]
            rho_a = [num_ex / (Bex * F(i, "a", x1)) for i in (0, 1)]
            pred_a = [(1 + n * gam[i]) / (n * gam[i]) * rho_th for i in (0, 1)]
            # midpoint version, full grip, relative to body 1
            h = lambda rr: rr // 2
            Bm = (E([(s(xb - h(rm)), g1), (s(xb + h(rm)), g2)], 0)
                  - E([(s(xb - h(rmp)), g1), (s(xb + h(rmp)), g2)], 0))
            num_m = ((Wb_ex(xb + e - h(rm), xb + e + h(rm)) - Wb_ex(xb - h(rm), xb + h(rm)))
                     - (Wb_ex(xb + e - h(rmp), xb + e + h(rmp)) - Wb_ex(xb - h(rmp), xb + h(rmp))))
            rho_m = num_m / (Bm * F(0, "fg", xb))
            dev = (abs(Bex / Bth - 1), abs(W1ex / W1th - 1), abs(dWb_ex / dWb_th - 1),
                   abs(rho_fg[0] / rho_th - 1), abs(rho_fg[1] / rho_th - 1),
                   abs(rho_a[0] / pred_a[0] - 1), abs(rho_a[1] / pred_a[1] - 1), abs(rho_m / rho_mid_th - 1))
            devs.append(dev)
            log(f" {cname[:1]} | {eta:.2f} | {dev[0]:.2e} | {dev[1]:.2e} | {dev[2]:.2e} | "
                f"{rho_fg[0]:.5f} (body1), {rho_fg[1]:.5f} (body2) | {rho_th:.5f} | "
                f"{rho_a[0] / pred_a[0]:.5f}, {rho_a[1] / pred_a[1]:.5f} | {rho_m:.5f} vs {rho_mid_th:.5f}")
        d = np.array(devs)
        ratios = d[:-1] / d[1:]
        log(f" {cname[:1]} | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, "
            "rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: "
            + "; ".join(" ".join(f"{x:.2f}" for x in row) for row in ratios))


# ---------- v2: exact finite-rank equation (4.15) and exact-eigenpair distance sweeps ----------
def hop_sparse(D, L):
    """C_1 (t_f = 1) as a sparse matrix."""
    N = L ** D
    idx = np.arange(N).reshape((L,) * D)
    rows, cols = [], []
    for mu in range(D):
        j = np.roll(idx, -1, axis=mu).ravel()
        rows += [np.arange(N), j]
        cols += [j, np.arange(N)]
    return sp.csr_matrix((-np.ones(2 * D * N), (np.concatenate(rows), np.concatenate(cols))), shape=(N, N))


def ground(H0s, D, L, pts):
    """exact lowest eigenvalue of h = C_1 + sum g P_x and |psi_0|^2 on the places (sparse Lanczos)."""
    N = H0s.shape[0]
    V = np.zeros(N)
    for i, g in pts:
        V[i] += g
    ev, vec = eigsh(H0s + sp.diags(V), k=1, which="SA", v0=np.ones(N), tol=0)
    return ev[0], (vec[:, 0] ** 2).reshape((L,) * D)


def secular(D, L, pts):
    """-2D + root delta of (4.15): X delta = e^T g (1 + R(delta) g)^{-1} e on |delta| <= w_min/2."""
    X = L ** D
    k = 2 * np.pi * np.fft.fftfreq(L)
    om = sum(4 * np.sin(x / 2) ** 2 for x in np.meshgrid(*([k] * D), indexing="ij"))
    nz = om > 1e-12
    xs = [np.array(x) for x, _ in pts]
    g = np.diag([gg for _, gg in pts])
    e = np.ones(len(pts))

    def f(dl):
        inv = np.zeros_like(om)
        inv[nz] = 1 / (om[nz] - dl)
        K = np.real(np.fft.ifftn(inv))
        R = np.array([[K[tuple(np.mod(a - b, L))] for b in xs] for a in xs])
        return X * dl - e @ g @ np.linalg.solve(np.eye(len(pts)) + R @ g, e)

    wmin = 4 * np.sin(np.pi / L) ** 2
    return -2 * D + brentq(f, -wmin / 2, wmin / 2, xtol=1e-18, rtol=1e-15, maxiter=500)


ETAS_SW = [0.08, 0.04]
SWEEPS = [  # D, L, r, r', r_mid, r'_mid, distances d, profile steps s (r = 2s e1 against r' = s e1)
    (1, 64, [3], [2], [4], [2], [8, 16, 24], [1, 2, 4, 8, 16]),
    (1, 256, [3], [2], [4], [2], [32, 64, 96], [1, 2, 4, 8, 16]),
    (2, 64, [2, 1], [4, 3], [2, 2], [4, 2], [4, 8, 16], [1, 2, 4, 8]),
    (2, 256, [2, 1], [4, 3], [2, 2], [4, 2], [4, 8, 16, 32], [1, 2, 4, 8, 16]),
    (3, 16, [0, 1, 0], [1, 1, 1], [0, 2, 0], [2, 2, 2], [2, 3, 4], [1, 2, 4]),
    (3, 32, [0, 1, 0], [1, 1, 1], [0, 2, 0], [2, 2, 2], [2, 4, 8], [1, 2, 4, 8]),
]


def sweep(D, L, r, rp, rm, rmp, dists, steps):
    """exact |psi_0(x_s)|^2 (Hellmann-Feynman: the exact g_s-coefficient, no finite source step) for all
    source places at once; place x1 (or xbar) = x_s + d e1, step e = e1 away from the source."""
    G = Graph(D, L, build=False)
    H0s = hop_sparse(D, L)
    X, n = G.X, 1.0 / G.X
    o = np.zeros(D, int)
    l0 = G.ell(o)
    e = np.eye(D, dtype=int)[0]
    r, rp, rm, rmp = (np.array(v) for v in (r, rp, rm, rmp))
    s = lambda x: site(x, L)
    at = lambda P, y: P[tuple(np.mod(y, L))]
    log(f"\n--- sweep D={D}, L={L}: r={r.tolist()}, r'={rp.tolist()}; midpoint r={rm.tolist()}, r'={rmp.tolist()}; "
        f"ell_0={l0:.4f}")
    for cname, ((k1, s1, k2, s2), lev2) in CHOICES.items():
        res = {}
        for eta in ETAS_SW:
            gam1 = eta / l0 / 2.5
            g1, g2 = s1 * gam1 * Mk(k1), s2 * GAM2 * gam1 * Mk(k2)
            gB = lev2[0][1] * gam1 * Mk(lev2[0][0])
            E1, p1 = ground(H0s, D, L, [(s(o), g1)])
            EB, pB = ground(H0s, D, L, [(s(o), gB)])
            p2 = ground(H0s, D, L, [(s(o), g2)])[1]
            pair = {k: ground(H0s, D, L, [(s(o), g1), (s(v), g2)])
                    for k, v in (("r", r), ("rp", rp), ("rm", rm), ("rmp", rmp))}

            def Wb(k, v, y):  # bond part of the g_s-coefficient; y = x_s - x1, v = x2 - x1
                return at(pair[k][1], y) - at(p1, y) - at(p2, y - v) + 1 / X

            def F1(R):  # place difference of body 1's level difference of weight over its cost difference
                return ((at(p1, -R - e) - at(p1, -R)) - (at(pB, -R - e) - at(pB, -R))) / (E1 - EB)

            rows = []
            for d in dists:
                R = d * e
                W1ex = at(p1, -R - e) - at(p1, -R)
                W1th = sum(sg * (-2 * n * g1 * G.ell(y) + n * g1 ** 2 * (2 * l0 * G.ell(y) + G.ell(y) ** 2
                                                                         - 2 * G.ell2(y) / X))
                           for sg, y in ((1, R + e), (-1, R)))
                num = (Wb("r", r, -R - e) - Wb("r", r, -R)) - (Wb("rp", rp, -R - e) - Wb("rp", rp, -R))
                rho = num / ((pair["r"][0] - pair["rp"][0]) * F1(R))
                hm, hmp = rm // 2, rmp // 2
                num_m = ((Wb("rm", rm, -R - e + hm) - Wb("rm", rm, -R + hm))
                         - (Wb("rmp", rmp, -R - e + hmp) - Wb("rmp", rmp, -R + hmp)))
                rho_m = num_m / ((pair["rm"][0] - pair["rmp"][0]) * F1(R))
                rows.append((W1ex / W1th - 1, rho, rho_m))
            prof = []
            for st in steps:
                Ea = ground(H0s, D, L, [(s(o), g1), (s(2 * st * e), g2)])[0]
                Eb = ground(H0s, D, L, [(s(o), g1), (s(st * e), g2)])[0]
                prof.append((Ea - Eb) / (-2 * n * g1 * g2 * (G.ell(2 * st * e) - G.ell(st * e))) - 1)
            res[eta] = (rows, prof, max(abs(g1), abs(g2)) * l0)
        a, b = ETAS_SW
        log(f" choice {cname}: actual eta = max|g_i| ell_0/t_f = {res[a][2]:.4f} and {res[b][2]:.4f}")
        log("   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | "
            "|rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]")
        for j, d in enumerate(dists):
            R = d * e
            r0, rm0 = G.rho0(R, r, rp, e, o), G.rho0_mid(R, rm, rmp, e, o)
            dl_r, dl_e = G.ell(r) - G.ell(rp), G.ell(R + e) - G.ell(R)
            K = ((1 + abs(r0)) * l0 ** 2 / abs(dl_r * dl_e)
                 + abs(r0) * abs(G.ell2(R + e) - G.ell2(R)) / (X * l0 * abs(dl_e)))
            (wa, ra, ma), (wb, rb, mb) = res[a][0][j], res[b][0][j]
            log(f"  {d:3d} | {wa:+.2e}, {wb:+.2e} | {r0:.5f} | {ra - r0:+.3e}, {rb - r0:+.3e} "
                f"[{(ra - r0) / (rb - r0):.2f}] | {abs(ra - r0) / res[a][2]:.3f}, {K:.1e} | {rm0:.5f} | "
                f"{ma - rm0:+.3e}, {mb - rm0:+.3e} [{(ma - rm0) / (mb - rm0):.2f}]")
        log("   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: "
            + "; ".join(f"s={st}: {pa:+.2e}, {pb:+.2e} [{pa / pb:.2f}]"
                        for st, pa, pb in zip(steps, res[a][1], res[b][1])))


def exact_form_checks():
    log("\n--- (4.15): exact lowest eigenvalue (Lanczos) minus the root of the finite-rank equation"
        " (bodies and source, eta = 0.08):")
    for D, L in ((1, 256), (2, 64), (3, 16)):
        G = Graph(D, L, build=False)
        l0 = G.ell(np.zeros(D, int))
        g1 = 0.08 / l0 / 2.5
        P = [(np.zeros(D, int), g1), (np.array([3] + [1] * (D - 1)), -0.9 * g1),
             (np.array([L // 4] + [2] * (D - 1)), 0.01 / l0)]
        ev = ground(hop_sparse(D, L), D, L, [(site(x, L), g) for x, g in P])[0]
        log(f" D={D}, L={L}: {ev - secular(D, L, P):+.1e}")
    log("--- Hellmann-Feynman g_s-coefficient |psi_0(x_s)|^2 against the symmetric difference in g_s"
        " (D=2, L=32, eta = 0.08):")
    D, L = 2, 32
    G = Graph(D, L, build=False)
    H0s = hop_sparse(D, L)
    l0 = G.ell(np.zeros(D, int))
    g1 = 0.08 / l0 / 2.5
    pts = [(site([0, 0], L), g1), (site([2, 1], L), 0.9 * g1)]
    xs = (7, 3)
    hf = ground(H0s, D, L, pts)[1][xs]
    for gs in (0.01 / l0, 0.005 / l0):
        fd = (ground(H0s, D, L, pts + [(site(list(xs), L), gs)])[0]
              - ground(H0s, D, L, pts + [(site(list(xs), L), -gs)])[0]) / (2 * gs)
        log(f" g_s={gs:.4f}: symmetric difference / |psi_0(x_s)|^2 - 1 = {fd / hf - 1:+.2e}")


# ---------- v3: exact mirrored ratios (4.14) and the square torus at fixed places (4.17) ----------
def mirror_ratio_check():
    """(4.14): exact ratios of body 1 (place x1) in the highest state at branches sigma, against the lowest
    state at reversed branches (exact equality expected) and at the same branches (first correction reversed)."""
    log("\n--- (4.14) exact ratios, highest state (sigma) vs lowest state (-sigma) and (sigma), nominal eta=0.08:")
    log(" graph | choice | rho_fg: max(s), min(-s), min(s), rho0 | rho_a: max(s), min(-s) | "
        "max|diff| of max(s) and min(-s) | (rho_fg max(s) - rho0)/(rho_fg min(s) - rho0)")
    for D, L, x1, r, rp, e in ((1, 30, [6], [3], [2], [1]), (2, 12, [4, 0], [1, 1], [2, 2], [1, 0]),
                               (3, 8, [3, 0, 0], [0, 1, 0], [1, 1, 1], [1, 0, 0])):
        G = Graph(D, L)
        x1, r, rp, e = (np.array(v) for v in (x1, r, rp, e))
        xs = np.zeros(D, int)
        l0 = G.ell(xs)
        gs, gam1 = 0.01 / l0, 0.08 / l0 / 2.5
        s = lambda x: site(x, L)
        rho_th = G.rho0(x1, r, rp, e, xs)
        for cname, ((k1, s1, k2, s2), lev2) in CHOICES.items():
            def rhos(sg, top):
                g1, g2 = sg * s1 * gam1 * Mk(k1), sg * s2 * GAM2 * gam1 * Mk(k2)
                gB = sg * lev2[0][1] * gam1 * Mk(lev2[0][0])
                rest = sg * (s1 * Mk(k1) - lev2[0][1] * Mk(lev2[0][0]))  # coupling (a): c is odd in sigma

                def E(pts, src=0.0):
                    return emin(G.H0, pts + ([(s(xs), src)] if src else []), top=top)

                def coef(pts):
                    return (E(pts, gs) - E(pts, -gs)) / (2 * gs)

                def Wb(y1, y2):
                    return (coef([(s(y1), g1), (s(y2), g2)]) - coef([(s(y1), g1)])
                            - coef([(s(y2), g2)]) + coef([]))

                num = (Wb(x1 + e, x1 + e + r) - Wb(x1, x1 + r)) - (Wb(x1 + e, x1 + e + rp) - Wb(x1, x1 + rp))
                prof = E([(s(x1), g1), (s(x1 + r), g2)]) - E([(s(x1), g1), (s(x1 + rp), g2)])
                dW = (coef([(s(x1 + e), g1)]) - coef([(s(x1), g1)])) - (coef([(s(x1 + e), gB)]) - coef([(s(x1), gB)]))
                dC = E([(s(x1), g1)]) - E([(s(x1), gB)])
                return np.array([num * dC / (prof * dW), num * (rest + dC) / (prof * dW)])

            mx, mnr, mn = rhos(1, True), rhos(-1, False), rhos(1, False)
            log(f" D={D}, L={L} | {cname[:1]} | {mx[0]:.6f}, {mnr[0]:.6f}, {mn[0]:.6f}, {rho_th:.6f} | "
                f"{mx[1]:.6f}, {mnr[1]:.6f} | {np.max(np.abs(mx - mnr)):.1e} | "
                f"{(mx[0] - rho_th) / (mn[0] - rho_th):+.3f}")


def square_torus_fixed_places():
    """(4.17): rho0 = beta_L ell_0 + rho_L at fixed places on the square torus, L growing; K/ell_0^3;
    the bound |Delta_e ell2(R)| <= (pi^2/8)(2d+1) ell_0."""
    log("\n--- (4.17) square torus, fixed places, x_s=0, e=e1: L | ell_0 | rho0 | beta_L | rho_L = rho0 - beta_L ell_0 |"
        " K/ell_0^3 | |Delta_e ell2(R)| / [(pi^2/8)(2d+1) ell_0]")
    cases = [("place x1=(8,0), r=(2,1), r'=(4,3)", [8, 0], [2, 1], [4, 3], False),
             ("place x1=(16,0), r=(2,1), r'=(4,3)", [16, 0], [2, 1], [4, 3], False),
             ("midpoint xbar=(8,0), r=(2,2), r'=(4,2)", [8, 0], [2, 2], [4, 2], True)]
    for L in (128, 512, 2048):
        G = Graph(2, L, build=False)
        o, e = np.zeros(2, int), np.array([1, 0])
        l0 = G.ell(o)
        for name, P, r, rp, mid in cases:
            P, r, rp = (np.array(v) for v in (P, r, rp))
            ends = (lambda y, rr: (y - rr // 2, y + rr // 2)) if mid else (lambda y, rr: (y, y + rr))
            A = lambda y, rr: sum(G.ell(z) for z in ends(y, rr))
            dd = (A(P + e, r) - A(P, r)) - (A(P + e, rp) - A(P, rp))
            dl_r, dl_e = G.ell(r) - G.ell(rp), G.ell(P + e) - G.ell(P)
            beta = dd / (dl_r * dl_e)
            r0 = G.rho0_mid(P, r, rp, e, o) if mid else G.rho0(P, r, rp, e, o)
            d2 = abs(G.ell2(P + e) - G.ell2(P))
            K = (1 + abs(r0)) * l0 ** 2 / abs(dl_r * dl_e) + abs(r0) * d2 / (G.X * l0 * abs(dl_e))
            bnd = d2 / (np.pi ** 2 / 8 * (2 * np.linalg.norm(P) + 1) * l0)
            log(f" L={L} | {name} | {l0:.4f} | {r0:.5f} | {beta:.5f} | {r0 - beta * l0:.5f} | "
                f"{K / l0 ** 3:.1f} | {bnd:.3f}")


def main():
    log("Check of 04-weight-of-bond v3 (N_f = 1, t_f = 1)")
    log("Couplings g_i = sigma_i gamma_i M_{k_i}, gamma_1 = eta/(2.5 ell_0), gamma_2 = 0.6 gamma_1;"
        " rel.dev = |exact/formula - 1|.")
    log("Expected: rel.dev of the third-order formulas proportional to eta (ratio ~2 when eta halves).")

    # ---------- exact eigenvalue checks, two sizes per graph ----------
    setups = [  # D, L, x1, r, r', e, xbar, r_mid, r'_mid
        (1, 30, [6], [3], [2], [1], [8], [4], [2]), (1, 60, [12], [6], [5], [1], [16], [8], [4]),
        (2, 12, [4, 0], [1, 1], [2, 2], [1, 0], [4, 0], [0, 2], [2, 2]),
        (2, 20, [6, 0], [1, 1], [2, 2], [1, 0], [6, 0], [0, 2], [2, 2]),
        (3, 8, [3, 0, 0], [0, 1, 0], [1, 1, 1], [1, 0, 0], [3, 0, 0], [0, 2, 0], [2, 2, 0]),
        (3, 10, [4, 0, 0], [0, 1, 0], [1, 1, 1], [1, 0, 0], [4, 0, 0], [0, 2, 0], [2, 2, 0]),
    ]
    for D, L, *geo in setups:
        G = Graph(D, L)
        run_exact(G, *[np.array(v) for v in geo], f"graph D={D}")

    # ---------- mirrored (highest) state on even L ----------
    log("\n--- mirror identity max spec h(g) = -min spec h(-g) (even L):")
    rng = np.random.default_rng(1)
    for D, L in ((1, 30), (2, 12), (3, 8)):
        G = Graph(D, L)
        pts = [(int(rng.integers(L ** D)), float(rng.normal()) * 0.3) for _ in range(3)]
        top = emin(G.H0, pts, top=True)
        low = emin(G.H0, [(i, -g) for i, g in pts])
        log(f" D={D}, L={L}: max + min(-g) = {top + low:.2e}")

    # ---------- sum rule (consistency check 3) ----------
    log("\n--- sum over x1 of the full g_s g1 g2 coefficient of (4.6) (incl. -ell2(r)/X): ")
    for D, L in ((1, 30), (2, 12), (3, 8)):
        G = Graph(D, L, build=False)
        xs = np.zeros(D, int)
        r = np.array([2] + [1] * (D - 1))
        tot = sum(G.S(np.array(x1), np.array(x1) + r, xs) - G.ell2(r) / G.X
                  for x1 in itertools.product(range(L), repeat=D))
        log(f" D={D}, L={L}: sum = {tot:.2e}")

    # ---------- item 1: ring closed form and torus forms ----------
    log("\n--- (4.3) ring: max |ell(r) - [(L^2-1)/(12L) - r(L-r)/(2L)]|:")
    for L in (30, 61, 200):
        G = Graph(1, L, build=False)
        rr = np.arange(L)
        log(f" L={L}: {np.max(np.abs(G.l - ((L*L-1)/(12*L) - rr*(L-rr)/(2*L)))):.2e}")
    log("--- (4.4) 2D: ell(0)-ell(r e1) - [ln r/(2 pi) + (2 gamma_E + 3 ln 2)/(4 pi)]:")
    cst2 = (2 * np.euler_gamma + 3 * np.log(2)) / (4 * np.pi)
    for L in (256, 1024):
        G = Graph(2, L, build=False)
        out = []
        for rr in (2, 4, 8, 16, 32):
            out.append(f"r={rr}: {G.l[0, 0] - G.l[rr, 0] - (np.log(rr) / (2 * np.pi) + cst2):+.2e}")
        log(f" L={L}: " + ", ".join(out))
    log("--- (4.4) 3D: ell(0)-ell(r e1) - [G_0 - 1/(4 pi r)], G_0 = 0.2527310098:")
    for L in (64, 128):
        G = Graph(3, L, build=False)
        out = []
        for rr in (2, 4, 8, 16):
            out.append(f"r={rr}: {G.l[0, 0, 0] - G.l[rr, 0, 0] - (0.2527310098 - 1 / (4 * np.pi * rr)):+.2e}")
        log(f" L={L}: " + ", ".join(out))

    # ---------- item 3: rho0 on large graphs, distance scaling ----------
    log("\n--- (4.12) ring: lattice rho0 (e=+1, r'=r-1) vs 2(1-w)(1-2w)/((1-2u)(1-2v)),"
        " u=(d+1/2)/L, v=(r-1/2)/L, w=u+v:")
    for (uu, vv) in ((0.2, 0.1), (0.1, 0.05), (0.6, 0.2)):
        row = []
        for L in (40, 80, 160, 320):
            G = Graph(1, L, build=False)
            d, rr = int(round(uu * L)), int(round(vv * L))
            lat = G.rho0(np.array([d]), np.array([rr]), np.array([rr - 1]), np.array([1]), np.array([0]))
            u, v = (d + 0.5) / L, (rr - 0.5) / L
            w = u + v
            fo = 2 * (1 - w) * (1 - 2 * w) / ((1 - 2 * u) * (1 - 2 * v))
            row.append(f"L={L}: {lat:.5f} vs {fo:.5f} (diff {lat - fo:+.1e})")
        log(f" u={uu}, v={vv}: " + "; ".join(row))
    log(" small-v limit 2(1-u): u=0.2 -> 1.6; u=0.1 -> 1.8")

    log("\n--- (4.11) 3D, L=128: rho0 - 1 and, in brackets, d*(rho0 - 1) vs d (x1=(d,0,0), e=e1):")
    G = Graph(3, 128, build=False)
    xs = np.zeros(3, int)
    for rv, rpv in (((0, 1, 0), (1, 1, 1)), ((0, 2, 0), (2, 3, 0)), ((0, 1, 0), (0, 2, 0)),
                    ((1, 0, 0), (2, 0, 0))):
        row = []
        for d in (8, 16, 32):
            rho = G.rho0(np.array([d, 0, 0]), np.array(rv), np.array(rpv), np.array([1, 0, 0]), xs)
            row.append(f"d={d}: {rho - 1:+.3e} ({d * (rho - 1):+.3f})")
        log(f" r={rv}, r'={rpv}: " + ", ".join(row))
    log("\n--- (4.11) 2D: rho0 - 1 and, in brackets, d*(rho0 - 1) vs d and L"
        " (x1=(d,0), e=e1, r=(2,1), r'=(4,3)):")
    for L in (128, 512, 2048):
        G = Graph(2, L, build=False)
        row = []
        for d in (8, 16, 32, 64):
            rho = G.rho0(np.array([d, 0]), np.array([2, 1]), np.array([4, 3]), np.array([1, 0]),
                         np.zeros(2, int))
            row.append(f"d={d}: {rho - 1:+.3e} ({d * (rho - 1):+.3f})")
        log(f" L={L}: " + ", ".join(row))

    log("\n--- (4.12) midpoint place: rho0_mid - 1 (ring; expected 0 up to rounding):")
    for L in (40, 160):
        G = Graph(1, L, build=False)
        row = []
        for db, rr, rrp in ((L // 4, 4, 2), (L // 5, 10, 4), (3 * L // 5, 12, 6)):
            k = G.rho0_mid(np.array([db]), np.array([rr]), np.array([rrp]), np.array([1]), np.array([0])) - 1
            row.append(f"(dbar,r,r')=({db},{rr},{rrp}): {k:+.1e}")
        log(f" L={L}: " + ", ".join(row))
    log("--- (4.12) midpoint place, 2D: rho0_mid - 1 and, in brackets, d^2*(rho0_mid - 1)"
        " (xbar=(d,0), e=e1, r=(2,2), r'=(4,2)):")
    for L in (128, 512, 2048):
        G = Graph(2, L, build=False)
        row = []
        for d in (8, 16, 32, 64):
            k = G.rho0_mid(np.array([d, 0]), np.array([2, 2]), np.array([4, 2]), np.array([1, 0]),
                           np.zeros(2, int)) - 1
            row.append(f"d={d}: {k:+.3e} ({d * d * k:+.1f})")
        log(f" L={L}: " + ", ".join(row))
    log("--- (4.12) midpoint place, 3D, L=128: rho0_mid - 1 and, in brackets, d^2*(rho0_mid - 1)"
        " (xbar=(d,0,0), e=e1):")
    G = Graph(3, 128, build=False)
    for rv, rpv in (((0, 2, 0), (2, 2, 2)), ((2, 0, 0), (4, 2, 0))):
        row = []
        for d in (8, 16, 32):
            k = G.rho0_mid(np.array([d, 0, 0]), np.array(rv), np.array(rpv), np.array([1, 0, 0]),
                           np.zeros(3, int)) - 1
            row.append(f"d={d}: {k:+.3e} ({d * d * k:+.2f})")
        log(f" r={rv}, r'={rpv}: " + ", ".join(row))

    log("\n--- 3D large separations (consistency check 2): W_b / (2 n g1 g2) = S - ell2(r)/X"
        " at |r|, d ~ L/4 shrinks with L:")
    for L in (16, 32, 64):
        G = Graph(3, L, build=False)
        q = L // 4
        val = G.S(np.array([q, 0, 0]), np.array([q, q, 0]), np.zeros(3, int)) - G.ell2(np.array([0, q, 0])) / G.X
        log(f" L={L}: {val:.3e}")

    # ---------- v2: exact finite-rank form and distance sweeps against exact eigenpairs ----------
    exact_form_checks()
    log("\n=== Distance sweeps (I5): exact eigenpairs, full grip, body 1; rel.dev = exact/formula - 1;"
        " [ratio] = deviation at eta over deviation at eta/2 (2 for a deviation linear in eta) ===")
    for cfg in SWEEPS:
        sweep(*cfg)

    # ---------- v3 ----------
    mirror_ratio_check()
    square_torus_fixed_places()

    (OUT / "check_weight_of_bond.txt").write_text("\n".join(LOG) + "\n", encoding="utf-8")


if __name__ == "__main__":
    main()
output/check_weight_of_bond.txt27 KB · raw
Check of 04-weight-of-bond v3 (N_f = 1, t_f = 1)
Couplings g_i = sigma_i gamma_i M_{k_i}, gamma_1 = eta/(2.5 ell_0), gamma_2 = 0.6 gamma_1; rel.dev = |exact/formula - 1|.
Expected: rel.dev of the third-order formulas proportional to eta (ratio ~2 when eta halves).

--- graph D=1: L=30, x1=[6], r=[3], r'=[2], e=[1]; midpoint version: xbar=[8], r=[4], r'=[2]; ell_0=2.4972, g_s=0.004004
 choice | eta | rel.dev bond profile (4.2) | rel.dev W_1 (4.5) | rel.dev W_b (4.6) | rho_ex(full grip) | rho0 (4.10) | rho_ex(a)/[(1+n g1)/(n g1) rho0] (4.13) | rho_mid_ex vs rho0_mid (4.12)
 A | 0.08 | 8.10e-02 | 2.52e-05 | 3.68e-01 | 1.23433 (body1), 1.23925 (body2) | 1.18588 | 1.12672, 1.11709 | 1.03307 vs 1.00000
 A | 0.04 | 4.14e-02 | 1.18e-05 | 1.90e-01 | 1.21058 (body1), 1.21317 (body2) | 1.18588 | 1.06230, 1.05784 | 1.01699 vs 1.00000
 A | 0.02 | 2.09e-02 | 6.29e-06 | 9.65e-02 | 1.19831 (body1), 1.19964 (body2) | 1.18588 | 1.03085, 1.02871 | 1.00861 vs 1.00000
 A | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 1.96 2.14 1.94 1.96 1.96 2.03 2.02 1.95; 1.98 1.87 1.97 1.99 1.98 2.02 2.01 1.97
 B | 0.08 | 2.56e-02 | 3.50e-04 | 1.54e-01 | 1.18085 (body1), 1.15057 (body2) | 1.18588 | 0.99252, 1.03700 | 0.99375 vs 1.00000
 B | 0.04 | 1.19e-02 | 6.87e-05 | 6.98e-02 | 1.18356 (body1), 1.16883 (body2) | 1.18588 | 0.99723, 1.01914 | 0.99692 vs 1.00000
 B | 0.02 | 5.76e-03 | 1.78e-05 | 3.29e-02 | 1.18472 (body1), 1.17746 (body2) | 1.18588 | 0.99882, 1.00968 | 0.99846 vs 1.00000
 B | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 2.14 5.10 2.21 2.17 2.07 2.70 1.93 2.03; 2.07 3.87 2.12 2.00 2.02 2.34 1.98 2.00

--- graph D=1: L=60, x1=[12], r=[6], r'=[5], e=[1]; midpoint version: xbar=[16], r=[8], r'=[4]; ell_0=4.9986, g_s=0.002001
 choice | eta | rel.dev bond profile (4.2) | rel.dev W_1 (4.5) | rel.dev W_b (4.6) | rho_ex(full grip) | rho0 (4.10) | rho_ex(a)/[(1+n g1)/(n g1) rho0] (4.13) | rho_mid_ex vs rho0_mid (4.12)
 A | 0.08 | 7.81e-02 | 4.15e-05 | 5.08e-01 | 1.22521 (body1), 1.22951 (body2) | 1.17551 | 1.12828, 1.11810 | 1.03196 vs 1.00000
 A | 0.04 | 3.98e-02 | 9.43e-06 | 2.63e-01 | 1.20079 (body1), 1.20306 (body2) | 1.17551 | 1.06300, 1.05828 | 1.01643 vs 1.00000
 A | 0.02 | 2.01e-02 | 3.48e-06 | 1.34e-01 | 1.18819 (body1), 1.18936 (body2) | 1.17551 | 1.03116, 1.02890 | 1.00833 vs 1.00000
 A | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 1.96 4.40 1.93 1.97 1.96 2.04 2.03 1.95; 1.98 2.71 1.96 1.99 1.99 2.02 2.02 1.97
 B | 0.08 | 2.47e-02 | 1.02e-04 | 2.10e-01 | 1.17234 (body1), 1.14548 (body2) | 1.17551 | 0.99405, 1.04153 | 0.99547 vs 1.00000
 B | 0.04 | 1.15e-02 | 2.58e-06 | 9.43e-02 | 1.17425 (body1), 1.16122 (body2) | 1.17551 | 0.99811, 1.02144 | 0.99776 vs 1.00000
 B | 0.02 | 5.54e-03 | 3.09e-06 | 4.44e-02 | 1.17491 (body1), 1.16849 (body2) | 1.17551 | 0.99928, 1.01083 | 0.99887 vs 1.00000
 B | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 2.15 39.56 2.23 2.52 2.10 3.15 1.94 2.02; 2.08 0.84 2.13 2.08 2.04 2.63 1.98 1.99

--- graph D=2: L=12, x1=[4, 0], r=[1, 1], r'=[2, 2], e=[1, 0]; midpoint version: xbar=[4, 0], r=[0, 2], r'=[2, 2]; ell_0=0.4441, g_s=0.02252
 choice | eta | rel.dev bond profile (4.2) | rel.dev W_1 (4.5) | rel.dev W_b (4.6) | rho_ex(full grip) | rho0 (4.10) | rho_ex(a)/[(1+n g1)/(n g1) rho0] (4.13) | rho_mid_ex vs rho0_mid (4.12)
 A | 0.08 | 6.62e-02 | 8.57e-04 | 3.61e-02 | 0.63843 (body1), 0.63918 (body2) | 0.63014 | 1.09582, 1.08369 | 0.96268 vs 0.95615
 A | 0.04 | 3.39e-02 | 2.71e-04 | 1.81e-02 | 0.63435 (body1), 0.63474 (body2) | 0.63014 | 1.04734, 1.04144 | 0.95946 vs 0.95615
 A | 0.02 | 1.72e-02 | 1.25e-04 | 9.02e-03 | 0.63226 (body1), 0.63246 (body2) | 0.63014 | 1.02353, 1.02061 | 0.95782 vs 0.95615
 A | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 1.95 3.16 2.00 1.97 1.97 2.02 2.02 1.97; 1.98 2.17 2.01 1.99 1.98 2.01 2.01 1.99
 B | 0.08 | 2.23e-02 | 3.17e-03 | 1.17e-02 | 0.62917 (body1), 0.62451 (body2) | 0.63014 | 0.99446, 1.05863 | 0.95656 vs 0.95615
 B | 0.04 | 1.01e-02 | 8.50e-04 | 5.78e-03 | 0.62985 (body1), 0.62760 (body2) | 0.63014 | 0.99853, 1.02967 | 0.95647 vs 0.95615
 B | 0.02 | 4.82e-03 | 2.70e-04 | 2.89e-03 | 0.63004 (body1), 0.62893 (body2) | 0.63014 | 0.99958, 1.01491 | 0.95634 vs 0.95615
 B | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 2.20 3.73 2.03 3.30 2.22 3.77 1.98 1.29; 2.10 3.15 2.00 2.79 2.10 3.51 1.99 1.69

--- graph D=2: L=20, x1=[6, 0], r=[1, 1], r'=[2, 2], e=[1, 0]; midpoint version: xbar=[6, 0], r=[0, 2], r'=[2, 2]; ell_0=0.5255, g_s=0.01903
 choice | eta | rel.dev bond profile (4.2) | rel.dev W_1 (4.5) | rel.dev W_b (4.6) | rho_ex(full grip) | rho0 (4.10) | rho_ex(a)/[(1+n g1)/(n g1) rho0] (4.13) | rho_mid_ex vs rho0_mid (4.12)
 A | 0.08 | 7.38e-02 | 9.64e-04 | 5.57e-02 | 0.99896 (body1), 0.99963 (body2) | 0.99147 | 1.08976, 1.07714 | 0.95031 vs 0.94577
 A | 0.04 | 3.79e-02 | 3.05e-04 | 2.84e-02 | 0.99527 (body1), 0.99562 (body2) | 0.99147 | 1.04439, 1.03822 | 0.94808 vs 0.94577
 A | 0.02 | 1.92e-02 | 1.40e-04 | 1.43e-02 | 0.99339 (body1), 0.99357 (body2) | 0.99147 | 1.02208, 1.01903 | 0.94688 vs 0.94577
 A | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 1.95 3.16 1.96 1.97 1.96 2.02 2.02 1.96; 1.97 2.17 1.99 1.98 1.97 2.01 2.01 2.08
 B | 0.08 | 2.50e-02 | 3.58e-03 | 2.29e-02 | 0.99338 (body1), 0.98914 (body2) | 0.99147 | 0.99788, 1.06566 | 0.93773 vs 0.94577
 B | 0.04 | 1.14e-02 | 9.60e-04 | 1.08e-02 | 0.99252 (body1), 0.99049 (body2) | 0.99147 | 1.00005, 1.03282 | 0.94182 vs 0.94577
 B | 0.02 | 5.41e-03 | 3.04e-04 | 5.24e-03 | 0.99201 (body1), 0.99102 (body2) | 0.99147 | 1.00029, 1.01639 | 0.94382 vs 0.94577
 B | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 2.20 3.73 2.13 1.82 2.37 44.43 2.00 2.04; 2.10 3.16 2.05 1.94 2.16 0.16 2.00 2.03

--- graph D=3: L=8, x1=[3, 0, 0], r=[0, 1, 0], r'=[1, 1, 1], e=[1, 0, 0]; midpoint version: xbar=[3, 0, 0], r=[0, 2, 0], r'=[2, 2, 0]; ell_0=0.2246, g_s=0.04452
 choice | eta | rel.dev bond profile (4.2) | rel.dev W_1 (4.5) | rel.dev W_b (4.6) | rho_ex(full grip) | rho0 (4.10) | rho_ex(a)/[(1+n g1)/(n g1) rho0] (4.13) | rho_mid_ex vs rho0_mid (4.12)
 A | 0.08 | 6.70e-02 | 1.10e-03 | 6.23e-02 | 1.10348 (body1), 1.10360 (body2) | 1.09927 | 1.08568, 1.07251 | 0.84421 vs 0.84329
 A | 0.04 | 3.44e-02 | 3.47e-04 | 3.18e-02 | 1.10140 (body1), 1.10146 (body2) | 1.09927 | 1.04240, 1.03594 | 0.84374 vs 0.84329
 A | 0.02 | 1.74e-02 | 1.60e-04 | 1.61e-02 | 1.10032 (body1), 1.10035 (body2) | 1.09927 | 1.02107, 1.01787 | 0.84352 vs 0.84329
 A | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 1.95 3.16 1.96 1.98 1.97 2.02 2.02 2.04; 1.97 2.17 1.98 2.02 2.02 2.01 2.01 2.01
 B | 0.08 | 2.28e-02 | 4.10e-03 | 2.35e-02 | 1.10014 (body1), 1.09940 (body2) | 1.09927 | 0.99671, 1.06825 | 0.84441 vs 0.84329
 B | 0.04 | 1.03e-02 | 1.10e-03 | 1.08e-02 | 1.09979 (body1), 1.09943 (body2) | 1.09927 | 0.99945, 1.03399 | 0.84388 vs 0.84329
 B | 0.02 | 4.90e-03 | 3.47e-04 | 5.22e-03 | 1.09955 (body1), 1.09938 (body2) | 1.09927 | 1.00000, 1.01696 | 0.84359 vs 0.84329
 B | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 2.21 3.74 2.17 1.68 0.80 5.99 2.01 1.90; 2.11 3.16 2.07 1.84 1.52 724.93 2.00 1.95

--- graph D=3: L=10, x1=[4, 0, 0], r=[0, 1, 0], r'=[1, 1, 1], e=[1, 0, 0]; midpoint version: xbar=[4, 0, 0], r=[0, 2, 0], r'=[2, 2, 0]; ell_0=0.2302, g_s=0.04344
 choice | eta | rel.dev bond profile (4.2) | rel.dev W_1 (4.5) | rel.dev W_b (4.6) | rho_ex(full grip) | rho0 (4.10) | rho_ex(a)/[(1+n g1)/(n g1) rho0] (4.13) | rho_mid_ex vs rho0_mid (4.12)
 A | 0.08 | 6.82e-02 | 1.10e-03 | 6.36e-02 | 1.28260 (body1), 1.28276 (body2) | 1.27776 | 1.08563, 1.07249 | 0.85054 vs 0.84964
 A | 0.04 | 3.50e-02 | 3.47e-04 | 3.25e-02 | 1.28019 (body1), 1.28028 (body2) | 1.27776 | 1.04236, 1.03591 | 0.85004 vs 0.84964
 A | 0.02 | 1.77e-02 | 1.60e-04 | 1.65e-02 | 1.27884 (body1), 1.27889 (body2) | 1.27776 | 1.02096, 1.01777 | 0.84932 vs 0.84964
 A | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 1.95 3.16 1.95 1.99 1.99 2.02 2.02 2.24; 1.97 2.17 1.97 2.24 2.23 2.02 2.02 1.25
 B | 0.08 | 2.33e-02 | 4.10e-03 | 2.30e-02 | 1.27649 (body1), 1.27546 (body2) | 1.27776 | 0.99492, 1.06621 | 0.84989 vs 0.84964
 B | 0.04 | 1.05e-02 | 1.10e-03 | 1.05e-02 | 1.27721 (body1), 1.27672 (body2) | 1.27776 | 0.99855, 1.03300 | 0.84980 vs 0.84964
 B | 0.02 | 4.99e-03 | 3.47e-04 | 5.08e-03 | 1.27754 (body1), 1.27730 (body2) | 1.27776 | 0.99958, 1.01649 | 0.84979 vs 0.84964
 B | dev(eta)/dev(eta/2) for eta=0.08; 0.04, columns [profile, W_1, W_b, rho_fg body1, rho_fg body2, rho_a body1, rho_a body2, rho_mid]: 2.21 3.74 2.18 2.34 2.22 3.51 2.01 1.63; 2.11 3.16 2.08 2.51 2.27 3.41 2.00 1.04

--- mirror identity max spec h(g) = -min spec h(-g) (even L):
 D=1, L=30: max + min(-g) = 0.00e+00
 D=2, L=12: max + min(-g) = 0.00e+00
 D=3, L=8: max + min(-g) = 0.00e+00

--- sum over x1 of the full g_s g1 g2 coefficient of (4.6) (incl. -ell2(r)/X): 
 D=1, L=30: sum = -8.88e-16
 D=2, L=12: sum = 1.39e-17
 D=3, L=8: sum = 3.47e-18

--- (4.3) ring: max |ell(r) - [(L^2-1)/(12L) - r(L-r)/(2L)]|:
 L=30: 6.66e-16
 L=61: 4.44e-15
 L=200: 7.11e-15
--- (4.4) 2D: ell(0)-ell(r e1) - [ln r/(2 pi) + (2 gamma_E + 3 ln 2)/(4 pi)]:
 L=256: r=2: -4.30e-03, r=4: -1.05e-03, r=8: -4.59e-04, r=16: -1.03e-03, r=32: -3.95e-03
 L=1024: r=2: -4.28e-03, r=4: -9.89e-04, r=8: -2.30e-04, r=16: -1.13e-04, r=32: -2.57e-04
--- (4.4) 3D: ell(0)-ell(r e1) - [G_0 - 1/(4 pi r)], G_0 = 0.2527310098:
 L=64: r=2: -3.10e-03, r=4: -4.05e-04, r=8: -8.25e-05, r=16: -1.83e-04
 L=128: r=2: -3.10e-03, r=4: -3.96e-04, r=8: -4.60e-05, r=16: -2.57e-05

--- (4.12) ring: lattice rho0 (e=+1, r'=r-1) vs 2(1-w)(1-2w)/((1-2u)(1-2v)), u=(d+1/2)/L, v=(r-1/2)/L, w=u+v:
 u=0.2, v=0.1: L=40: 1.18050 vs 1.18050 (diff +2.0e-15); L=80: 1.17316 vs 1.17316 (diff +2.9e-15); L=160: 1.16981 vs 1.16981 (diff +3.5e-14); L=320: 1.16821 vs 1.16821 (diff +1.2e-13)
 u=0.1, v=0.05: L=40: 1.65998 vs 1.65998 (diff +4.9e-15); L=80: 1.65601 vs 1.65601 (diff -2.7e-14); L=160: 1.65430 vs 1.65430 (diff -1.9e-13); L=320: 1.65352 vs 1.65352 (diff -5.0e-13)
 u=0.6, v=0.2: L=40: 1.70667 vs 1.70667 (diff +2.4e-15); L=80: 1.84394 vs 1.84394 (diff +7.3e-15); L=160: 1.91940 vs 1.91940 (diff -1.4e-13); L=320: 1.95903 vs 1.95903 (diff -3.6e-13)
 small-v limit 2(1-u): u=0.2 -> 1.6; u=0.1 -> 1.8

--- (4.11) 3D, L=128: rho0 - 1 and, in brackets, d*(rho0 - 1) vs d (x1=(d,0,0), e=e1):
 r=(0, 1, 0), r'=(1, 1, 1): d=8: +1.220e-01 (+0.976), d=16: +6.192e-02 (+0.991), d=32: +3.458e-02 (+1.106)
 r=(0, 2, 0), r'=(2, 3, 0): d=8: +2.321e-01 (+1.857), d=16: +1.238e-01 (+1.981), d=32: +6.826e-02 (+2.184)
 r=(0, 1, 0), r'=(0, 2, 0): d=8: +2.569e-02 (+0.205), d=16: +5.985e-03 (+0.096), d=32: +1.486e-03 (+0.048)
 r=(1, 0, 0), r'=(2, 0, 0): d=8: -8.986e-03 (-0.072), d=16: -4.938e-03 (-0.079), d=32: -2.950e-03 (-0.094)

--- (4.11) 2D: rho0 - 1 and, in brackets, d*(rho0 - 1) vs d and L (x1=(d,0), e=e1, r=(2,1), r'=(4,3)):
 L=128: d=8: +3.663e-01 (+2.931), d=16: +1.958e-01 (+3.133), d=32: +9.628e-02 (+3.081), d=64: -1.832e+00 (-117.227)
 L=512: d=8: +6.365e-01 (+5.092), d=16: +3.619e-01 (+5.790), d=32: +1.807e-01 (+5.783), d=64: +8.655e-02 (+5.539)
 L=2048: d=8: +9.125e-01 (+7.300), d=16: +5.357e-01 (+8.571), d=32: +2.758e-01 (+8.825), d=64: +1.327e-01 (+8.493)

--- (4.12) midpoint place: rho0_mid - 1 (ring; expected 0 up to rounding):
 L=40: (dbar,r,r')=(10,4,2): +2.2e-15, (dbar,r,r')=(8,10,4): +0.0e+00, (dbar,r,r')=(24,12,6): +7.1e-15
 L=160: (dbar,r,r')=(40,4,2): -5.3e-14, (dbar,r,r')=(32,10,4): +1.6e-14, (dbar,r,r')=(96,12,6): +1.1e-15
--- (4.12) midpoint place, 2D: rho0_mid - 1 and, in brackets, d^2*(rho0_mid - 1) (xbar=(d,0), e=e1, r=(2,2), r'=(4,2)):
 L=128: d=8: -2.734e-01 (-17.5), d=16: -6.036e-02 (-15.5), d=32: -1.385e-02 (-14.2), d=64: -5.869e-03 (-24.0)
 L=512: d=8: -5.208e-01 (-33.3), d=16: -1.243e-01 (-31.8), d=32: -2.808e-02 (-28.8), d=64: -6.302e-03 (-25.8)
 L=2048: d=8: -7.729e-01 (-49.5), d=16: -1.918e-01 (-49.1), d=32: -4.520e-02 (-46.3), d=64: -1.040e-02 (-42.6)
--- (4.12) midpoint place, 3D, L=128: rho0_mid - 1 and, in brackets, d^2*(rho0_mid - 1) (xbar=(d,0,0), e=e1):
 r=(0, 2, 0), r'=(2, 2, 2): d=8: -3.577e-02 (-2.29), d=16: -1.059e-02 (-2.71), d=32: -2.971e-03 (-3.04)
 r=(2, 0, 0), r'=(4, 2, 0): d=8: -3.812e-02 (-2.44), d=16: -7.741e-03 (-1.98), d=32: -1.755e-03 (-1.80)

--- 3D large separations (consistency check 2): W_b / (2 n g1 g2) = S - ell2(r)/X at |r|, d ~ L/4 shrinks with L:
 L=16: 3.502e-05
 L=32: 7.703e-06
 L=64: 1.877e-06

--- (4.15): exact lowest eigenvalue (Lanczos) minus the root of the finite-rank equation (bodies and source, eta = 0.08):
 D=1, L=256: +8.9e-16
 D=2, L=64: -5.8e-15
 D=3, L=16: -1.7e-14
--- Hellmann-Feynman g_s-coefficient |psi_0(x_s)|^2 against the symmetric difference in g_s (D=2, L=32, eta = 0.08):
 g_s=0.0167: symmetric difference / |psi_0(x_s)|^2 - 1 = +9.90e-05
 g_s=0.0083: symmetric difference / |psi_0(x_s)|^2 - 1 = +2.48e-05

=== Distance sweeps (I5): exact eigenpairs, full grip, body 1; rel.dev = exact/formula - 1; [ratio] = deviation at eta over deviation at eta/2 (2 for a deviation linear in eta) ===

--- sweep D=1, L=64: r=[3], r'=[2]; midpoint r=[4], r'=[2]; ell_0=5.3320
 choice A (k1,s1,k2,s2)=(0,+,1,+): actual eta = max|g_i| ell_0/t_f = 0.0320 and 0.0160
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    8 | +6.69e-04, +1.64e-04 | 1.60548 | +2.760e-02, +1.432e-02 [1.93] | 0.862, 4.4e+02 | 1.00000 | +5.000e-03, +2.889e-03 [1.73]
   16 | -2.52e-04, -6.55e-05 | 1.27939 | +4.258e-02, +2.206e-02 [1.93] | 1.331, 5.8e+02 | 1.00000 | +2.700e-02, +1.410e-02 [1.91]
   24 | -6.78e-04, -1.73e-04 | 0.83616 | +7.562e-02, +3.900e-02 [1.94] | 2.363, 9.7e+02 | 1.00000 | +3.939e-02, +2.053e-02 [1.92]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: -1.04e-01, -5.35e-02 [1.94]; s=2: -9.47e-02, -4.86e-02 [1.95]; s=4: -7.77e-02, -3.96e-02 [1.96]; s=8: -4.88e-02, -2.45e-02 [1.99]; s=16: -1.55e-02, -7.67e-03 [2.02]
 choice B (k1,s1,k2,s2)=(2,-,3,+): actual eta = max|g_i| ell_0/t_f = 0.0640 and 0.0320
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    8 | +2.34e-03, +6.13e-04 | 1.60548 | -1.357e-02, -7.027e-03 [1.93] | 0.212, 4.4e+02 | 1.00000 | -1.503e-02, -7.747e-03 [1.94]
   16 | -1.27e-03, -2.95e-04 | 1.27939 | -1.551e-02, -8.354e-03 [1.86] | 0.242, 5.8e+02 | 1.00000 | -1.171e-02, -6.482e-03 [1.81]
   24 | -3.04e-03, -7.32e-04 | 0.83616 | -1.023e-02, -5.164e-03 [1.98] | 0.160, 9.7e+02 | 1.00000 | -5.475e-03, -3.373e-03 [1.62]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: +3.11e-02, +1.50e-02 [2.07]; s=2: +2.92e-02, +1.39e-02 [2.10]; s=4: +2.45e-02, +1.14e-02 [2.15]; s=8: +1.39e-02, +6.74e-03 [2.07]; s=16: -1.50e-03, +6.40e-04 [-2.34]

--- sweep D=1, L=256: r=[3], r'=[2]; midpoint r=[4], r'=[2]; ell_0=21.3330
 choice A (k1,s1,k2,s2)=(0,+,1,+): actual eta = max|g_i| ell_0/t_f = 0.0320 and 0.0160
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
   32 | +7.30e-04, +1.79e-04 | 1.71486 | +9.297e-03, +5.203e-03 [1.79] | 0.291, 6.8e+03 | 1.00000 | -2.173e-03, -7.220e-04 [3.01]
   64 | -2.20e-04, -5.76e-05 | 1.44669 | +3.091e-02, +1.628e-02 [1.90] | 0.966, 9.2e+03 | 1.00000 | +2.110e-02, +1.121e-02 [1.88]
   96 | -6.64e-04, -1.69e-04 | 1.15171 | +7.050e-02, +3.654e-02 [1.93] | 2.203, 1.6e+04 | 1.00000 | +3.420e-02, +1.804e-02 [1.90]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: -1.11e-01, -5.73e-02 [1.93]; s=2: -1.08e-01, -5.61e-02 [1.93]; s=4: -1.04e-01, -5.35e-02 [1.94]; s=8: -9.47e-02, -4.87e-02 [1.95]; s=16: -7.77e-02, -3.96e-02 [1.96]
 choice B (k1,s1,k2,s2)=(2,-,3,+): actual eta = max|g_i| ell_0/t_f = 0.0640 and 0.0320
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
   32 | +2.58e-03, +6.73e-04 | 1.71486 | -3.837e-02, -1.982e-02 [1.94] | 0.600, 6.8e+03 | 1.00000 | -4.121e-02, -2.080e-02 [1.98]
   64 | -1.14e-03, -2.63e-04 | 1.44669 | -2.993e-02, -1.629e-02 [1.84] | 0.468, 9.2e+03 | 1.00000 | -2.539e-02, -1.371e-02 [1.85]
   96 | -2.98e-03, -7.18e-04 | 1.15171 | -1.625e-02, -9.221e-03 [1.76] | 0.254, 1.6e+04 | 1.00000 | -4.079e-03, -3.392e-03 [1.20]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: +3.23e-02, +1.59e-02 [2.03]; s=2: +3.19e-02, +1.56e-02 [2.05]; s=4: +3.11e-02, +1.50e-02 [2.07]; s=8: +2.92e-02, +1.39e-02 [2.10]; s=16: +2.46e-02, +1.14e-02 [2.15]

--- sweep D=2, L=64: r=[2, 1], r'=[4, 3]; midpoint r=[2, 2], r'=[4, 2]; ell_0=0.7107
 choice A (k1,s1,k2,s2)=(0,+,1,+): actual eta = max|g_i| ell_0/t_f = 0.0320 and 0.0160
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    4 | +1.62e-03, +4.04e-04 | 1.37592 | +8.995e-03, +4.553e-03 [1.98] | 0.281, 2.7e+02 | 0.47681 | -1.335e-02, -6.762e-03 [1.97]
    8 | +1.31e-03, +3.27e-04 | 1.22839 | +3.346e-03, +1.711e-03 [1.96] | 0.105, 5.0e+02 | 0.84304 | -5.490e-03, -2.776e-03 [1.98]
   16 | +1.01e-03, +2.52e-04 | 1.09635 | +3.904e-03, +1.994e-03 [1.96] | 0.122, 1.1e+03 | 0.96673 | +5.793e-04, +3.046e-04 [1.90]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: -8.90e-02, -4.60e-02 [1.93]; s=2: -8.04e-02, -4.14e-02 [1.94]; s=4: -7.16e-02, -3.68e-02 [1.95]; s=8: -6.29e-02, -3.22e-02 [1.95]
 choice B (k1,s1,k2,s2)=(2,-,3,+): actual eta = max|g_i| ell_0/t_f = 0.0640 and 0.0320
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    4 | +6.42e-03, +1.61e-03 | 1.37592 | +1.239e-02, +6.464e-03 [1.92] | 0.194, 2.7e+02 | 0.47681 | -2.960e-02, -1.469e-02 [2.02]
    8 | +5.23e-03, +1.31e-03 | 1.22839 | +5.690e-03, +2.935e-03 [1.94] | 0.089, 5.0e+02 | 0.84304 | -8.871e-03, -4.385e-03 [2.02]
   16 | +4.03e-03, +1.01e-03 | 1.09635 | +1.150e-03, +6.080e-04 [1.89] | 0.018, 1.1e+03 | 0.96673 | -3.399e-03, -1.677e-03 [2.03]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: +2.94e-02, +1.36e-02 [2.16]; s=2: +2.72e-02, +1.24e-02 [2.19]; s=4: +2.44e-02, +1.11e-02 [2.21]; s=8: +2.13e-02, +9.64e-03 [2.21]

--- sweep D=2, L=256: r=[2, 1], r'=[4, 3]; midpoint r=[2, 2], r'=[4, 2]; ell_0=0.9313
 choice A (k1,s1,k2,s2)=(0,+,1,+): actual eta = max|g_i| ell_0/t_f = 0.0320 and 0.0160
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    4 | +1.99e-03, +4.94e-04 | 1.72475 | +1.902e-02, +9.558e-03 [1.99] | 0.594, 5.2e+02 | -0.15929 | -3.863e-02, -1.952e-02 [1.98]
    8 | +1.75e-03, +4.37e-04 | 1.50024 | +5.507e-03, +2.791e-03 [1.97] | 0.172, 9.1e+02 | 0.60418 | -1.963e-02, -9.946e-03 [1.97]
   16 | +1.51e-03, +3.77e-04 | 1.27770 | -1.266e-03, -6.238e-04 [2.03] | 0.040, 1.6e+03 | 0.90859 | -1.013e-02, -5.151e-03 [1.97]
   32 | +1.26e-03, +3.15e-04 | 1.13720 | -1.657e-03, -8.216e-04 [2.02] | 0.052, 3.1e+03 | 0.97980 | -4.742e-03, -2.422e-03 [1.96]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: -9.44e-02, -4.89e-02 [1.93]; s=2: -8.79e-02, -4.55e-02 [1.93]; s=4: -8.15e-02, -4.20e-02 [1.94]; s=8: -7.50e-02, -3.85e-02 [1.95]; s=16: -6.84e-02, -3.52e-02 [1.95]
 choice B (k1,s1,k2,s2)=(2,-,3,+): actual eta = max|g_i| ell_0/t_f = 0.0640 and 0.0320
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    4 | +7.81e-03, +1.96e-03 | 1.72475 | +2.263e-03, +1.839e-03 [1.23] | 0.035, 5.2e+02 | -0.15929 | -1.059e-01, -5.254e-02 [2.02]
    8 | +6.94e-03, +1.74e-03 | 1.50024 | +1.925e-04, +4.825e-04 [0.40] | 0.003, 9.1e+02 | 0.60418 | -4.242e-02, -2.093e-02 [2.03]
   16 | +6.01e-03, +1.50e-03 | 1.27770 | +1.030e-03, +6.905e-04 [1.49] | 0.016, 1.6e+03 | 0.90859 | -1.415e-02, -6.923e-03 [2.04]
   32 | +5.05e-03, +1.26e-03 | 1.13720 | +6.941e-04, +4.143e-04 [1.68] | 0.011, 3.1e+03 | 0.97980 | -5.110e-03, -2.498e-03 [2.05]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: +3.05e-02, +1.43e-02 [2.14]; s=2: +2.91e-02, +1.34e-02 [2.17]; s=4: +2.75e-02, +1.25e-02 [2.19]; s=8: +2.56e-02, +1.16e-02 [2.21]; s=16: +2.33e-02, +1.05e-02 [2.22]

--- sweep D=3, L=16: r=[0, 1, 0], r'=[1, 1, 1]; midpoint r=[0, 2, 0], r'=[2, 2, 2]; ell_0=0.2386
 choice A (k1,s1,k2,s2)=(0,+,1,+): actual eta = max|g_i| ell_0/t_f = 0.0320 and 0.0160
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    2 | +1.20e-03, +3.00e-04 | 1.15431 | +1.559e-03, +7.997e-04 [1.95] | 0.049, 1.9e+02 | 0.95983 | +2.024e-03, +1.039e-03 [1.95]
    3 | +1.11e-03, +2.76e-04 | 1.14713 | +1.023e-03, +5.236e-04 [1.95] | 0.032, 4.2e+02 | 0.93780 | +3.179e-04, +1.677e-04 [1.90]
    4 | +1.06e-03, +2.64e-04 | 1.14101 | +1.243e-03, +6.330e-04 [1.96] | 0.039, 7.7e+02 | 0.94019 | +1.913e-04, +9.999e-05 [1.91]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: -6.97e-02, -3.58e-02 [1.95]; s=2: -6.22e-02, -3.18e-02 [1.95]; s=4: -5.86e-02, -2.99e-02 [1.96]
 choice B (k1,s1,k2,s2)=(2,-,3,+): actual eta = max|g_i| ell_0/t_f = 0.0640 and 0.0320
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    2 | +4.82e-03, +1.20e-03 | 1.15431 | +5.541e-03, +2.798e-03 [1.98] | 0.087, 1.9e+02 | 0.95983 | -6.895e-04, -2.840e-04 [2.43]
    3 | +4.43e-03, +1.10e-03 | 1.14713 | +1.697e-03, +8.658e-04 [1.96] | 0.027, 4.2e+02 | 0.93780 | -8.827e-04, -4.261e-04 [2.07]
    4 | +4.24e-03, +1.06e-03 | 1.14101 | +8.373e-05, +6.336e-05 [1.32] | 0.001, 7.7e+02 | 0.94019 | -8.300e-04, -4.054e-04 [2.05]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: +2.38e-02, +1.08e-02 [2.21]; s=2: +2.11e-02, +9.53e-03 [2.21]; s=4: +1.96e-02, +8.92e-03 [2.20]

--- sweep D=3, L=32: r=[0, 1, 0], r'=[1, 1, 1]; midpoint r=[0, 2, 0], r'=[2, 2, 2]; ell_0=0.2457
 choice A (k1,s1,k2,s2)=(0,+,1,+): actual eta = max|g_i| ell_0/t_f = 0.0320 and 0.0160
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    2 | +1.26e-03, +3.15e-04 | 1.20904 | +1.604e-03, +8.254e-04 [1.94] | 0.050, 2.0e+02 | 1.04934 | +2.472e-03, +1.265e-03 [1.95]
    4 | +1.12e-03, +2.79e-04 | 1.17605 | +4.431e-04, +2.304e-04 [1.92] | 0.014, 7.5e+02 | 0.94747 | -7.771e-04, -3.922e-04 [1.98]
    8 | +1.04e-03, +2.61e-04 | 1.11165 | +7.610e-04, +3.886e-04 [1.96] | 0.024, 3.0e+03 | 0.96916 | -2.509e-04, -1.303e-04 [1.93]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: -7.10e-02, -3.65e-02 [1.95]; s=2: -6.36e-02, -3.26e-02 [1.95]; s=4: -5.99e-02, -3.07e-02 [1.96]; s=8: -5.83e-02, -2.99e-02 [1.95]
 choice B (k1,s1,k2,s2)=(2,-,3,+): actual eta = max|g_i| ell_0/t_f = 0.0640 and 0.0320
   d | rel.dev W_1 (4.5) at eta, eta/2 | rho0 (4.10) | rho_ex-rho0 at eta, eta/2 [ratio] | |rho_ex-rho0|/eta_act, bound scale K of (4.10) | rho0_mid (4.12) | rho_mid_ex-rho0_mid at eta, eta/2 [ratio]
    2 | +5.05e-03, +1.26e-03 | 1.20904 | +5.876e-03, +2.976e-03 [1.97] | 0.092, 2.0e+02 | 1.04934 | -2.253e-03, -1.043e-03 [2.16]
    4 | +4.48e-03, +1.12e-03 | 1.17605 | +3.624e-04, +1.938e-04 [1.87] | 0.006, 7.5e+02 | 0.94747 | -2.125e-03, -1.065e-03 [2.00]
    8 | +4.18e-03, +1.04e-03 | 1.11165 | -8.162e-04, -3.942e-04 [2.07] | 0.013, 3.0e+03 | 0.96916 | -9.861e-04, -4.938e-04 [2.00]
   profile (4.2), r = 2s e1 against r' = s e1; s: rel.dev at eta, eta/2 [ratio]: s=1: +2.43e-02, +1.10e-02 [2.21]; s=2: +2.16e-02, +9.79e-03 [2.21]; s=4: +2.02e-02, +9.16e-03 [2.20]; s=8: +1.95e-02, +8.88e-03 [2.20]

--- (4.14) exact ratios, highest state (sigma) vs lowest state (-sigma) and (sigma), nominal eta=0.08:
 graph | choice | rho_fg: max(s), min(-s), min(s), rho0 | rho_a: max(s), min(-s) | max|diff| of max(s) and min(-s) | (rho_fg max(s) - rho0)/(rho_fg min(s) - rho0)
 D=1, L=30 | A | 1.132834, 1.132834, 1.234330, 1.185882 | 2447.748830, 2447.748830 | 0.0e+00 | -1.095
 D=1, L=30 | B | 1.189073, 1.189073, 1.180850, 1.185882 | 2775.917380, 2775.917380 | 0.0e+00 | -0.634
 D=2, L=12 | A | 0.621265, 0.621265, 0.638428, 0.630142 | 1144.781210, 1144.781210 | 0.0e+00 | -1.071
 D=2, L=12 | B | 0.629656, 0.629656, 0.629173, 0.630142 | 1253.793494, 1253.793494 | 0.0e+00 | +0.502
 D=3, L=8 | A | 1.094787, 1.094787, 1.103481, 1.099269 | 3626.786245, 3626.786245 | 0.0e+00 | -1.064
 D=3, L=8 | B | 1.097713, 1.097713, 1.100140, 1.099269 | 3929.840964, 3929.840964 | 0.0e+00 | -1.785

--- (4.17) square torus, fixed places, x_s=0, e=e1: L | ell_0 | rho0 | beta_L | rho_L = rho0 - beta_L ell_0 | K/ell_0^3 | |Delta_e ell2(R)| / [(pi^2/8)(2d+1) ell_0]
 L=128 | place x1=(8,0), r=(2,1), r'=(4,3) | 0.8210 | 1.36635 | 1.30347 | 0.29622 | 1224.5 | 0.075
 L=128 | place x1=(16,0), r=(2,1), r'=(4,3) | 0.8210 | 1.19583 | 0.89910 | 0.45768 | 2303.1 | 0.049
 L=128 | midpoint xbar=(8,0), r=(2,2), r'=(4,2) | 0.8210 | 0.72658 | -1.16409 | 1.68228 | 1590.2 | 0.075
 L=512 | place x1=(8,0), r=(2,1), r'=(4,3) | 1.0416 | 1.63650 | 1.25930 | 0.32478 | 1058.9 | 0.102
 L=512 | place x1=(16,0), r=(2,1), r'=(4,3) | 1.0416 | 1.36189 | 0.80287 | 0.52559 | 1850.9 | 0.081
 L=512 | midpoint xbar=(8,0), r=(2,2), r'=(4,2) | 1.0416 | 0.47921 | -1.14639 | 1.67332 | 1057.3 | 0.102
 L=2048 | place x1=(8,0), r=(2,1), r'=(4,3) | 1.2623 | 1.91253 | 1.25661 | 0.32636 | 964.4 | 0.119
 L=2048 | place x1=(16,0), r=(2,1), r'=(4,3) | 1.2623 | 1.53569 | 0.79738 | 0.52918 | 1634.5 | 0.102
 L=2048 | midpoint xbar=(8,0), r=(2,2), r'=(4,2) | 1.2623 | 0.22711 | -1.14529 | 1.67277 | 723.1 | 0.119

Interested in this research?

Join the readers' list and get an e-mail when a new stage or a correction is published. No password, and you can unsubscribe at any time.