/
phonopy.py
61 lines (53 loc) · 1.98 KB
/
phonopy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import numpy as np
from phonopy.structure.atoms import PhonopyAtoms
import spglib as spg
from pyiron_base import Settings
__author__ = "Osamu Waseda"
__copyright__ = (
"Copyright 2020, Max-Planck-Institut für Eisenforschung GmbH - "
"Computational Materials Design (CM) Department"
)
__version__ = "1.0"
__maintainer__ = "Osamu Waseda"
__email__ = "waseda@mpie.de"
__status__ = "development"
__date__ = "Sep 1, 2018"
s = Settings()
def analyse_phonopy_equivalent_atoms(atoms, symprec=1e-5, angle_tolerance=-1.0):
"""
Args: (read phonopy.structure.spglib for more details)
symprec:
float: Symmetry search tolerance in the unit of length.
angle_tolerance:
float: Symmetry search tolerance in the unit of angle deg.
If the value is negative, an internally optimized routine
is used to judge symmetry.
"""
s.publication_add(publication())
positions = atoms.get_scaled_positions()
cell = atoms.cell
types = atoms.get_chemical_symbols()
types = list(types)
natom = len(types)
positions = np.reshape(np.array(positions), (natom, 3))
cell = np.reshape(np.array(cell), (3, 3))
unitcell = PhonopyAtoms(symbols=types, cell=cell, scaled_positions=positions)
ops = spg.get_symmetry(unitcell, symprec=symprec, angle_tolerance=angle_tolerance)
return ops["equivalent_atoms"]
def publication():
return {
"phonopy": {
"phonopy": {
"journal": "Scr. Mater.",
"year": "2015",
"title": "First principles phonon calculations in materials science",
"author": ["Togo, A", "Tanaka, I"],
"pages": "1--5",
"volume": "108",
"month": "Nov",
}
}
}