Beispiel #1
0
def get_pp(mydf, kpts=None):
    if kpts is None:
        kpts_lst = numpy.zeros((1, 3))
    else:
        kpts_lst = numpy.reshape(kpts, (-1, 3))

    mydf = _sync_mydf(mydf)
    vpp = aft.get_pp_loc_part1(mydf, kpts_lst)
    vpp = mpi.reduce(lib.asarray(vpp))

    if rank == 0:
        vloc2 = pseudo.pp_int.get_pp_loc_part2(mydf.cell, kpts_lst)
        vppnl = pseudo.pp_int.get_pp_nl(mydf.cell, kpts_lst)
        for k in range(len(kpts_lst)):
            vpp[k] += numpy.asarray(vppnl[k] + vloc2[k], dtype=vpp.dtype)

        if kpts is None or numpy.shape(kpts) == (3, ):
            vpp = vpp[0]
        return vpp
Beispiel #2
0
def get_pp(mydf, kpts=None):
    if kpts is None:
        kpts_lst = numpy.zeros((1,3))
    else:
        kpts_lst = numpy.reshape(kpts, (-1,3))

    mydf = _sync_mydf(mydf)
    vpp = aft.get_pp_loc_part1(mydf, kpts_lst)
    vpp = mpi.reduce(lib.asarray(vpp))

    if rank == 0:
        vloc2 = pseudo.pp_int.get_pp_loc_part2(mydf.cell, kpts_lst)
        vppnl = pseudo.pp_int.get_pp_nl(mydf.cell, kpts_lst)
        for k in range(len(kpts_lst)):
            vpp[k] += numpy.asarray(vppnl[k] + vloc2[k], dtype=vpp.dtype)

        if kpts is None or numpy.shape(kpts) == (3,):
            vpp = vpp[0]
        return vpp
Beispiel #3
0
 def test_get_pp_loc_part1_high_cost(self):
     df = aft.AFTDF(cell)
     v1 = aft.get_pp_loc_part1(df, kpts[0])
     self.assertAlmostEqual(finger(v1),
                            (-6.0893491060887159 + 0.19823828749533859j), 8)
Beispiel #4
0
def get_pp_loc_part1(mydf, kpts=None):
    mydf = _sync_mydf(mydf)
    vne = aft.get_pp_loc_part1(mydf, kpts)
    return mpi.reduce(vne)
Beispiel #5
0
def get_pp_loc_part1(mydf, kpts=None):
    mydf = _sync_mydf(mydf)
    vne = aft.get_pp_loc_part1(mydf, kpts)
    return mpi.reduce(vne)
Beispiel #6
0
 def test_get_pp_loc_part1_high_cost(self):
     df = aft.AFTDF(cell)
     v1 = aft.get_pp_loc_part1(df, kpts[0])
     self.assertAlmostEqual(finger(v1), (-6.0893491060887159+0.19823828749533859j), 8)