TFPT scientific source excerpt Original repository path: experiments/theory-contracts/tfpt-unified-source-derivation-20261029/aps_source_review/check_local_source_modular_time.py Original file SHA-256: 6caeca452b19ea1b1cd010273b3cd7842748ee591e0b9673819fcb3078e7c7e6 Inclusive original lines: 1-124 Line numbers below refer to the original source. This bounded excerpt is source evidence; it is not a new proof/checker run. Conversation metadata and personal execution details are omitted where indicated. 000001 | """Actual elliptic local source; all-mode proof is in the adjacent text. 000002 | Finite CAR slice checks are not a lattice replacement or full-k convergence. 000003 | """ 000004 | from pathlib import Path 000005 | import json 000006 | import mpmath as mp 000007 | import numpy as np 000008 | import sympy as sy 000009 | from scipy.linalg import expm 000010 | 000011 | HERE=Path(__file__).resolve().parent 000012 | checks=[] 000013 | def need(ok,label): 000014 | if not bool(ok):raise RuntimeError(label) 000015 | checks.append(dict(label=label,passed=True)) 000016 | 000017 | mp.mp.dps=85 000018 | beta=4*mp.pi;q=mp.exp(-beta);delta=mp.pi/16;theta0=mp.pi/4 000019 | def bump_integral(n): 000020 | return mp.quad(lambda y:mp.exp(-1/(1-y*y))*mp.cos(n*delta*y/2),[-1,0,1]) 000021 | b0=bump_integral(0) 000022 | bn=[bump_integral(n)/b0 for n in range(11)] 000023 | chi=[x*x for x in bn] 000024 | need(all(x>0 for x in bn[:3]),'Actual compact autocorrelation has positive first two Fourier coefficients') 000025 | need(theta0+delta-mp.pi/2,'Entire actual smooth probe support lies inside I') 000026 | def cothdiff(n): 000027 | return 2*(q**n/(1-q**n)-q**(n+1)/(1-q**(n+1))) 000028 | M=8 000029 | terms=[-mp.sin(theta0)*(n*(n+1))**2*cothdiff(n)*chi[n]*chi[n+1] for n in range(1,M+1)] 000030 | derivative=sum(terms) 000031 | N=M+1 000032 | tail=2*(N*(N+1))**2*q**N/((1-q)*(1-q*((mp.mpf(N+2)/N)**2))) 000033 | need(all(t<0 for t in terms),'All evaluated exact-sign summands are negative') 000034 | need(abs(derivative)>tail*mp.mpf('1e35'),'Certified analytic all-mode tail cannot change the strict local witness sign') 000035 | f=lambda n:1j*n*chi[abs(n)]*mp.exp(-1j*n*theta0) 000036 | g=lambda n:-.5j*((n-1)*f(n-1)+(n+1)*f(n+1)) 000037 | # Different evaluation: direct variation of only the thermal correction. 000038 | # The full vacuum part is analytically invariant, not Fourier truncated. 000039 | direct=sum(2*mp.re(mp.conj(f(n))*g(n))*2*n*q**n/(1-q**n) for n in range(1,M+1)) 000040 | need(abs(direct-derivative)>j)&1:A[bits^(1<