Exemple #1
0
    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)
Exemple #2
0
 def export_parity(self, o):
     gpt.set_cb(o, self.out_p)
     gpt.set_cb(o, self.out_np)
Exemple #3
0
# 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]

v = g.vcolor([0, 1, 0])
Exemple #4
0
        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)}
    rel. dev. = {rel_dev} -> test {'passed' if rel_dev <= 1e-15 else 'failed'}"""
    )
    assert rel_dev <= 1e-15

    # Meo^dag + Moe^dag = Dhop^dag
    mat.Dhop.adj_mat(ref, src)
    mat.Meooe.adj_mat(res_o, src_e)