Example #1
0
def get_lcao_path():
    Ts = get_T()
    path = dict()
    with open("STRU", "r") as file:
        utils.search_sentence(file, "NUMERICAL_ORBITAL")
        for T in Ts:
            path[T] = os.path.abspath(skip_notes(file.readline()))
    return path
Example #2
0
def get_pseudo_path():
    Ts = get_T()
    path = dict()
    with open("STRU", "r") as file:
        utils.search_sentence(file, "ATOMIC_SPECIES")
        for T in Ts:
            path[T] = skip_notes(file.readline()).split()[-1]
    return path
Example #3
0
def get_T():
    ntype = int(get_input_dict()["ntype"])
    T = []
    with open("STRU", "r") as file:
        utils.search_sentence(file, "ATOMIC_SPECIES")
        for it in range(ntype):
            line = skip_notes(file.readline())
            T.append(line.split()[0])
    return T
Example #4
0
def get_R():
    Ts = get_T()
    R = dict()
    with open("STRU", "r") as file:
        for T in Ts:
            utils.search_sentence(file, T)
            utils.ignore_lines(file, 1)
            na = int(skip_notes(file.readline()).split()[0])
            R_tmp = []
            for i in range(na):
                R_tmp.append(
                    list(map(float,
                             skip_notes(file.readline()).split()[:3])))
            R[T] = np.array(R_tmp)
    return R
Example #5
0
def get_lattice():
    with open("STRU", "r") as file:
        utils.search_sentence(file, "LATTICE_CONSTANT")
        lat0 = float(skip_notes(file.readline()).split()[0])
    with open("STRU", "r") as file:
        utils.search_sentence(file, "LATTICE_VECTORS")
        lat_vec = []
        for i in range(3):
            lat_vec.append(
                list(map(float,
                         skip_notes(file.readline()).split())))
        lat_vec = np.array(lat_vec)
    with open("STRU", "r") as file:
        utils.search_sentence(file, "ATOMIC_POSITIONS")
        position = skip_notes(file.readline())
    return lat0, lat_vec, position
Example #6
0
def get_k():
    with open("KPT", "r") as file:
        utils.search_sentence(file, "Gamma")
        return list(map(int, skip_notes(file.readline()).split()[:3]))