def __call__(self, src_sc, dst_sc): self.matrix.ImportPhysicalFermionSource(src_sc, self.ftmp) gpt.pick_cb(gpt.even,self.ie,self.ftmp) gpt.pick_cb(gpt.odd,self.io,self.ftmp) # D^-1 = L NDagN^-1 R + S self.matrix.R(self.ie, self.io, self.t1) self.t2[:]=0 self.t2.checkerboard(gpt.even) self.inverter(lambda i,o: self.matrix.NDagN(i,o),self.t1,self.t2) self.matrix.L(self.t2, self.oe, self.oo) self.matrix.S(self.ie,self.io,self.t1,self.t2) self.oe += self.t1 self.oo += self.t2 gpt.set_cb(self.ftmp,self.oe) gpt.set_cb(self.ftmp,self.oo) self.matrix.ExportPhysicalFermionSolution(self.ftmp,dst_sc)
def import_parity(self, i): gpt.pick_cb(self.parity, self.in_p, i) gpt.pick_cb(self.parity.inv(), self.in_np, i)
g.meminfo() # Slice x = g.sum(Uf[0]) print(x) grid = g.grid([4, 4, 4, 4], g.single) gr = g.complex(grid) gr[0, 0, 0, 0] = 2 gr[1, 0, 0, 0] = 3 gride = g.grid([4, 4, 4, 4], g.single, g.redblack) gre = g.complex(gride) g.pick_cb(g.even, gre, gr) gre[2, 0, 0, 0] = 4 g.set_cb(gr, gre) g.meminfo() print(gre) gre.checkerboard(g.odd) print(gre) sys.exit(0) # Calculate U^\dag U u = U[0][0, 1, 2, 3]
vec_full(), vec_full(), vec_full(), ) src_e, src_o, tmp_e, tmp_o, tmp2_e, tmp2_o, res_e, res_o = ( vec_half(), vec_half(), vec_half(), vec_half(), vec_half(), vec_half(), vec_half(), vec_half(), ) rng.cnormal(src) g.pick_cb(g.even, src_e, src) g.pick_cb(g.odd, src_o, src) # Meo + Moe = Dhop mat.Dhop.mat(ref, src) mat.Meooe.mat(res_o, src_e) mat.Meooe.mat(res_e, src_o) g.set_cb(res, res_e) g.set_cb(res, res_o) rel_dev = g.norm2(ref - res) / g.norm2(ref) g.message( f""" Test: Meo + Moe = Dhop src = {g.norm2(src)} ref = {g.norm2(ref)} res = {g.norm2(res)}