From bd9bfae256badd5e9bd3c3b79c89f00a87825cf5 Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Thu, 9 May 2024 13:08:59 +0200 Subject: [PATCH 1/5] Update top web page --- doc/index.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/index.md b/doc/index.md index 972ef08b..961ad249 100644 --- a/doc/index.md +++ b/doc/index.md @@ -23,7 +23,13 @@ Papers that may introduce phono3py: (arxiv ). - Introduction to phono3py application: - (open access). + (open access), + and phono3py inputs for 103 compounds found in Fig.17 + +- Implementation of phono3py: + (open access) + +A set of pre-calculated data for phono3py in ```{image} Si-kaccum.png :width: 20% From 6524c467dba473cfc291062b31a573123862db41 Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Sun, 26 May 2024 12:11:15 +0200 Subject: [PATCH 2/5] Implement new phono3py-yaml format for type2 dataset --- phono3py/interface/phono3py_yaml.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phono3py/interface/phono3py_yaml.py b/phono3py/interface/phono3py_yaml.py index dc86c5d2..2c3b3561 100644 --- a/phono3py/interface/phono3py_yaml.py +++ b/phono3py/interface/phono3py_yaml.py @@ -42,8 +42,8 @@ import numpy as np from phonopy.interface.phonopy_yaml import ( PhonopyYaml, - PhonopyYamlDumper, - PhonopyYamlLoader, + PhonopyYamlDumperBase, + PhonopyYamlLoaderBase, load_yaml, phonopy_yaml_property_factory, ) @@ -82,7 +82,7 @@ class Phono3pyYamlData: phonon_primitive: Optional[Primitive] = None -class Phono3pyYamlLoader(PhonopyYamlLoader): +class Phono3pyYamlLoader(PhonopyYamlLoaderBase): """Phono3pyYaml loader.""" def __init__( @@ -168,7 +168,7 @@ def _parse_fc3_dataset(self): self._data.dataset = dataset # This case should work only for v2.2 or later. - if self._data.dataset is None and "displacements" in self._yaml: + if self._data.dataset is None: self._data.dataset = self._get_dataset(self._data.supercell) def _parse_fc3_dataset_type1(self, natom): @@ -263,7 +263,7 @@ def _parse_fc3_dataset_type1_without_forces(self, data1, d2, disp2_id): return disp2_id -class Phono3pyYamlDumper(PhonopyYamlDumper): +class Phono3pyYamlDumper(PhonopyYamlDumperBase): """Phono3pyYaml dumper.""" _default_dumper_settings = { From 912137b571dd56d2718f38c922224238b9695957 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 22:55:02 +0000 Subject: [PATCH 3/5] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/Takishima/cmake-pre-commit-hooks: v1.9.5 → v1.9.6](https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.5...v1.9.6) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e8ee8feb..9a3a4942 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: name: isort (python) - repo: https://github.com/Takishima/cmake-pre-commit-hooks - rev: v1.9.5 + rev: v1.9.6 hooks: - id: clang-format args: From 46cc0a4a4b97e02e96a42abb43fb562d3ea556b3 Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Fri, 7 Jun 2024 08:03:22 +0900 Subject: [PATCH 4/5] Fix broken data structure related to phonon_supercell_matrix etc --- phono3py/cui/load.py | 32 ++++++++++++++++------------ phono3py/interface/phono3py_yaml.py | 33 ++++++++++++++--------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/phono3py/cui/load.py b/phono3py/cui/load.py index 820bb157..d57a8ac9 100644 --- a/phono3py/cui/load.py +++ b/phono3py/cui/load.py @@ -36,6 +36,7 @@ from __future__ import annotations import os +import pathlib from collections.abc import Sequence from typing import Optional, Union @@ -390,14 +391,13 @@ def set_dataset_and_force_constants( cutoff_pair_distance=cutoff_pair_distance, log_level=log_level, ) - if ph3py.phonon_supercell_matrix is not None: - read_fc["fc2"] = _set_dataset_phonon_dataset_or_fc2( - ph3py, - ph3py_yaml=ph3py_yaml, - fc2_filename=fc2_filename, - forces_fc2_filename=forces_fc2_filename, - log_level=log_level, - ) + read_fc["fc2"] = _set_dataset_phonon_dataset_or_fc2( + ph3py, + ph3py_yaml=ph3py_yaml, + fc2_filename=fc2_filename, + forces_fc2_filename=forces_fc2_filename, + log_level=log_level, + ) # Cases that dataset is in phono3py.yaml but not forces. if ph3py.dataset is None: @@ -487,14 +487,14 @@ def _set_dataset_or_fc3( cutoff_pair_distance, log_level, ) - elif os.path.isfile("fc3.hdf5"): + elif pathlib.Path("fc3.hdf5").exists(): fc3 = read_fc3_from_hdf5(filename="fc3.hdf5", p2s_map=p2s_map) _check_fc3_shape(ph3py, fc3) ph3py.fc3 = fc3 read_fc3 = True if log_level: print('fc3 was read from "fc3.hdf5".') - elif os.path.isfile("FORCES_FC3"): + elif pathlib.Path("FORCES_FC3").exists(): _set_dataset_for_fc3( ph3py, ph3py_yaml, @@ -544,14 +544,17 @@ def _set_dataset_phonon_dataset_or_fc2( "phonon_fc2", log_level, ) - elif os.path.isfile("fc2.hdf5"): + elif pathlib.Path("fc2.hdf5").exists(): fc2 = read_fc2_from_hdf5(filename="fc2.hdf5", p2s_map=phonon_p2s_map) _check_fc2_shape(ph3py, fc2) ph3py.fc2 = fc2 read_fc2 = True if log_level: print('fc2 was read from "fc2.hdf5".') - elif os.path.isfile("FORCES_FC2"): + elif ( + pathlib.Path("FORCES_FC2").exists() + and ph3py.phonon_supercell_matrix is not None + ): _set_dataset_for_fc2( ph3py, ph3py_yaml, @@ -583,7 +586,10 @@ def _set_dataset_phonon_dataset_or_fc2( "fc2", log_level, ) - elif os.path.isfile("FORCES_FC3"): + elif ( + pathlib.Path("FORCES_FC3").exists() + and ph3py.phonon_supercell_matrix is not None + ): # suppose fc3.hdf5 is read but fc2.hdf5 doesn't exist. _set_dataset_for_fc2( ph3py, diff --git a/phono3py/interface/phono3py_yaml.py b/phono3py/interface/phono3py_yaml.py index 2c3b3561..faf1aabb 100644 --- a/phono3py/interface/phono3py_yaml.py +++ b/phono3py/interface/phono3py_yaml.py @@ -115,18 +115,18 @@ def _parse_all_cells(self): """ super()._parse_all_cells() - if "phonon_primitive_cell" in self._yaml: - self._data.phonon_primitive = self._parse_cell( - self._yaml["phonon_primitive_cell"] - ) - if "phonon_supercell" in self._yaml: - self._data.phonon_supercell = self._parse_cell( - self._yaml["phonon_supercell"] - ) if "phonon_supercell_matrix" in self._yaml: self._data.phonon_supercell_matrix = np.array( self._yaml["phonon_supercell_matrix"], dtype="intc", order="C" ) + if "phonon_primitive_cell" in self._yaml: + self._data.phonon_primitive = self._parse_cell( + self._yaml["phonon_primitive_cell"] + ) + if "phonon_supercell" in self._yaml: + self._data.phonon_supercell = self._parse_cell( + self._yaml["phonon_supercell"] + ) def _parse_dataset(self): """Parse phonon_dataset. @@ -137,8 +137,6 @@ def _parse_dataset(self): self._data.phonon_dataset = self._get_dataset( self._data.phonon_supercell, key_prefix="phonon_" ) - if self._data.phonon_dataset is None: - self._data.phonon_dataset = self._get_dataset(self._data.phonon_supercell) def _parse_fc3_dataset(self): """Parse force dataset for fc3. @@ -286,13 +284,14 @@ def _cell_info_yaml_lines(self): """ lines = super()._cell_info_yaml_lines() - lines += self._supercell_matrix_yaml_lines( - self._data.phonon_supercell_matrix, "phonon_supercell_matrix" - ) - lines += self._primitive_yaml_lines( - self._data.phonon_primitive, "phonon_primitive_cell" - ) - lines += self._phonon_supercell_yaml_lines() + if self._data.phonon_supercell_matrix is not None: + lines += self._supercell_matrix_yaml_lines( + self._data.phonon_supercell_matrix, "phonon_supercell_matrix" + ) + lines += self._primitive_yaml_lines( + self._data.phonon_primitive, "phonon_primitive_cell" + ) + lines += self._phonon_supercell_yaml_lines() return lines def _phonon_supercell_yaml_lines(self): From c88554b7a3fc57008d9a317db333bd2140910c36 Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Fri, 7 Jun 2024 08:19:01 +0900 Subject: [PATCH 5/5] Set version v3.0.4 --- doc/changelog.md | 4 ++++ doc/conf.py | 2 +- phono3py/version.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/changelog.md b/doc/changelog.md index 3bd42254..df2f26b7 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -2,6 +2,10 @@ # Change Log +## Jun-7-2024: Version 3.0.4 + +- Bug fix when handling different supercell size of fc2 than that of fc3. + ## May-4-2024: Version 3.0.3 - Release to follow the update of phonopy. diff --git a/doc/conf.py b/doc/conf.py index e4c57601..983941ac 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -60,7 +60,7 @@ # The short X.Y version. version = "3.0" # The full version, including alpha/beta/rc tags. -release = "3.0.3" +release = "3.0.4" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/phono3py/version.py b/phono3py/version.py index 3426bb80..a334d571 100644 --- a/phono3py/version.py +++ b/phono3py/version.py @@ -34,4 +34,4 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -__version__ = "3.0.3" +__version__ = "3.0.4"