Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added parsing of dielectric constant to ph calculator #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ase/io/espresso/_ph.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,21 @@ def read_ph_out(fd, *args, **kwargs):

job_done = False
walltime = None
epsilon = None

for line in flines:
for i, line in enumerate(flines):
if 'JOB DONE' in line:
job_done = True
if line.strip().startswith('PHONON'):
time_str = line.split()[-2]
walltime = time_to_float(time_str)
if 'Dielectric constant in cartesian axis' in line:
epsilon = np.array([x.split()[1:4] for x in flines[i + 2: i + 5]], dtype=float)

calc = EspressoPh(atoms=structure)
calc.results['job done'] = job_done
calc.results['walltime'] = walltime
calc.results['dielectric tensor'] = epsilon

structure.calc = calc

Expand Down