"""CPU-only verification test for Kronecker Coefficients""" print("Testing kronecker-cuda...") ct = [[1,1,1],[2,0,-1],[1,-1,1]] z_inv = [1/6, 1/2, 1/3] def g(i, j, k): return round(sum(z_inv[c] * ct[i][c] * ct[j][c] * ct[k][c] for c in range(3))) tests = [ (0,0,0, 1), # g([3],[3],[3]) = trivial (0,1,1, 1), # g([3],[2,1],[2,1]) (1,1,0, 1), # g([2,1],[2,1],[3]) (1,1,1, 1), # g([2,1],[2,1],[2,1]) (1,1,2, 1), # g([2,1],[2,1],[1,1,1]) = 1 (sign rep tensor) (2,2,0, 1), # g([1^3],[1^3],[3]) ] passed = 0 for i,j,k,expected in tests: got = g(i,j,k) ok = got == expected print(f" {'PASS' if ok else 'FAIL'}: g({i},{j},{k}) = {got} (expected {expected})") if ok: passed += 1 print(f"\n{passed}/{len(tests)} tests passed")