# For BH(8,8) matrices K: bistochastic Butson form over mu_{2^a} for SOME a >= 3 <=> exact cover of # 8 columns + 8 rows by supports (cols(x), rows(Kx)), x in X_K = {x in (mu_8 U 0)^8 : Kx in (0 U 2(1+i)mu_8)^8}. import numpy as np, itertools, sys, time L=[l.strip() for l in open('bh88.txt') if l.strip()] targets=[int(t) for t in sys.argv[1].split(',')] if len(sys.argv)>1 else range(1,len(L)+1) z=np.exp(2j*np.pi/8); vals=np.r_[0,z**np.arange(8)] half=np.array(list(itertools.product(range(9),repeat=4))) HV=vals[half] w=1<>i&1] for i in range(items)] def rec(cov): if cov==FULL: return True best=None for i in range(items): if not cov>>i&1: c=[s for s in by[i] if s&cov==0] if best is None or len(c)1e-9)*w).sum()) if cm: sets.add(cm|(rm<<8)) c=covers(sorted(sets),16) out.append((t,c)); print(f"BH(8,8) #{t}: {len(sets)} supports, bistochastic over some mu_(2^a): {c}",flush=True) print("NO 2-power bistochastic form:",[t for t,c in out if not c])