"""Checks on the twisted Platonic solids, as quantum graphs. For each of the 7 framed placements, this program builds the twisted vertex space V, writes the twisted adjacency d in the multimatrix basis of C(V), and checks with the 4 basic operations that d is undirected, real, simple, without loops, completely positive, regular and connected, with the classical spectrum. It also computes the restrictions of adjacency to the character spaces of the Klein group, the bipartitions of the 2 cubes, and the cell algebras B_0,B_1,B_2. """ import numpy as np from solids import (PLACEMENTS, placement, cell_centers, TwistedSpace, edge_sum, adjacency_lists, GAMMA, SIGMA, ONE, action) def blocks_string(sp): out = [] for x, orb, stab in sp.orbits: out.append({1: "M2", 2: "C2", 4: "C"}[len(stab)]) counts = {k: out.count(k) for k in ("C", "C2", "M2")} return counts def check_graph(label): pts, edges, faces = placement(label) sp = TwistedSpace(pts) adj = adjacency_lists(len(pts), edges) d = sp.matrix(edge_sum(sp, adj)) one = np.eye(sp.dim) q = len(adj[0]) res = {} res["undirected"] = np.allclose(sp.adjoint(d), d) res["real"] = np.allclose(sp.sharp(d), d) res["no loops"] = np.allclose(sp.hadamard(d, one), 0) res["simple"] = np.allclose(sp.hadamard(d, d), d) res["J unit"] = np.allclose(sp.hadamard(sp.J(), d), d) res["cp"] = sp.choi_positive(d) res["regular"] = np.allclose(d @ sp.coords(sp.function_one()), q * sp.coords(sp.function_one())) ev = np.sort(np.linalg.eigvals(d).real) A = np.zeros((len(pts), len(pts))) for i, j in edges: A[i, j] = A[j, i] = 1 res["classical spectrum"] = np.allclose(ev, np.sort(np.linalg.eigvalsh(A))) res["connected"] = int(np.sum(np.abs(ev - q) < 1e-8)) == 1 return sp, d, A, res def character_restrictions(label): """Spectra of the classical adjacency on the 3 nontrivial character spaces.""" pts, edges, faces = placement(label) n = len(pts) perm = action(pts) A = np.zeros((n, n)) for i, j in edges: A[i, j] = A[j, i] = 1 P = [] for g in range(4): M = np.zeros((n, n)) for x in range(n): M[perm[g][x], x] = 1 P.append(M) chars = [(1, 1, 1, 1), (1, 1, -1, -1), (1, -1, 1, -1), (1, -1, -1, 1)] out = [] for chi in chars[1:]: E = sum(c * Pg for c, Pg in zip(chi, P)) / 4 w, v = np.linalg.eigh(E) basis = v[:, w > 0.5] out.append(tuple(np.round(np.sort(np.linalg.eigvalsh(basis.T @ A @ basis)), 6))) return out def bipartition(sp, d, q): w, v = np.linalg.eig(d) k = np.argmin(np.abs(w + q)) if abs(w[k] + q) > 1e-8: return None F = sp.function(v[:, k]) F = F / np.sqrt(np.abs(np.trace(F[0] @ F[0].conj().T) / 2)) ph = np.trace(F[0]) if abs(np.trace(F[0])) > 1e-9 else F[0][np.unravel_index(np.argmax(np.abs(F[0])), (2, 2))] F = F * abs(ph) / ph unitary = all(np.allclose(F[x] @ F[x], ONE) and np.allclose(F[x], F[x].conj().T) for x in range(sp.n)) central = all(np.allclose(F[x], F[x][0, 0] * ONE) for x in range(sp.n)) return unitary, central def cell_algebras(label): pts, edges, faces = placement(label) out = [] for j, centers in enumerate(cell_centers(pts, edges, faces)): sp = TwistedSpace(centers) b = blocks_string(sp) c = b["C"] + 2 * b["C2"] out.append((len(centers), c, b["M2"], sp.nblocks)) return out def k_euler(label): """K-theoretic Euler characteristic of the open cells: free orbits give (-1)^j, orbits with stabilizer of order 2 give 2, 1, 2 in degrees 0, 1, 2.""" pts, edges, faces = placement(label) total = 0 for j, centers in enumerate(cell_centers(pts, edges, faces)): sp = TwistedSpace(centers) for x, orb, stab in sp.orbits: total += (-1) ** j if len(stab) == 1 else (2, 1, 2)[j] return total if __name__ == "__main__": print("== twisted vertex graphs ==") for label, _, _ in PLACEMENTS: sp, d, A, res = check_graph(label) print(f"{label:17s} C(V) blocks {blocks_string(sp)} all axioms: {all(res.values())} {res if not all(res.values()) else ''}") print("\n== character restrictions (spectra on the 3 nontrivial character spaces) ==") for label, _, _ in PLACEMENTS: r = character_restrictions(label) print(f"{label:17s} isospectral: {r[0] == r[1] == r[2]} dims {[len(x) for x in r]} traces {[round(sum(x), 6) for x in r]}") print("\n== bipartitions of the cubes (sign s = 2p-1 from the eigenvalue -3) ==") for label in ("cube", "other cube"): sp, d, A, res = check_graph(label) print(f"{label:17s} self-adjoint unitary, central: {bipartition(sp, d, 3)}") for label in ("tetrahedron", "octahedron", "icosahedron", "dodecahedron", "other octahedron"): sp, d, A, res = check_graph(label) q = int(round(np.sum(A[0]))) print(f"{label:17s} bipartite: {bipartition(sp, d, q) is not None}") print("\n== cell algebras B_j = C^{c_j} + M_2^{(n_j-c_j)/4} ==") for label, _, _ in PLACEMENTS: ca = cell_algebras(label) cs = [c for _, c, _, _ in ca] alt_dim = sum((-1) ** j * n for j, (n, _, _, _) in enumerate(ca)) alt_blocks = sum((-1) ** j * nb for j, (_, _, _, nb) in enumerate(ca)) print(f"{label:17s} (n_j,c_j) {[(n, c) for n, c, _, _ in ca]} sum c_j {sum(cs)} " f"alt dim {alt_dim} alt blocks {alt_blocks} = 5-3c_1/2: {alt_blocks == 5 - 3 * cs[1] / 2} " f"K-Euler {k_euler(label)}")