From 0bd4a2c2d558faf7f041d2320aa629a6847451c9 Mon Sep 17 00:00:00 2001 From: skatnagallu Date: Wed, 4 Sep 2024 14:27:21 +0200 Subject: [PATCH 1/7] fixes the pattern in get_fermi to read negative fermi energies --- pyiron_atomistics/sphinx/output_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyiron_atomistics/sphinx/output_parser.py b/pyiron_atomistics/sphinx/output_parser.py index 603149adb..f95249716 100644 --- a/pyiron_atomistics/sphinx/output_parser.py +++ b/pyiron_atomistics/sphinx/output_parser.py @@ -405,7 +405,7 @@ def get_convergence(self): return convergence def get_fermi(self): - pattern = r"Fermi energy:\s+(\d+\.\d+)\s+eV" + pattern = r"Fermi energy:\s+(-?\d+\.\d+)\s+eV" return np.array(re.findall(pattern, self.log_main)).astype(float) @property From 7aff3a33b7d3ea004ea8894f03095fc19d6998c3 Mon Sep 17 00:00:00 2001 From: skatnagallu Date: Wed, 4 Sep 2024 14:35:42 +0200 Subject: [PATCH 2/7] Added print statements to explain possible reasons for convergence failure. --- pyiron_atomistics/sphinx/base.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 768425892..3bd2191b0 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -1486,7 +1486,21 @@ def convergence_check(self): """ # Checks if sufficient empty states are present if not self.nbands_convergence_check(): + print( + """ + Number of empty states might be too few. + Try changing to a higher number of empty states or use default values. + """ + ) return False + if not self.output.generic.dft.scf_convergence[-1]: + print( + """ + scf convergence not reached. Check residue and number of steps. + If residue is low, try increasing number of steps. + If residue is high, decreasing rho mixing might help. + """ + ) return self.output.generic.dft.scf_convergence[-1] def collect_logfiles(self): From 36ed1bf0fc9dafd9baacb457109db621b051f776 Mon Sep 17 00:00:00 2001 From: skatnagallu Date: Wed, 4 Sep 2024 14:44:12 +0200 Subject: [PATCH 3/7] changed set_empty_states default value for nonmag systems. Added warnings. --- pyiron_atomistics/sphinx/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 3bd2191b0..69f6bd866 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -1235,7 +1235,7 @@ def load_default_groups(self): if self._spin_enabled: self.input["EmptyStates"] = int(1.5 * len(self.structure) + 3) else: - self.input["EmptyStates"] = int(len(self.structure) + 3) + self.input["EmptyStates"] = int(0.5 * len(self.structure) + 3) if not self.input.sphinx.basis.read_only: self.load_basis_group() @@ -1606,8 +1606,11 @@ def check_setup(self): else: warnings.warn( "Number of empty states was not specified. Default: " - + "3+NIONS for non-magnetic systems" + + "3+NIONS*0.5 for non-magnetic systems" ) + else: + if self.input["EmptyStates"] < 0.5*int(len(self.structure) + 3): + warnings.warn("Number of empty states seem to be too low. Hopefully you know what you are doing.") return len(w) == 0 From 49d20fdde0be18abbe91ad580bcd61df64b3a639 Mon Sep 17 00:00:00 2001 From: skatnagallu Date: Fri, 6 Sep 2024 16:20:17 +0200 Subject: [PATCH 4/7] updated spin_enabled parsing in sphinx output parser --- .gitignore | 1 + pyiron_atomistics/sphinx/output_parser.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f0876989b..85507d4c5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ apidoc/ .ipynb_checkpoints/ test_times.dat core.* +.vscode/settings.json diff --git a/pyiron_atomistics/sphinx/output_parser.py b/pyiron_atomistics/sphinx/output_parser.py index f95249716..ea4ddcd18 100644 --- a/pyiron_atomistics/sphinx/output_parser.py +++ b/pyiron_atomistics/sphinx/output_parser.py @@ -243,7 +243,7 @@ def index_permutation(self): @property def spin_enabled(self): - return len(re.findall("The spin for the label", self.log_file)) > 0 + return len(re.findall("Spin moment:", self.log_file)) > 0 @property def log_main(self): From d9f532b92b321ca154eee074e258333b13f92d0d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:22:09 +0000 Subject: [PATCH 5/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyiron_atomistics/sphinx/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 69f6bd866..b488c89ba 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -1609,8 +1609,10 @@ def check_setup(self): + "3+NIONS*0.5 for non-magnetic systems" ) else: - if self.input["EmptyStates"] < 0.5*int(len(self.structure) + 3): - warnings.warn("Number of empty states seem to be too low. Hopefully you know what you are doing.") + if self.input["EmptyStates"] < 0.5 * int(len(self.structure) + 3): + warnings.warn( + "Number of empty states seem to be too low. Hopefully you know what you are doing." + ) return len(w) == 0 From 9468b3f0c95fb029a113b1a2cb36ef94111cdb69 Mon Sep 17 00:00:00 2001 From: Shyam <85609781+skatnagallu@users.noreply.github.com> Date: Sat, 7 Sep 2024 12:17:30 +0200 Subject: [PATCH 6/7] Update pyiron_atomistics/sphinx/base.py Co-authored-by: freyso <63301887+freyso@users.noreply.github.com> --- pyiron_atomistics/sphinx/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index b488c89ba..4018c65d6 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -1488,6 +1488,7 @@ def convergence_check(self): if not self.nbands_convergence_check(): print( """ + The highest orbital is not empty (has a finite occupation). Number of empty states might be too few. Try changing to a higher number of empty states or use default values. """ From 845ae4b0415561ce55a59d20943baab8873121da Mon Sep 17 00:00:00 2001 From: Shyam <85609781+skatnagallu@users.noreply.github.com> Date: Sat, 7 Sep 2024 12:17:38 +0200 Subject: [PATCH 7/7] Update pyiron_atomistics/sphinx/base.py Co-authored-by: freyso <63301887+freyso@users.noreply.github.com> --- pyiron_atomistics/sphinx/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 4018c65d6..83a59e031 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -1498,7 +1498,7 @@ def convergence_check(self): print( """ scf convergence not reached. Check residue and number of steps. - If residue is low, try increasing number of steps. + If residue goes down systematically, but slowly, try increasing number of steps. If residue is high, decreasing rho mixing might help. """ )