Does light charge the quons? › Files cited on the page › check_lattices_fable/
compare_rows.py
"""Compare my_lattices_out.txt (the tenth reviewer's reproduction) with run 3's cubic_lattices_out.txt, row by row.
Run: ~/aspden-review-venv/bin/python3 compare_rows.py > compare_rows_out.txt"""
import re
def rows(path, mine):
out = {}; kind = None
for line in open(path):
m = re.match(r"^ (sc|bcc|fcc) \(stability needs", line)
if m: kind = m.group(1)
if mine:
m = re.match(r"\s+(sc|bcc|fcc)\s+(\d+) a=([\d.]+) (.+?)\s+n=\s*(\d+) K=\(([+-][\d.]+),([+-][\d.]+),([+-][\d.]+)\).*share ([\d.]+) (pass|fail)", line)
if m: out[(m.group(1), int(m.group(2)))] = (m.group(4).strip(), int(m.group(5)), tuple(float(m.group(i)) for i in (6, 7, 8)), float(m.group(9)), m.group(10))
else:
m = re.match(r"\s+(\d+)\s+(\d\.\d{4})\s+(.+?)\s+(\d+)\s+([+-]\d+\.\d{4}) ([+-]\d+\.\d{4}) ([+-]\d+\.\d{4})\s+(\d\.\d{3})\s+(ok|MISS)\s+(pass|fail)", line)
if m and kind: out[(kind, int(m.group(1)))] = (m.group(3).strip(), int(m.group(4)), tuple(float(m.group(i)) for i in (5, 6, 7)), float(m.group(8)), m.group(10))
return out
A = rows("my_lattices_out.txt", True); R = rows("../cubic_lattices_out.txt", False)
print(len(A), "of my rows,", len(R), "of run 3's")
print("largest |delta hold eigenvalue| (printed digits):", max(max(abs(a - b) for a, b in zip(A[k][2], R[k][2])) for k in R))
print("share diffs > 0.0015:", [(k, A[k][3], R[k][3]) for k in R if abs(A[k][3] - R[k][3]) > 0.0015])
print("verdict diffs:", [k for k in R if A[k][4] != R[k][4]]); print("n diffs:", [k for k in R if A[k][1] != R[k][1]])
print("site-name diffs:", [(k, A[k][0], R[k][0]) for k in R if A[k][0] != R[k][0]])