From f41434dc5281d61daa9b9e48784cc18c3500e255 Mon Sep 17 00:00:00 2001 From: Miki Bonacci Date: Tue, 13 Feb 2024 10:49:45 +0100 Subject: [PATCH] maybe fixed the seekpath update missing: specify the kpoint path in the inputs... only the bands_kpoints. --- aiida_yambo_wannier90/workflows/__init__.py | 31 +++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/aiida_yambo_wannier90/workflows/__init__.py b/aiida_yambo_wannier90/workflows/__init__.py index 5c28a5c..f3ecb67 100644 --- a/aiida_yambo_wannier90/workflows/__init__.py +++ b/aiida_yambo_wannier90/workflows/__init__.py @@ -627,6 +627,9 @@ def setup(self) -> None: # pylint: disable=inconsistent-return-statements self.ctx.current_structure = self.inputs.structure + self.ctx.current_kpoint_path = None + self.ctx.current_bands_kpoints = None + if "bands_kpoints" in self.inputs: self.ctx.current_bands_kpoints = self.inputs.bands_kpoints @@ -691,8 +694,16 @@ def run_seekpath(self): result = seekpath_structure_analysis(**args) self.ctx.current_structure = result["primitive_structure"] - self.ctx.current_bands_kpoints = result["explicit_kpoints"] - + #self.ctx.current_bands_kpoints = result["explicit_kpoints"] + + # Add `kpoint_path` for Wannier bands + self.ctx.current_kpoint_path = orm.Dict( + dict={ + "path": result["parameters"]["path"], + "point_coords": result["parameters"]["point_coords"], + } + ) + structure_formula = self.inputs.structure.get_formula() primitive_structure_formula = result["primitive_structure"].get_formula() self.report( @@ -1054,7 +1065,11 @@ def prepare_wannier90_pp_inputs(self) -> AttributeDict: )["wannier90"] inputs.wannier90.structure = self.ctx.current_structure - inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints + + if self.ctx.current_kpoint_path: + inputs.wannier90.kpoint_path = self.ctx.current_kpoint_path + if self.ctx.current_bands_kpoints: + inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints # Use commensurate kmesh if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90: @@ -1166,7 +1181,10 @@ def prepare_wannier90_inputs(self) -> AttributeDict: ) inputs.structure = self.ctx.current_structure - inputs.bands_kpoints = self.ctx.current_bands_kpoints + if self.ctx.current_kpoint_path: + inputs.kpoint_path = self.ctx.current_kpoint_path + if self.ctx.current_bands_kpoints: + inputs.bands_kpoints = self.ctx.current_bands_kpoints # Use commensurate kmesh if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90: @@ -1252,7 +1270,10 @@ def prepare_wannier90_qp_inputs(self) -> AttributeDict: ) inputs.wannier90.structure = self.ctx.current_structure - inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints + if self.ctx.current_kpoint_path: + inputs.wannier90.kpoint_path = self.ctx.current_kpoint_path + if self.ctx.current_bands_kpoints: + inputs.wannier90.bands_kpoints = self.ctx.current_bands_kpoints if self.ctx.kpoints_w90_input != self.ctx.kpoints_w90: set_kpoints(