back to table · edit · history · where entries came from · files · download
3547 bytes, as of the version from 2026-11-27 09:27 (current). Recorded here, not run.
"""T823: congruent hyperball packing heights in three regular truncated cells.
Install numberdb in SageMath (sage -pip install numberdb). Run
sage -python generate.py # preview the 74 default arguments
sage -python generate.py --verify # reproduce every stored entry
sage -python generate.py --publish # fill the authorized private draft
NUMBERDB_API_KEY supplies access to the private draft. --publish writes entries;
it does not publish the draft or offer it for review. Provenance belongs in the
calling environment, never in this file.
The ordered characteristic chamber is [p,q,r]; (q,r) is (3,3), (3,4),
(4,3) for tetrahedron, cube, octahedron respectively. Curvature is -1.
The value is h, half the least distinct polar-truncation-plane distance,
not 2h. Szirmai arXiv:1405.0248v2 section 5 and arXiv:1803.04948v1
sections 3.1 and 3.3 give the inverse-Gram formula used here.
Arb encloses pi, trigonometric inputs, matrix inversion and the positive
inverse-hyperbolic branch. At 100 decimal digits use 512 working bits;
certification.json records the measured accuracy and decimal containment.
The independent check uses all pairs of Klein polar planes, not this inverse.
"""
import argparse
import os
import sys
import numberdb.sage as numberdb
# Modular Sage needs this module initialized before MatrixSpace's class test.
import sage.rings.polynomial.laurent_polynomial_ring
from sage.matrix.constructor import matrix
from sage.rings.real_arb import RealBallField
FAMILIES = {'tetrahedron': (3, 3, 7), 'cube': (3, 4, 7), 'octahedron': (4, 3, 5)}
class HyperballHeights(numberdb.Generator):
table = 'T823'
parameters = ('cell', 'p')
type = 'R'
digits = 100
rigour = 'proven'
def enumerate(self, limit=30):
for cell, (_, _, first) in FAMILIES.items():
for p in range(first, int(limit) + 1):
yield {'cell': cell, 'p': p}
def value(self, params, digits):
cell, p = str(params['cell']), int(params['p'])
q, r, first = FAMILIES[cell]
if str(params['p']).strip() != str(p) or p < first:
raise ValueError('p must be an integer in the natural tiling domain')
R = RealBallField(max(512, numberdb.bits(digits, losing=176)))
a, b, c = [(R.pi() / k).cos() for k in (p, q, r)]
G = matrix(R, [[1, -a, 0, 0], [-a, 1, -b, 0],
[0, -b, 1, -c], [0, 0, -c, 1]])
H = G.inverse()
if not (H[2, 2] < 0 and H[3, 3] > 0):
raise ArithmeticError('proper/outer vertex signs not certified')
u = 1 - H[2, 3]**2 / (H[2, 2] * H[3, 3])
if not u > 1:
raise ArithmeticError('positive acosh branch not certified')
h = u.sqrt().arccosh()
if not (h.is_finite() and h > 0 and h.accuracy() > numberdb.bits(digits)):
raise ArithmeticError('height enclosure is not sufficiently narrow')
return h
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--publish', action='store_true')
parser.add_argument('--verify', action='store_true')
args = parser.parse_args()
if os.environ.get('NUMBERDB_KEY_FROM_STDIN') == '1':
os.environ['NUMBERDB_API_KEY'] = sys.stdin.read().strip()
generator = HyperballHeights()
if args.publish or os.environ.get('NUMBERDB_PUBLISH') == '1':
print(generator.publish())
elif args.verify:
print(generator.verify(sample=None))
else:
print(generator.preview())