コード例 #1
0
def test_locpot():
    # print (chg.is_spin_polarized(), chg.is_spin_orbit(), np.array(chg.chg).shape)
    assert (
        loc.is_spin_polarized(),
        loc.is_spin_orbit(),
        np.array(chg.chg).shape,
    ) == (False, False, (4, 56, 56, 56),)
    vac = loc.vac_potential()[0]
    assert round(vac, 2) == round(7.62302803577618, 2)

    td = loc.to_dict()
    fd = Locpot.from_dict(td)

    vac = loc.vac_potential(direction="Y")[0]
    assert round(vac, 2) == round(7.62302803577618, 2)

    vac = loc.vac_potential(direction="Z")[0]
    assert round(vac, 2) == round(7.62302803577618, 2)
コード例 #2
0
    "vasp",
    "SiOptb88",
    "SiOptb88",
    "MAIN-BAND-bulk@mp_149",
    "KPOINTS",
)


loc = Locpot(
    filename=os.path.join(
        os.path.dirname(__file__),
        "..",
        "..",
        "..",
        "..",
        "examples",
        "vasp",
        "SiOptb88",
        "SiOptb88",
        "MAIN-RELAX-bulk@mp_149",
        "LOCPOT",
    )
)


chg = Chgcar(
    filename=os.path.join(
        os.path.dirname(__file__),
        "..",
        "..",
        "..",