Ejemplo n.º 1
0
def test_kp():
    box = [[2.715, 2.715, 0], [0, 2.715, 2.715], [2.715, 0, 2.715]]
    coords = [[0, 0, 0], [0.25, 0.25, 0.25]]
    elements = ["Si", "Si"]
    Si = Atoms(lattice_mat=box, coords=coords, elements=elements)
    lattice_mat = Si.lattice_mat
    kp = Kpoints3D().automatic_length_mesh(lattice_mat=lattice_mat, length=20)
    td = kp.to_dict()
    fd = Kpoints3D.from_dict(td)
    sym = kp.high_symm_path(Si)._path
    x, y = kp.interpolated_points(Si)
    kpath = generate_kpath(kpath=[[0, 0, 0], [0, 0.5, 0.5]], num_k=5)
    kps = generate_kgrid(grid=[5, 5, 5])
    new_file, filename = tempfile.mkstemp()
    kp.write_file(filename)
    sym = kp.high_symm_path(s1)._path
    sym = kp.high_symm_path(s2)._path
    sym = kp.high_symm_path(s3)._path
    sym = kp.high_symm_path(s4)._path
    sym = kp.high_symm_path(s5)._path
    sym = kp.high_symm_path(s6)._path
    sym = kp.high_symm_path(s7)._path
    assert (len(x), x[0][0], y[0], kpath[0][0], kps[0][0]) == (
        166,
        0,
        "\Gamma",
        0.0,
        0.0,
    )
    kp = Kpoints3D().kpath(atoms=Si, unique_kp_only=True)
Ejemplo n.º 2
0
 def from_dict(self, info={}):
     """Load the class from a dictionary."""
     return VaspJob(
         poscar=Poscar.from_dict(info["poscar"]),
         kpoints=Kpoints.from_dict(info["kpoints"]),
         incar=Incar.from_dict(info["incar"]),
         potcar=Potcar.from_dict(info["potcar"]),
         vasp_cmd=info["vasp_cmd"],
         copy_files=info["copy_files"],
         attempts=info["attempts"],
         output_file=info["output_file"],
         stderr_file=info["stderr_file"],
         jobname=info["jobname"],
     )