From 867ac9480496119ea7c29b35d112206d4b2a5624 Mon Sep 17 00:00:00 2001 From: Edward Linscott Date: Mon, 6 May 2024 16:55:18 +0200 Subject: [PATCH] Added parsing of dielectric constant to ph calculator --- ase/io/espresso/_ph.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ase/io/espresso/_ph.py b/ase/io/espresso/_ph.py index 1754959e6..af6f96ce8 100644 --- a/ase/io/espresso/_ph.py +++ b/ase/io/espresso/_ph.py @@ -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