From 7c06301909a9bd964ce63570d9ae2fd1f2207772 Mon Sep 17 00:00:00 2001 From: ahmed abdelkawy Date: Tue, 14 Nov 2023 16:15:37 +0100 Subject: [PATCH 1/2] spx eigen values parser for mimization --- pyiron_atomistics/sphinx/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 00420af50..f84cd137c 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -2284,10 +2284,10 @@ def n_steps(self): def _parse_band(self, term): arr = np.loadtxt(re.findall(term, self.log_main, re.MULTILINE)) - shape = (-1, len(self.k_points), arr.shape[-1]) + shape = (-1, len(self.k_points), 1, arr.shape[-1]) if self.spin_enabled: - shape = (-1, 2, len(self.k_points), shape[-1]) - return arr.reshape(shape) + shape = (-1, len(self.k_points), 2, shape[-1]) + return arr.reshape(shape).transpose(0,2,1,3) def get_band_energy(self): return self._parse_band("final eig \[eV\]:(.*)$") From df2385f57eeb3be3a0b1fcc4090a2caf19c545ef Mon Sep 17 00:00:00 2001 From: ahmed abdelkawy Date: Tue, 14 Nov 2023 16:24:25 +0100 Subject: [PATCH 2/2] explaining comments --- pyiron_atomistics/sphinx/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index f84cd137c..ecf1a3093 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -2284,10 +2284,10 @@ def n_steps(self): def _parse_band(self, term): arr = np.loadtxt(re.findall(term, self.log_main, re.MULTILINE)) - shape = (-1, len(self.k_points), 1, arr.shape[-1]) + shape = (-1, len(self.k_points), 1, arr.shape[-1]) # 1 -> one spin channel for consistency and for the transpose to work if self.spin_enabled: - shape = (-1, len(self.k_points), 2, shape[-1]) - return arr.reshape(shape).transpose(0,2,1,3) + shape = (-1, len(self.k_points), 2, shape[-1]) #eigen values order in sphinx log: shape = (n_ionic_steps, n_kpoints, n_spin_channnels, n_bands) + return arr.reshape(shape).transpose(0,2,1,3) # the transpose to be consistent with other parsers and for get_density_of_states() to work def get_band_energy(self): return self._parse_band("final eig \[eV\]:(.*)$")