Skip to content

Commit 41a67a6

Browse files
committed
Fix(get_cutoffs_from_model_options) : fix rcut in powerlaw and varTang96.
For powerlaw and varTang96, the rs is not exactly the hard cutoff. so when extract the r_max for data. we have to use rs + 5 * w; but for other method just use rs.
1 parent 6563dda commit 41a67a6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

dptb/utils/argcheck.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,12 +1486,17 @@ def get_cutoffs_from_model_options(model_options):
14861486

14871487
if model_options.get("nnsk", None) is not None:
14881488
assert r_max is None, "r_max should not be provided in outside the nnsk for training nnsk model."
1489-
14901489
if model_options["nnsk"]["hopping"].get("rs",None) is not None:
1491-
r_max = model_options["nnsk"]["hopping"]["rs"]
1490+
if model_options["nnsk"]["hopping"]['method'] in ["powerlaw","varTang96"]:
1491+
r_max = model_options["nnsk"]["hopping"]["rs"] + 5 * model_options["nnsk"]["hopping"]["w"]
1492+
else:
1493+
r_max = model_options["nnsk"]["hopping"]["rs"]
14921494

14931495
if model_options["nnsk"]["onsite"].get("rs",None) is not None:
1494-
oer_max = model_options["nnsk"]["onsite"]["rs"]
1496+
if model_options["nnsk"]["onsite"]['method'] == "strain" and model_options["nnsk"]["hopping"]['method'] in ["powerlaw","varTang96"]:
1497+
oer_max = model_options["nnsk"]["onsite"]["rs"] + 5 * model_options["nnsk"]["onsite"]["w"]
1498+
else:
1499+
oer_max = model_options["nnsk"]["onsite"]["rs"]
14951500

14961501
elif model_options.get("dftbsk", None) is not None:
14971502
assert r_max is None, "r_max should not be provided in outside the dftbsk for training dftbsk model."

0 commit comments

Comments
 (0)