def mk_src(geo): src = q.mk_point_src(geo, [0, 0, 0, 0]) grid = qg.mk_grid(geo) g_src = g.mspincolor(grid) g.create.point(g_src, [0, 0, 0, 0]) src1 = qg.qlat_from_gpt(g_src) src1 -= src assert src1.qnorm() == 0.0 return src
def test_src(xg): q.displayln_info(f"test_src: xg={xg}") # src_q = q.mk_point_src(geo, xg) # grid = qg.mk_grid(geo) g_src_gpt = g.mspincolor(grid) g.create.point(g_src_gpt, xg) src_g = qg.qlat_from_gpt(g_src_gpt) # src_diff = src_q.copy() src_diff -= src_g # q.displayln_info(src_q.qnorm(), src_g.qnorm(), src_diff.qnorm()) assert src_diff.qnorm() == 0
"b": 1.0, "c": 0.0, "Ls": 32, "boundary_phases": [1.0, 1.0, 1.0, 1.0], } gpt_gf = qg.gpt_from_qlat(gf) qm = g.qcd.fermion.mobius(gpt_gf, mobius_params) pc = g.qcd.fermion.preconditioner inv = g.algorithms.inverter cg = inv.cg({"eps": 1e-11, "maxiter": 10000}) slv_5d = inv.preconditioned(pc.eo2_ne(), cg) slv_qm = qm.propagator(slv_5d) ginv = qg.InverterGPT(inverter=slv_qm, timer=q.Timer("py:InverterGPT")) src_p = q.mk_point_src(geo, [0, 0, 0, 0]) src_r = q.Prop(geo) src_r.set_rand(rs.split("src_r")) for src in [src_p, src_r]: sol = qinv * src sol1 = ginv * src sol_diff = sol1.copy() sol_diff -= sol q.displayln_info(sol.qnorm(), sol1.qnorm(), sol_diff.qnorm()) q.timer_display()