TFPT scientific source excerpt Original repository path: experiments/theory-contracts/original-local-source-variable-background-20261102/check_variable_background.py Original file SHA-256: 4aec8350583dd2ac20b8a78d35bd7101f67cac13820e78e11b16ce77d0a16064 Inclusive original lines: 1-92 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 | """Native variable-background control; the accompanying proof owns the limit.""" 000002 | from pathlib import Path 000003 | import sys,json,hashlib 000004 | import numpy as np 000005 | from scipy.linalg import expm 000006 | from scipy.special import expit 000007 | 000008 | [OMITTED: non-scientific conversation or execution metadata] 000009 | sys.path.insert(0,str(REPO/'verification')) 000010 | import v252_full_finite_triple as original 000011 | 000012 | checks={} 000013 | def need(name,value): 000014 | checks[name]=bool(value) 000015 | if not value:raise RuntimeError(name) 000016 | def small(a,tol=1e-8):return np.linalg.norm(a)1e-3) 000063 | e,u=np.linalg.eigh(h);delta=e[:,None]-e[None,:] 000064 | fe=u.conj().T@Fn@u 000065 | A=fe*np.exp(-.07*delta**2/2) 000066 | # g'(t) Fourier transform is -i*w*g_hat(w). 000067 | derivative=-1j*delta*A 000068 | timeidentity=(e[:,None]+e[None,:])*A+1j*derivative-2*e[:,None]*A 000069 | need(f'time_and_anticommutator_identity_alpha{alpha}_N{ncut}',small(timeidentity)) 000070 | need(f'actual_variable_h_is_not_momentum_diagonal_alpha{alpha}_N{ncut}',np.linalg.norm(Vn-np.kron(np.eye(len(ns)),T[2]))>1) 000071 | need(f'selfadjoint_source_alpha{alpha}_N{ncut}',small(A-A.conj().T)) 000072 | c=expit(2*e);variance=float(np.sum(c[:,None]*(1-c)[None,:]*abs(A)**2)) 000073 | norm=float(np.linalg.norm(A,2));hs2=float(np.linalg.norm(A)**2) 000074 | Btest=fe*np.exp(-.09*delta**2/2+1j*.3*delta) 000075 | direct,corrected=source(c,A,Btest) 000076 | need(f'exact_ordered_det2_correction_alpha{alpha}_N{ncut}',abs(direct-corrected)<1e-10) 000077 | mg=[] 000078 | ae=np.linalg.eigvalsh(A) 000079 | for s in [-.7,.7]: 000080 | # Similar positive matrix avoids a complex log determinant. 000081 | rootc=np.sqrt(c);X=rootc[:,None]*(expm(s*A)-np.eye(size))*rootc[None,:] 000082 | z=np.linalg.eigvalsh(np.eye(size)+(X+X.conj().T)/2) 000083 | need(f'positive_MGF_matrix_alpha{alpha}_N{ncut}_s{s}',min(z)>0) 000084 | logmgf=float(np.sum(np.log(z))-s*np.sum(c*np.diag(A)).real) 000085 | bound=s*s/2*np.exp(abs(s)*norm)*hs2 000086 | need(f'uniform_exponential_moment_bound_alpha{alpha}_N{ncut}_s{s}',logmgf<=bound+1e-9) 000087 | mg.append({'s':s,'log_MGF':logmgf,'analytic_upper_bound':float(bound)}) 000088 | rows.append({'alpha':alpha,'N':ncut,'dimension':size,'HS_squared':hs2,'operator_norm':norm,'variance':variance,'ordered_source':[float(direct.real),float(direct.imag)],'moment_bounds':mg}) 000089 | 000090 | result={'result_id':'L20261102D','all_passed':all(checks.values()),'checks':checks,'rows':rows,'original_builder':str(REPO/'verification/v252_full_finite_triple.py'),'builder_sha256':hashlib.sha256((REPO/'verification/v252_full_finite_triple.py').read_bytes()).hexdigest(),'scope':'Original given circle and variable smooth Higgs coefficient; native seed252 diagnostics. The continuum theorem is analytical. No primitive field/state selection, H probability, 3+1 physics, absolute normalization or ledger promotion.'} 000091 | Path(__file__).with_name('variable-background-results.json').write_text(json.dumps(result,indent=2)+'\n') 000092 | print(json.dumps({'all_passed':result['all_passed'],'checks':len(checks),'rows':rows},indent=2))