#!/usr/bin/env python3 """Reproducible, bounded calculations. No Millennium solution is asserted.""" from pathlib import Path import os for key in ("OMP_NUM_THREADS","OPENBLAS_NUM_THREADS","MKL_NUM_THREADS"): os.environ[key]="1" import itertools,json,hashlib,platform,time import numpy as np import scipy from scipy.sparse import coo_matrix from scipy.sparse.linalg import eigsh import sympy as sp root=Path(__file__).resolve().parents[1] dest=root/"public/research";dest.mkdir(parents=True,exist_ok=True) started=time.perf_counter() rng=np.random.default_rng(47) spin=[] for n in (4,6,8,10,12,14): states=np.arange(2**n,dtype=np.int64) z=1-2*((states[:,None]>>np.arange(n))&1) for h in (0.5,1.0,1.5): diagonal=-np.sum(z*np.roll(z,-1,axis=1),axis=1) rows=np.tile(states,n+1) cols=np.concatenate([states]+[states^(1<0 spin.append(item) s=sp.symbols("s") alpha,beta=sp.Rational(1,4),sp.Integer(1) P=sp.expand(((s-alpha)**2+beta**2)*((s-(1-alpha))**2+beta**2)) assert sp.expand(P-P.subs(s,1-s))==0 roots=[alpha+sp.I,alpha-sp.I,1-alpha+sp.I,1-alpha-sp.I] assert all(sp.simplify(P.subs(s,r))==0 for r in roots) classic=[dict(a0=a0,a1=a1,b0=b0,b1=b1,S=a0*b0+a0*b1+a1*b0-a1*b1) for a0,a1,b0,b1 in itertools.product((-1,1),repeat=4)] assert sorted(set(x["S"] for x in classic))==[-2,2] X=np.array([[0.,1.],[1.,0.]]) Z=np.diag([1.,-1.]) psi=np.array([1.,0.,0.,1.])/np.sqrt(2) angles=[] for degree in range(91): theta=np.deg2rad(degree) b0=np.cos(theta)*Z+np.sin(theta)*X b1=np.cos(theta)*Z-np.sin(theta)*X operator=np.kron(Z,b0+b1)+np.kron(X,b0-b1) value=float(psi@operator@psi) analytic=2*(np.cos(theta)+np.sin(theta)) assert abs(value-analytic)<1e-12 angles.append(dict(degrees=degree,S=value,localBound=2)) assert abs(angles[45]["S"]-2*np.sqrt(2))<1e-12 density=np.outer(psi,psi) reduced=density.reshape(2,2,2,2).trace(axis1=1,axis2=3) assert np.allclose(reduced,np.eye(2)/2) scaling=[dict(lambdaValue=v,L2Norm=v**(-0.5),L2Squared=v**(-1),L3Norm=1.,LInfinity=v,enstrophy=v) for v in (1.,2.,4.,8.,16.,32.,64.,128.,256.)] assert scaling[-1]["L2Squared"]scaling[0]["LInfinity"] result={ "schema":"xlvii.quantum-calculations.v1","computedOn":"2026-11-19", "scope":"Restricted calculations and proof diagnostics. No Millennium solution or independent validation of an announced solution.", "environment":{"python":platform.python_version(),"numpy":np.__version__,"scipy":scipy.__version__,"sympy":sp.__version__,"seed":47,"threads":1}, "spin":{"hamiltonian":"H = -J Σ Z_i Z_(i+1) - h Σ X_i; Pauli eigenvalues ±1; periodic chain; J=1.","method":"Sparse Lanczos eigensolver; two lowest algebraic eigenvalues; deterministic starting vectors; residuals retained.","rows":spin, "exactRestrictedResult":"For H0=-h Σ X_i with h>0, the commuting X_i have a joint ±1 eigenbasis. Energies are -hN+2hk for k=0,...,N. The unique ground state has k=0 and the spectral gap is exactly 2h for every finite N.", "perturbationResult":"For V=-J Σ Z_i Z_(i+1), ||V||≤N|J|. Weyl inequalities give Δ(H0+V)≥2h-2N|J|. This lower bound is uninformative when nonpositive; it does not prove the true gap closes.", "criticalReference":"At J=h=1, the periodic chain's lowest gap is 2 tan(π/(4N)), tending to π/(2N). The numerical spectrum is checked against this exact finite-size reference.", "limit":"These are one-dimensional spin systems at finite N, not a construction of four-dimensional continuum Yang–Mills. E1−E0 is the finite-chain first-level separation. For h<1 its decrease reflects the ordered phase’s nearly degenerate ground-state doublet; it is not the bulk excitation gap above the ground-state manifold. A finite positive separation alone gives no uniform infinite-volume or cutoff-removal bound. Numerical residuals certify approximate eigenpairs, not complete spectral ordering; the exact critical comparison is an additional check."}, "chsh":{"state":"|Φ+⟩=(|00⟩+|11⟩)/√2","settings":"A0=Z; A1=X; B0=cosθ Z+sinθ X; B1=cosθ Z−sinθ X","classicalAssignments":classic,"angles":angles,"maximum":float(2*np.sqrt(2)),"visibilityThreshold":float(1/np.sqrt(2)),"reducedDensityMatrix":reduced.tolist(),"scope":"Classical bound assumes a setting-independent shared hidden-variable distribution and local outcomes. Convex mixtures of deterministic assignments obey the bound. The modeled quantum correlations do not permit signalling and are not experimental observations. The visibility threshold applies only to ρ_v=v|Φ+⟩⟨Φ+|+(1−v)I/4 at θ=45°; S=2√2 v and violation occurs for v>1/√2. It is not a universal entanglement threshold."}, "riemann":{"polynomial":str(P),"symmetryDifference":"0","roots":[{"real":float(sp.re(r)),"imaginary":float(sp.im(r))} for r in roots],"claim":"Conjugation symmetry and reflection s→1−s do not alone force zeros onto Re(s)=1/2.","scope":"This polynomial is not the Riemann zeta function or its completion. It only refutes the proposed symmetry-only inference, not the Riemann hypothesis."}, "fluidScaling":{"equation":"u_λ(x,t)=λu(λx,λ²t); p_λ(x,t)=λ²p(λx,λ²t); f_λ(x,t)=λ³f(λx,λ²t)","normLaw":"||u_λ||_p=λ^(1−3/p)||u||_p on R³; ||u_λ||_∞=λ||u||_∞.","rows":scaling, "energy":"For smooth, decaying, divergence-free unforced solutions, (1/2)d||u||₂²/dt + ν||∇u||₂² = 0. With force, add ∫f·u on the right.", "scope":"The rows are scaling multipliers relative to each quantity’s own value at λ=1, not measured norms of a specified fluid. They show why finite kinetic energy alone cannot bound pointwise velocity in three dimensions. They are not a singular Navier–Stokes solution or an independent check of the 2026 forced construction."}, "checks":{"spinSpectra":len(spin),"criticalFormulaComparisons":6,"classicalAssignments":16,"quantumAngleComparisons":91,"symbolicSymmetry":True,"symbolicRoots":4,"reducedDensityCheck":True,"elapsedSeconds":round(time.perf_counter()-started,3)} } output=dest/"quantum-calculations.json";output.write_text(json.dumps(result,indent=2)+"\n") print(json.dumps({"path":str(output),"sha256":hashlib.sha256(output.read_bytes()).hexdigest(),"checks":result["checks"],"spin":spin,"polynomial":str(P),"CHSH":result["chsh"]["maximum"]}))