From 3d5ca7c68fa8c23ce2faf18b23974ecf2abf22c4 Mon Sep 17 00:00:00 2001 From: Weiguo Jing Date: Fri, 4 Oct 2024 21:59:14 +0200 Subject: [PATCH 1/2] Added ionmov=22 to the list of valid ionmov values --- abipy/abio/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abipy/abio/inputs.py b/abipy/abio/inputs.py index 95623016a..48c8be0b7 100644 --- a/abipy/abio/inputs.py +++ b/abipy/abio/inputs.py @@ -633,7 +633,7 @@ def runlevel(self): runlevel.add(atags.BANDS) else: runlevel.add(atags.SCF) - elif ionmov in (2, 3, 4, 5, 7, 10, 11, 20): + elif ionmov in (2, 3, 4, 5, 7, 10, 11, 20, 22): runlevel.add(atags.RELAX) if optcell == 0: runlevel.add(atags.ION_RELAX) From e2874f998a90a0ba1e00542898df9f7255298eb2 Mon Sep 17 00:00:00 2001 From: Weiguo Jing Date: Thu, 22 May 2025 20:56:44 +0200 Subject: [PATCH 2/2] include r^2 coefficient in charge density --- abipy/ppcodes/oncv_parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/abipy/ppcodes/oncv_parser.py b/abipy/ppcodes/oncv_parser.py index 8b229de19..3e763bd01 100644 --- a/abipy/ppcodes/oncv_parser.py +++ b/abipy/ppcodes/oncv_parser.py @@ -516,10 +516,11 @@ def densities(self) -> dict[str, RadialFunction]: # !r 0.0100642 4.7238866 53.4149287 0.0000000 rho_data = self._grep("!r").data + # Note: all charges in ONCVPSP outputs do not include r^2 coefficients. return dict( - rhoV=RadialFunction("Valence charge", rho_data[:, 0], rho_data[:, 1]), - rhoC=RadialFunction("Core charge", rho_data[:, 0], rho_data[:, 2]), - rhoM=RadialFunction("Model charge", rho_data[:, 0], rho_data[:, 3]) + rhoV=RadialFunction("Valence charge", rho_data[:, 0], rho_data[:, 1]*rho_data[:, 0]**2), + rhoC=RadialFunction("Core charge", rho_data[:, 0], rho_data[:, 2]*rho_data[:, 0]**2), + rhoM=RadialFunction("Model charge", rho_data[:, 0], rho_data[:, 3]*rho_data[:, 0]**2) ) @cached_property