Does light charge the quons? › Files cited on the page › the trials
finer_grids_c6b_edge.py
# finer_grids_c6b_edge.py - POST HOC reading of trial 4, C6b (written after the run): why the 20-per-spacing grid gives a
# stiffness 2.5% low. Counts the finer quons within two of their widths of the ball's edge and the share of their charge inside it.
# Run: ~/aspden-review-venv/bin/python3 finer_grids_c6b_edge.py > finer_grids_c6b_edge_out.txt
import itertools, math, numpy as np
from scipy.special import erf
a=(3/(8*math.pi))**(1/3)
def p_ball(r0,a,s):
r0=np.maximum(r0,1e-12)
t1=0.5*(erf((a-r0)/(math.sqrt(2)*s))+erf((a+r0)/(math.sqrt(2)*s)))
t2=s/(r0*math.sqrt(2*math.pi))*(np.exp(-(a-r0)**2/(2*s*s))-np.exp(-(a+r0)**2/(2*s*s)))
return t1-t2
for N in (10,20,40):
ax=(np.arange(N)+0.5)/N; r=np.array(list(itertools.product(ax,ax,ax))); r=r-np.round(r)
d=np.linalg.norm(r,axis=1); r=d[d<a]; s=0.05/N
p=p_ball(r,a,s)
near=(a-r)<2*s
print(N,len(r),"sites within 2 widths of the edge:",near.sum(),"mean share inside:",p.mean(),
"their mean share:",p[near].mean() if near.any() else None,"loss from them:",(1-p[near]).sum()/len(r))