back to table · edit · history · where entries came from · files · download
3678 bytes, as of the version from 2026-11-26 09:56 (current). Recorded here, not run.
"""T815: Conformal weights of SU(N) WZW primary fields.
Requires SageMath (or passagemath with rational arithmetic) and numberdb.
sage -pip install numberdb
sage -python generate.py # verify the stored draft, read only
sage -python generate.py --export # save exact local checkpoint
sage -python generate.py --publish # fill the already authorized target
Configure your own NUMBERDB_API_KEY for private-draft reads/writes. Agent/model
provenance belongs in the invoking session, never in this reusable generator.
Publishing entries does not publish or offer the table. The default enumeration
has every integrable weight of 2 <= N <= 5 with binomial(k+N-1,N-1) <= 20.
Every division uses QQ: no floating-point precision or truncation is involved.
Long roots have squared length two; h is neither doubled nor reduced mod 1.
See Fuchs hep-th/9702194v1 (4.9) and Gaberdiel-Gopakumar 1011.2986v3 (B.94-96).
"""
import numberdb.sage as numberdb
# Modular installations need this initialization for rational coercions.
import sage.rings.real_mpfr
from sage.rings.rational_field import QQ
import argparse
import json
from math import comb
from pathlib import Path
def weak_compositions(total, length):
if length == 1:
yield (total,)
return
for first in range(total + 1):
for rest in weak_compositions(total - first, length - 1):
yield (first,) + rest
class ConformalWeights(numberdb.Generator):
table = 'T815'
parameters = ('N', 'k', 'weight')
type = 'Q'
rigour = 'exact'
digits = 100 # Exact type Q ignores this approximate-output setting.
def enumerate(self, max_N=5, max_sectors=20):
for N in range(2, max_N + 1):
k = 1
while comb(k + N - 1, N - 1) <= max_sectors:
for total in range(k + 1):
for labels in weak_compositions(total, N - 1):
yield {'N': N, 'k': k,
'weight': ','.join(str(a) for a in labels)}
k += 1
def value(self, params, digits=100):
N, k = int(params['N']), int(params['k'])
a = tuple(int(x) for x in str(params['weight']).split(','))
if N < 2 or k < 1 or len(a) != N - 1 or min(a) < 0 or sum(a) > k:
raise ValueError('Not an integrable SU(N) highest weight at level k')
pairing = sum((QQ(a[i-1]) * (QQ(min(i,j))-QQ(i*j)/QQ(N))
* QQ(a[j-1]+2)
for i in range(1,N) for j in range(1,N)), QQ(0))
h = pairing / QQ(2 * (N+k))
assert type(h).__name__ == 'Rational'
return {'number': h, 'param-latex': '$(' + ','.join(map(str,a)) + ')$'}
def export(path):
generator = ConformalWeights()
rows=[]
for params in generator.enumerate():
value=generator.value(params)
rows.append({'params':{k:str(v) for k,v in params.items()},
'number':str(value['number']),
'param-latex':value['param-latex'],
'native_type':type(value['number']).__name__})
Path(path).write_text(json.dumps(rows,indent=2)+'\n')
print('Wrote %d exact rational records to %s' % (len(rows),path))
if __name__ == '__main__':
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('--export',action='store_true')
parser.add_argument('--publish',action='store_true')
args=parser.parse_args()
if args.export:
export(Path(__file__).with_name('computed.json'))
elif args.publish:
print(ConformalWeights().publish())
else:
print(ConformalWeights().verify(sample=None))