TFPT scientific source excerpt Original repository path: experiments/theory-contracts/mixed-current-origin-20261014/check_kms_locality_and_source_winding.py Original file SHA-256: 7c6e4579da19d55089a95f751e72a37af250e51360ee4b02fa499df7e2fba2a7 Inclusive original lines: 35-144 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. 000035 | 'nonzero exact even-locality witness') 000036 | 000037 | # Refined central character of the existing odd Phi, checked on source charges. 000038 | r=s.Matrix([s.Rational(1,2)]*4+[-s.Rational(1,2)]*4) 000039 | charges=[s.zeros(8,1)] 000040 | for i in range(8): 000041 | for v in (-2,-1,1,2): 000042 | p=s.zeros(8,1);p[i]=v;charges.append(p) 000043 | for i in range(7): 000044 | p=s.zeros(8,1);p[i]=1;p[i+1]=1;charges.append(p) 000045 | for p in charges: 000046 | parity=1 if int(sum(p))%2==0 else -1 000047 | q=p if parity==1 else s.Matrix([p[(k+4)%8] for k in range(8)])+r 000048 | need(sum(q)==sum(p),'existing Phi total charge') 000049 | need(all(s.exp(2*s.pi*s.I*qk)==parity for qk in q), 000050 | 'target individual Cartan holonomy equals old parity') 000051 | need(all(s.exp(2*s.pi*s.I*pk)==1 for pk in p), 000052 | 'old individual Cartan holonomy is identity') 000053 | 000054 | # Exact truncated ORIGINAL edge spectrum, partition and parity trace. 000055 | # This is a finite control of analytic infinite products proved in the text. 000056 | x=s.symbols('x') 000057 | levels=[1,3,5,7,9,11,13,15] # energies in units of1/4, eitherquarter. 000058 | zpoly=s.prod(1+x**e for e in levels) 000059 | spoly=s.prod(1-x**e for e in levels) 000060 | ztrace=0;strace=0 000061 | for bits in itertools.product((0,1),repeat=len(levels)): 000062 | term=x**sum(v*e for v,e in zip(bits,levels)) 000063 | ztrace+=term;strace+=(-1)**sum(bits)*term 000064 | need(s.expand(ztrace-zpoly)==0 and s.expand(strace-spoly)==0, 000065 | 'full finite original-edge trace/product identity') 000066 | ze,zo=(zpoly+spoly)/2,(zpoly-spoly)/2 000067 | need(s.cancel((ze**2-zo**2)/(ze**2+zo**2) 000068 | -2*zpoly*spoly/(zpoly**2+spoly**2))==0, 000069 | 'total-even two-edge central character formula') 000070 | need(s.cancel(1-2*zpoly*spoly/(zpoly**2+spoly**2) 000071 | -(zpoly-spoly)**2/(zpoly**2+spoly**2))==0, 000072 | 'strictly positive two-edge thermal defect') 000073 | 000074 | # Source charge-one winding parity, checked algebraically without making a 000075 | # truncated shift a supposedly unitary finite spectral-flow implementation. 000076 | u,v=s.symbols('u v') 000077 | P=s.diag(1,-1);W=s.Matrix([[0,u],[v,0]]);Pe=(s.eye(2)+P)/2 000078 | need(P*W+W*P==s.zeros(2),'odd source winding parity relation') 000079 | need(Pe*W*Pe==s.zeros(2),'left-even projection removes source W1 compression') 000080 | need(W.H*P*W*P==-W.H*W,'exact odd-winding/Cartan four-word sign') 000081 | 000082 | thermal=[] 000083 | for alpha in (.25,.75): 000084 | for beta in (.7,2*math.pi,8.): 000085 | energies=np.array([e for m in range(96) for e in (m+alpha,m+1-alpha)]) 000086 | ratio=float(np.prod(np.tanh(beta*energies/2))) 000087 | even_expect=2*ratio/(1+ratio*ratio) 000088 | need(01e-4,'actual original-time fixed-region invariance fails') 000115 | original=np.zeros_like(h);original[j0,j0]=1 000116 | need(np.linalg.norm(original@number_out-number_out@original)<1e-14, 000117 | 'the original even local observables commute before time transport') 000118 | # Single-mode reduced thermal state: modular flow fixes its number. 000119 | beta=.7 000120 | C=(vs*(1/(1+np.exp(beta*es))))@vs.conj().T 000121 | occupation=float(C[j0,j0].real) 000122 | need(0