strongcp.py โ€” src/27-fields

The file src/27-fields/strongcp.py of the validation package of the paper 27-fld, rendered with an anchor per line; the file itself is beside this page.

27-fields ledgersrc/27-fields/strongcp.py ยท 4.3 KBstrongcp.py
1# framed-rational status: EXACT -- integer / modular-F_p / cyclotomic arithmetic throughout (F_{p^2} determinants); no float, no continuum primitives.2"""Vanishing strong-CP angle on the substrate (27-fields, prop:strongcp).34Physical angle: theta-bar = theta + arg det(M_q).56(i) theta = 0: the colour action is the unique adjacency-local gauge-invariant7    quadratic functional; the topological term is not such a functional and is8    not generated (and colour is drive-invariant, so it carries no drive-selected9    orientation). Structural; not checked numerically here.1011(ii) arg det(M_q) = 0: the quark mass matrices are Hermitian over the quadratic12     extension F_{p^2}/F_p (mass is the modulus-square of a Hermitian-circulant13     amplitude, generation universality). A Hermitian matrix has determinant in14     the fixed field F_p (real): det(M^dagger) = Frob(det M), and M^dagger = M15     gives det M = Frob(det M), so det M in F_p, arg det M = 0. The CKM phase16     lives in the up-down misalignment, not in det.1718All arithmetic is framed-rational: integer/modular F_p and F_{p^2}, no floats,19no continuum primitives.20"""2122_pass = 023_fail = 0242526def check(name, cond):27    global _pass, _fail28    cond = bool(cond)29    print(("PASS" if cond else "FAIL") + " : " + name)30    if cond:31        _pass += 132    else:33        _fail += 1343536def legendre(a, p):37    return pow(a % p, (p - 1) // 2, p)383940# ---- F_{p^2} = F_p[theta], theta^2 = -3 (a non-residue for p = 2 mod 3) ----41# element = (u, v) meaning u + v*theta ; Frobenius conjugation: (u, v) -> (u, -v)42def fadd(A, B, p):43    return ((A[0] + B[0]) % p, (A[1] + B[1]) % p)444546def fmul(A, B, p, d):47    a0, a1 = A48    b0, b1 = B49    return ((a0 * b0 + a1 * b1 * d) % p, (a0 * b1 + a1 * b0) % p)505152def frob(A, p):53    return (A[0] % p, (-A[1]) % p)545556def fconst(c, p):57    return (c % p, 0)585960def det3(M, p, d):61    # Leibniz for 3x3 over F_{p^2}62    def term(i, j, k, s):63        t = fmul(M[0][i], fmul(M[1][j], M[2][k], p, d), p, d)64        return t if s > 0 else (((-t[0]) % p), ((-t[1]) % p))65    r = (0, 0)66    for (i, j, k, s) in [(0, 1, 2, 1), (1, 2, 0, 1), (2, 0, 1, 1),67                         (0, 2, 1, -1), (2, 1, 0, -1), (1, 0, 2, -1)]:68        r = fadd(r, term(i, j, k, s), p)69    return r707172def hermitian(diag, upper, p):73    # build 3x3 Hermitian over F_{p^2}: diag in F_p, upper = [M01,M02,M12] in F_{p^2}74    M = [[fconst(diag[0], p), upper[0], upper[1]],75         [frob(upper[0], p), fconst(diag[1], p), upper[2]],76         [frob(upper[1], p), frob(upper[2], p), fconst(diag[2], p)]]77    return M787980def commutes(A, B, p, d):81    # [A,B] = AB - BA over F_{p^2}, 3x382    def matmul(X, Y):83        return [[84            (lambda s: s)(85                ( (lambda acc: acc)(86                    (fadd(fadd(fmul(X[i][0], Y[0][j], p, d),87                               fmul(X[i][1], Y[1][j], p, d), p),88                          fmul(X[i][2], Y[2][j], p, d), p)) )))89            for j in range(3)] for i in range(3)]90    AB = matmul(A, B)91    BA = matmul(B, A)92    return all(AB[i][j] == BA[i][j] for i in range(3) for j in range(3))939495for p in (17, 53, 173, 389, 1373):96    d = (-3) % p97    assert legendre(d, p) == p - 198    # (a) Hermitian circulant: diag equal, upper entries (b, b, b) with b in F_{p^2}99    b = (2, 1)100    Hc = hermitian([5, 5, 5], [b, frob(b, p), b], p)101    detc = det3(Hc, p, d)102    check("F_%d: Hermitian circulant det in F_p (arg det = 0)" % p, detc[1] == 0)103    # (b) Hermitian textured (non-circulant): unequal diag and distinct upper entries104    Hu = hermitian([3, 7, 11], [(1, 1), (2, 3), (4, 1)], p)105    Hd = hermitian([2, 5, 13], [(3, 2), (1, 4), (5, 2)], p)106    du = det3(Hu, p, d)107    dd = det3(Hd, p, d)108    check("F_%d: textured up/down Hermitian dets in F_p (arg det M_q = 0)" % p,109          du[1] == 0 and dd[1] == 0)110    # (c) product of the two mass matrices still has real det (theta-bar = 0)111    # det(M_u M_d) = det(M_u) det(M_d), real * real = real112    prod = fmul(du, dd, p, d)113    check("F_%d: det(M_u M_d) in F_p" % p, prod[1] == 0)114    # (d) the two textured Hermitian matrices do not commute -> CKM mixing (delta_CP) is free115    check("F_%d: [M_u, M_d] != 0 (non-trivial CKM misalignment, dets still real)" % p,116          not commutes(Hu, Hd, p, d))117118print("\n%d framed-rational checks, %d passed, %d failed" % (_pass + _fail, _pass, _fail))119raise SystemExit(1 if _fail else 0)120