back to table · edit · history · where entries came from · files · download
2507 bytes, as of the version from 2026-10-25 05:01 (current). Recorded here, not run.
"""Check the percolation sign convention and stored values of numberdb.org/T472.
Run alongside the table's generate.py, checks.py and check.py with SageMath:
sage -python repair_checks.py
Optional NumberDB API key on stdin (required while T472 is private).
This script reads the table and makes no changes.
Source for the physical side: Chen, Salas and Deng, SciPost Physics 16,
121 (2024), introduction, https://arxiv.org/html/2309.17210v2 .
The exact algebra checks the coordinate change, not the existence of a
three-dimensional critical exponent or the source's physical uncertainty.
"""
import os
import sys
key = sys.stdin.read().strip()
if key:
os.environ['NUMBERDB_API_KEY'] = key
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.version import version as sage_version
import json
import checks
from generate import CriticalExponents3D
ring = PolynomialRing(QQ, names=('pc', 'eps'))
pc, eps = ring.gens()
p = pc + eps
t = pc - p
assert t == -eps
assert -t == p - pc
assert t**2 == (p-pc)**2
# At pc = 1/2, use exact points on both sides as a sign/orientation control.
# These points test the coordinate convention; none is a stored table entry.
above = [QQ(1)/2 + QQ(1)/n for n in (4,8,16,32)]
coords = [QQ(1)/2 - p for p in above]
assert all(p > QQ(1)/2 for p in above)
assert all(a>b for a,b in zip(above,above[1:]))
assert all(t < 0 for t in coords)
assert all(a<b for a,b in zip(coords,coords[1:]))
assert QQ(1)/2 - (QQ(1)/2 - QQ(1)/4) > 0
# The original t = p-pc fails the required negative-t ordered-side control.
assert all(p-QQ(1)/2 > 0 for p in above)
doc = numberdb.table('T472')
assert checks.ends(doc['Numbers']['percolation']['beta']['number'])[0] > 0
result = {
'sage_version': sage_version,
'coordinate_change': 't=pc-p=-eps for p=pc+eps, eps>0',
'ordered_side': 'p decreases to pc from above iff t increases to zero from below',
'power_base_identity': '-t=p-pc',
'absolute_value_identity': '|t|=|p-pc|',
'opposite_side_control': 'passed',
'original_sign_rejected': True,
'percolation_beta_positive': True,
'stored_checks': checks.run(stored=True),
}
verification = CriticalExponents3D().verify(sample=None)
assert verification.ok, str(verification)
result['generator_verification'] = str(verification)
result['percolation_comment'] = doc['Comments']['percolation']
result['passed'] = True
print(json.dumps(result,indent=2))