# Section 5: the crystalline states of the Ising arrays of the 2 designs of order 4 from Section 3, namely the points and planes of # the projective space PG(3,2), with parameters (15,7,3), and the projective plane of order 4, with parameters (21,5,1). A sign # vector b is crystalline when U_+ b is a sign vector, that is, when v m_i - (k+2) s = 2v or -2v for any block i, where m_i is the # sum of b over the block, and s is the sum of b. For U_- the condition is the same, with k-2 instead of k+2. For each such b we look at the smaller of the 2 sets where b is constant, and at # the numbers of its points lying on the blocks. Usage: python3 crystals.py import numpy as np from collections import Counter from designs import SETS, incidence, parameters def crystalline(v, D, sign=1): M = incidence(v, D).astype(np.int64) k = int(M[0].sum()) found = [] for lo in range(0, 1 << v, 1 << 16): x = np.arange(lo, min(lo + (1 << 16), 1 << v), dtype=np.int64) b = 1 - 2 * ((x[:, None] >> np.arange(v)) & 1) t = v * (b @ M.T) - (k + 2 * sign) * b.sum(1)[:, None] found.append(b[(np.abs(t) == 2 * v).all(1)]) return M, np.concatenate(found) if __name__ == "__main__": for name in ["PG(3,2) (15,7,3)", "plane of order 4 (21,5,1)"]: v, D = SETS[name] for sign, which in [(1, "U_+"), (-1, "U_-")]: M, states = crystalline(v, D, sign) print("%s, matrix %s: %d crystalline states" % (name, which, len(states))) types = Counter(); example = {} for b in states: small = np.nonzero(b == (1 if (b == 1).sum() < v / 2 else -1))[0] hits = tuple(sorted(Counter(M[:, small].sum(1).tolist()).items())) types[(len(small), hits)] += 1 example.setdefault((len(small), hits), small.tolist()) for (size, hits), count in sorted(types.items()): print(" %d states, in pairs b, -b, given by sets of %d points; (points on a block, number of blocks): %s; example %s" % (count, size, list(hits), example[(size, hits)]))