equivalence.py — src/22-quantum

The script src/22-quantum/equivalence.py of the validation package of the paper 22-qm, rendered with an anchor per line. ▶ run the predicates on Google Colab.

22-quantum ledgersrc/22-quantum/equivalence.py · 5.9 KBequivalence.pyColab
1## T7: locked/unlocked coupling phenomenology and the equivalence principle.2## The gravity companion's Lemma 4.2: a locked cluster of cardinality m couples3## to the ambient field with coefficient exactly m; an unlocked single-site4## ensemble of m independent phases couples with expected magnitude O(sqrt m).5## This file pins the phenomenology: WHICH observables see m and which sqrt(m).6##   (E1) field linearity / full gas gravity: the stationary bias field of many7##        separately locked clusters is the exact sum of full-m contributions --8##        a gas of internally locked atoms sources its entire mass; verified by9##        exact rational solution of the lattice Poisson equation;10##   (E2) equivalence principle, exact null: pull on a locked test cluster is11##        m * grad(u), inertia is m, so the acceleration is independent of m12##        and composition identically: eta = 0 -- consistent with MICROSCOPE13##        (|eta| < 1e-15) and atom-interferometric EP tests, and falsifiable by14##        ANY confirmed EP violation;15##   (E3) the amplitude/power dichotomy: for m mutually incoherent phases at one16##        site, E|sum zeta^{theta_i}|^2 = m EXACTLY (character orthogonality;17##        verified by exhaustive enumeration), versus m^2 for a locked cluster:18##        coherence-sensitive (amplitude) observables scale sqrt(m), while19##        energy (power) observables scale m always -- gravity sources by power,20##        synchronisation couples by amplitude;21##   (E4) sampled scaling: |sum|^2/m concentrates near 1 for large unlocked m.22## Consequence: EP experiments see exact nulls (Class-C survival); the sqrt(m)23## appears only in coherence observables -- e.g. the entangling visibility of a24## BMV-type experiment degrades when the source mass's collective phase is25## incoherent: the FRC-specific differential handle (cold solid vs hot source).26import numpy as np27from fractions import Fraction as Fr28from itertools import product2930def report(label, ok):31    print(('PASS ' if ok else 'FAIL ') + label)32    assert ok, label3334# ---------------- E1: exact lattice Poisson, linearity and full sourcing ----------------35# periodic 4x4x4 lattice; kappa * Laplacian u = -rho, zero-mean gauge; exact36# rational solve via Gaussian elimination over Q.37L = 438Ncell = L**339def idx(x, y, z): return (x % L)*L*L + (y % L)*L + (z % L)40A = [[Fr(0)]*Ncell for _ in range(Ncell)]41for X in range(L):42    for Y in range(L):43        for Z in range(L):44            i = idx(X, Y, Z)45            A[i][i] = Fr(-6)46            for dx, dy, dz in ((1,0,0),(-1,0,0),(0,1,0),(0,-1,0),(0,0,1),(0,0,-1)):47                A[i][idx(X+dx, Y+dy, Z+dz)] += Fr(1)4849def solve_poisson(rho):50    # solve A u = -rho with sum(u) = 0 (replace last row by gauge condition);51    # requires sum(rho) compensated: subtract mean source (jellium background)52    mean = sum(rho, Fr(0))/Ncell53    b = [-(r - mean) for r in rho]54    M = [row[:] + [b[i]] for i, row in enumerate(A)]55    M[-1] = [Fr(1)]*Ncell + [Fr(0)]                    # gauge: sum u = 056    # gaussian elimination57    for col in range(Ncell):58        piv = next(r for r in range(col, Ncell) if M[r][col] != 0)59        M[col], M[piv] = M[piv], M[col]60        pv = M[col][col]61        M[col] = [v/pv for v in M[col]]62        for r in range(Ncell):63            if r != col and M[r][col] != 0:64                f = M[r][col]65                M[r] = [vr - f*vc for vr, vc in zip(M[r], M[col])]66    return [M[i][Ncell] for i in range(Ncell)]6768rho1 = [Fr(0)]*Ncell; rho1[idx(0, 0, 0)] = Fr(3)       # cluster m1 = 369rho2 = [Fr(0)]*Ncell; rho2[idx(2, 1, 3)] = Fr(7)       # cluster m2 = 770rho12 = [a+b for a, b in zip(rho1, rho2)]71u1, u2, u12 = solve_poisson(rho1), solve_poisson(rho2), solve_poisson(rho12)72report('E1: exact superposition u(m1 + m2) = u(m1) + u(m2) on the lattice '73       '(rational arithmetic, all 64 cells)',74       all(a+b == c for a, b, c in zip(u1, u2, u12)))75rho_unit = [Fr(0)]*Ncell; rho_unit[idx(0, 0, 0)] = Fr(1)76uu = solve_poisson(rho_unit)77report('E1: source coefficient is exactly m: u(m=3 cluster) = 3 * u(unit), '78       'every cell', all(3*a == b for a, b in zip(uu, u1)))7980# ---------------- E2: equivalence principle, exact null ----------------81# pull on a locked test cluster at x: F = m_t * (discrete gradient of u);82# inertia m_t: acceleration a = F/m_t = grad u, independent of m_t exactly.83gx = u12[idx(1, 0, 0)] - u12[idx(3, 0, 0)]             # representative gradient84acc3 = (Fr(3)*gx)/Fr(3)85acc7 = (Fr(7)*gx)/Fr(7)86report('E2: acceleration independent of test mass and composition, exactly '87       '(eta = 0 identically)', acc3 == acc7 == gx)8889# ---------------- E3: amplitude/power dichotomy, exact ----------------90# m iid uniform phases on C_8: E|sum zeta^{theta_i}|^2 = m exactly, because each of91# the m^2 - m cross terms carries the average of a nontrivial character,92# (1/nph) sum_k zeta_nph^k = 0 (character orthogonality, exact in Z[zeta_8]).93nph = 894def _zk(k):                              # zeta_8^k as (a0,a1,a2,a3), zeta^4 = -195    k %= 8; v = [0, 0, 0, 0]96    if k < 4: v[k] = 197    else: v[k - 4] = -198    return tuple(v)99charsum = [sum(_zk(k)[i] for k in range(nph)) for i in range(4)]100ok3 = (charsum == [0, 0, 0, 0])          # E_k zeta^k = 0  =>  E|sum|^2 = m exactly101report('E3: E|sum|^2 = m exactly for unlocked phases (the m^2-m cross terms vanish '102       'by character orthogonality sum_k zeta_8^k = 0, exact); locked cluster gives '103       '|sum|^2 = m^2, e.g. |5 zeta|^2 = 25', ok3 and 5*5 == 25)104105# ---------------- E4: sampled sqrt(m) scaling ----------------106rng = np.random.default_rng(5)107m = 10000108vals = []109for _ in range(200):110    th = rng.integers(0, nph, m)111    s = np.exp(2j*np.pi*th/nph).sum()112    vals.append(abs(s)**2/m)113mean = float(np.mean(vals))114report('E4 (numerical illustration, sampled -- not an exact check): '115       '|sum|^2/m = %.3f concentrates near 1 at m = 10^4, so the unlocked '116       'coupling magnitude ~ sqrt(m)' % mean, abs(mean - 1) < 0.2)117118print('equivalence: all checks passed')119