def _adj_inv_mat(dst, src): gpt.scale_per_coordinate(dst, src, adj_inv_kappa, 0)
]: g.message( f"Iteration {it}, group_policy = {group_policy.__name__}") src_unsplit = [g.lattice(x) for x in src] t0 = g.time() src_split = g.split(src, split_grid, None if it == 0 else cache, group_policy) t1 = g.time() g.unsplit(src_unsplit, src_split, None if it == 0 else cache, group_policy) t2 = g.time() g.message(f"Timing: {t1-t0}s for split and {t2-t1}s for unsplit") for i in range(len(src)): eps2 = g.norm2(src_unsplit[i] - src[i]) / g.norm2(src[i]) g.message(f"Split test {i} / {len(src)}: {eps2}") assert eps2 == 0.0 ################################################################################ # Test scale per coordinate ################################################################################ grid_rb = g.grid([12, 8, 8, 8, 8], g.double, g.redblack) a = rng.cnormal(g.vcolor(grid_rb)) b = g.lattice(a) sc = np.array([rng.cnormal() for i in range(12)], np.complex128) g.scale_per_coordinate(b, a, sc, 0) a_s = g.separate(a, 0) b_s = g.separate(b, 0) for i in range(len(a_s)): eps2 = g.norm2(sc[i] * a_s[i] - b_s[i]) / g.norm2(b_s[i]) assert eps2 < 1e-28
def _mat(dst, src): gpt.scale_per_coordinate(dst, src, kappa, 0)
def _negative_surface_projection(src): src = gpt((-1.0) * ImportUnphysicalFermion * src) dst = gpt.lattice(src) gpt.scale_per_coordinate(dst, src, c_s, 0) return dst