Skip to content

Commit

Permalink
Merge branch 'develop' into publish-gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Dec 31, 2024
2 parents cc87161 + 4781ee6 commit 61c6c67
Show file tree
Hide file tree
Showing 29 changed files with 535 additions and 189 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: check-added-large-files

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.8.4
hooks:
- id: ruff
args: [ "--fix", "--show-fixes" ]
Expand Down
6 changes: 6 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# Change Log

## Dec-31-2024: Version 0.7.0

- Maintenance release to follow the change of phonopy.
- `elph_selfen_band_stop` is estimated from el-DOS instead of `elph_nbands` for
transport mode in velph.

## Dec-9-2024: Version 0.6.6

- Collection of minor updates of velph command.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
copyright = "2024, Atsushi Togo"
author = "Atsushi Togo"

version = "0.6"
release = "0.6.5"
version = "0.7"
release = "0.7.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion doc/velph.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ source /opt/intel/oneapi/setvars.sh --config="/home/togo/.oneapi-config"
pe = "paris 24"

...
[vasp.phono3py.phonon.scheduler]
[vasp.phonopy.scheduler]
scheduler_template = '''#!/bin/bash
#QSUB2 core 192
#QSUB2 mpi 192
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ authors = [
]
requires-python = ">=3.9"
dependencies = [
"phonopy >= 2.33.4",
"phono3py >= 3.6.0",
"finufft",
"click",
Expand Down
9 changes: 1 addition & 8 deletions src/phelel/api_phelel.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,20 +495,13 @@ def _get_phonopy(
supercell_matrix: Optional[Union[int, float, Sequence, np.ndarray]],
primitive_matrix: Optional[Union[str, Sequence, np.ndarray]],
) -> Phonopy:
"""Return Phonopy instance.
Note
----
store_dense_svecs=False is necessary to be compatible with code in VASP.
"""
"""Return Phonopy instance."""
return Phonopy(
self._unitcell,
supercell_matrix=supercell_matrix,
primitive_matrix=primitive_matrix,
symprec=self._symprec,
is_symmetry=self._is_symmetry,
store_dense_svecs=False,
calculator=self._calculator,
log_level=self._log_level,
)
1 change: 0 additions & 1 deletion src/phelel/base/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/phelel/cui/__init__.py

This file was deleted.

14 changes: 11 additions & 3 deletions src/phelel/file_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import h5py
import numpy as np
from phonopy.structure.atoms import PhonopyAtoms, atom_data
from phonopy.structure.cells import Primitive
from phonopy.structure.cells import Primitive, dense_to_sparse_svecs
from phonopy.structure.symmetry import Symmetry

from phelel.base.Dij_qij import DDijQij
Expand Down Expand Up @@ -244,7 +244,7 @@ def _add_datasets(
w.create_dataset(
"primitive_masses", data=np.array(primitive.masses, dtype="double")
)
p2s_vectors, p2s_multiplicities = primitive.get_smallest_vectors()
p2s_vectors, p2s_multiplicities = _get_smallest_vectors(primitive)
w.create_dataset("p2s_map", data=np.array(primitive.p2s_map, dtype="int_"))
w.create_dataset("s2p_map", data=np.array(primitive.s2p_map, dtype="int_"))
w.create_dataset("shortest_vectors", data=np.array(p2s_vectors, dtype="double"))
Expand Down Expand Up @@ -308,7 +308,7 @@ def _add_datasets(
data=np.array(phonon_supercell_matrix, dtype="int_", order="C"),
)
if phonon_primitive is not None:
p2s_vectors, p2s_multiplicities = phonon_primitive.get_smallest_vectors()
p2s_vectors, p2s_multiplicities = _get_smallest_vectors(phonon_primitive)
w.create_dataset(
"phonon_p2s_map", data=np.array(phonon_primitive.p2s_map, dtype="int_")
)
Expand Down Expand Up @@ -375,3 +375,11 @@ def _add_datasets(
data=int(symmetry_dataset.uni_number),
dtype="int_",
)


def _get_smallest_vectors(primitive: Primitive) -> tuple[np.ndarray, np.ndarray]:
"""Get smallest vectors."""
svecs, multi = primitive.get_smallest_vectors()
if primitive.store_dense_svecs:
svecs, multi = dense_to_sparse_svecs(svecs, multi)
return svecs, multi
1 change: 0 additions & 1 deletion src/phelel/interface/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/phelel/interface/vasp/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/phelel/utils/__init__.py

This file was deleted.

5 changes: 3 additions & 2 deletions src/phelel/velph/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ def cmd_root():
from phelel.velph.cli.generate import cmd_generate # noqa F401
from phelel.velph.cli.hints import cmd_hints # noqa F401
from phelel.velph.cli.init import cmd_init # noqa F401
from phelel.velph.cli.phono3py import cmd_phono3py # noqa F401
from phelel.velph.cli.nac import cmd_nac # noqa F401
from phelel.velph.cli.phelel import cmd_phelel # noqa F401
from phelel.velph.cli.phonopy import cmd_phonopy # noqa F401
from phelel.velph.cli.phono3py import cmd_phono3py # noqa F401
from phelel.velph.cli.ph_bands import cmd_ph_bands # noqa F401
from phelel.velph.cli.relax import cmd_relax # noqa F401
from phelel.velph.cli.selfenergy import cmd_selfenergy # noqa F401
from phelel.velph.cli.phelel import cmd_phelel # noqa F401
from phelel.velph.cli.transport import cmd_transport # noqa F401
16 changes: 16 additions & 0 deletions src/phelel/velph/cli/init/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@
f"(phelel_nosym: bool, default={VelphInitParams.phelel_nosym})"
),
)
@click.option(
"--phonopy-max-num-atoms",
"phonopy_max_num_atoms",
nargs=1,
default=None,
type=int,
help=(
"Determine phonopy supercell dimension so that number of atoms in supercell "
"for phonopy is less than this number if different dimension from "
"that of electron-phonon (phelel) is expected. "
"(phonopy_max_num_atoms: int, "
f"default={VelphInitParams.phono3py_max_num_atoms})"
),
)
@click.option(
"--phono3py-max-num-atoms",
"phono3py_max_num_atoms",
Expand Down Expand Up @@ -246,6 +260,7 @@ def cmd_init(
max_num_atoms: Optional[int],
phelel_dir_name: str,
phelel_nosym: Optional[bool],
phonopy_max_num_atoms: Optional[int],
phono3py_max_num_atoms: Optional[int],
primitive_cell_choice: Optional[str],
project_folder: str,
Expand Down Expand Up @@ -287,6 +302,7 @@ def cmd_init(
"magmom": magmom,
"max_num_atoms": max_num_atoms,
"phelel_nosym": phelel_nosym,
"phonopy_max_num_atoms": phonopy_max_num_atoms,
"phono3py_max_num_atoms": phono3py_max_num_atoms,
"primitive_cell_choice": primitive_cell_choice,
"symmetrize_cell": symmetrize_cell,
Expand Down
Loading

0 comments on commit 61c6c67

Please sign in to comment.