From 2bc571d3df486f74cd166fc404f5b4635c000b8a Mon Sep 17 00:00:00 2001 From: Raynol Dsouza Date: Fri, 26 Apr 2024 13:56:46 +0200 Subject: [PATCH 1/3] additional inputs for phonopy --- pyiron_atomistics/atomistics/master/phonopy.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pyiron_atomistics/atomistics/master/phonopy.py b/pyiron_atomistics/atomistics/master/phonopy.py index e164f076a..7210d2675 100644 --- a/pyiron_atomistics/atomistics/master/phonopy.py +++ b/pyiron_atomistics/atomistics/master/phonopy.py @@ -144,6 +144,15 @@ def __init__(self, project, job_name): "'distance' parameter, i.e., all atoms in supercell are displaced with the same displacement distance in " "direct space. (Copied directly from phonopy docs. Requires the alm package to work.)", ) + self.input["eigenvectors"] = ( + False, + "whether or not to save the eigenvectors of the dynamical matrix at each qpoint. WARNING: " + "Setting this to True can result in a very large .h5 file (~GBs) or hit memory limits. Only set to True if you know what you are doing!", + ) + self.input["tetrahedron_method"] = ( + True, + "use the tetrahedron method for the BZ integration. If set to False, the Gaussian smearing method is used.", + ) self.phonopy = None self._job_generator = PhonopyJobGenerator(self) @@ -264,9 +273,9 @@ def collect_output(self): self.phonopy.produce_force_constants( fc_calculator=None if self.input["number_of_snapshots"] is None else "alm" ) - self.phonopy.run_mesh(mesh=[self.input["dos_mesh"]] * 3) + self.phonopy.run_mesh(mesh=[self.input["dos_mesh"]] * 3, with_eigenvectors=self.input["eigenvectors"]) mesh_dict = self.phonopy.get_mesh_dict() - self.phonopy.run_total_dos() + self.phonopy.run_total_dos(use_tetrahedron_method=self.input["tetrahedron_method"]) dos_dict = self.phonopy.get_total_dos_dict() self.to_hdf() From 93082c729b39f496b41d1fe78bbaa9e09ff4cbf8 Mon Sep 17 00:00:00 2001 From: Raynol Dsouza Date: Wed, 15 May 2024 10:54:53 +0200 Subject: [PATCH 2/3] add additional documentation --- pyiron_atomistics/atomistics/master/phonopy.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyiron_atomistics/atomistics/master/phonopy.py b/pyiron_atomistics/atomistics/master/phonopy.py index 7210d2675..337f84dad 100644 --- a/pyiron_atomistics/atomistics/master/phonopy.py +++ b/pyiron_atomistics/atomistics/master/phonopy.py @@ -146,12 +146,18 @@ def __init__(self, project, job_name): ) self.input["eigenvectors"] = ( False, - "whether or not to save the eigenvectors of the dynamical matrix at each qpoint. WARNING: " - "Setting this to True can result in a very large .h5 file (~GBs) or hit memory limits. Only set to True if you know what you are doing!", + "whether or not to save the eigenvectors of the dynamical matrix at each irreducible qpoint, " + "which are necessary to obtain the projected DOS (which can be done with a post-processing script). " + "They are accessed using job.phonopy.get_mesh_dict()['eigenvectors']. WARNING: " + "Setting this to True can result in a very large .h5 file (~GBs) or hit memory limits. " + "Only set to True if you know what you are doing!", ) self.input["tetrahedron_method"] = ( True, - "use the tetrahedron method for the BZ integration. If set to False, the Gaussian smearing method is used.", + "use the tetrahedron method for the BZ integration. " + "If set to False, the Gaussian smearing method is used. " + "The 'sigma' value for the smearing is determined internally by phonopy. " + "See https://phonopy.github.io/phonopy/setting-tags.html#sigma .", ) self.phonopy = None From 1e35ef3d1486e4b024ea1f727a59c9f1a6e3622e Mon Sep 17 00:00:00 2001 From: pyiron-runner Date: Wed, 15 May 2024 10:51:55 +0000 Subject: [PATCH 3/3] Format black --- pyiron_atomistics/atomistics/master/phonopy.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pyiron_atomistics/atomistics/master/phonopy.py b/pyiron_atomistics/atomistics/master/phonopy.py index 337f84dad..5c3a7a091 100644 --- a/pyiron_atomistics/atomistics/master/phonopy.py +++ b/pyiron_atomistics/atomistics/master/phonopy.py @@ -145,7 +145,7 @@ def __init__(self, project, job_name): "direct space. (Copied directly from phonopy docs. Requires the alm package to work.)", ) self.input["eigenvectors"] = ( - False, + False, "whether or not to save the eigenvectors of the dynamical matrix at each irreducible qpoint, " "which are necessary to obtain the projected DOS (which can be done with a post-processing script). " "They are accessed using job.phonopy.get_mesh_dict()['eigenvectors']. WARNING: " @@ -153,7 +153,7 @@ def __init__(self, project, job_name): "Only set to True if you know what you are doing!", ) self.input["tetrahedron_method"] = ( - True, + True, "use the tetrahedron method for the BZ integration. " "If set to False, the Gaussian smearing method is used. " "The 'sigma' value for the smearing is determined internally by phonopy. " @@ -279,9 +279,14 @@ def collect_output(self): self.phonopy.produce_force_constants( fc_calculator=None if self.input["number_of_snapshots"] is None else "alm" ) - self.phonopy.run_mesh(mesh=[self.input["dos_mesh"]] * 3, with_eigenvectors=self.input["eigenvectors"]) + self.phonopy.run_mesh( + mesh=[self.input["dos_mesh"]] * 3, + with_eigenvectors=self.input["eigenvectors"], + ) mesh_dict = self.phonopy.get_mesh_dict() - self.phonopy.run_total_dos(use_tetrahedron_method=self.input["tetrahedron_method"]) + self.phonopy.run_total_dos( + use_tetrahedron_method=self.input["tetrahedron_method"] + ) dos_dict = self.phonopy.get_total_dos_dict() self.to_hdf()