Skip to content

Commit

Permalink
Merge branch 'rc'
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Mar 6, 2023
2 parents b67269d + 0779fad commit ad4eb5b
Show file tree
Hide file tree
Showing 33 changed files with 687 additions and 217 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/phonopy-pytest-conda-openmp-site-cfg.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: phonopy test using conda-forge environment with openmp triggered by site.cfg

on: [push]
on:
push:
branches-ignore:
- publish-gh-pages
- master
- rc

jobs:
build-linux:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/phonopy-pytest-conda-openmp.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: phonopy test using conda-forge environment with openmp

on: [push]
on:
push:
branches-ignore:
- publish-gh-pages
- master
- rc

jobs:
build-linux:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/phonopy-pytest-conda.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: phonopy test using conda-forge environment

on: [push]
on:
push:
branches-ignore:
- publish-gh-pages
- master
- rc

jobs:
build-linux:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: publish phonopy gh-pages

on:
push:
branches: [publish-gh-pages]

jobs:
docs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
conda activate test
conda install --yes -c conda-forge python=${{ matrix.python-version }}
conda install --yes -c conda-forge sphinx-book-theme linkify-it-py "myst-parser=0.17.2" sphinxcontrib-bibtex
- name: Build
run: |
conda activate test
sphinx-build doc docs_build
- name: Deploy docs at develop branch
if: ${{ github.ref == 'refs/heads/publish-gh-pages' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs_build
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ repos:
- "--ignore=E203,W503,E501"

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
args:
- --line-length=88

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
rev: 6.3.0
hooks:
- id: pydocstyle

- repo: https://github.com/pycqa/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
4 changes: 4 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Change Log

## Mar-6-2023: Version 2.17.2

- Bug fixes of user interface.

## Dec-29-2022: Version 2.17.1

- Maintenance release.
Expand Down
24 changes: 22 additions & 2 deletions doc/citation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Citation of phonopy

If you have used phonopy, please cite the following article:
If you have used phonopy, please cite the following articles, which
indeed helps the phonopy project to continue:

- "First principles phonon calculations in materials science",

Expand All @@ -11,7 +12,7 @@ If you have used phonopy, please cite the following article:
http://dx.doi.org/10.1016/j.scriptamat.2015.07.021 (Open access)

```
@article {phonopy,
@article{phonopy,
Journal = {Scr. Mater.},
Year = {2015},
Title = {First principles phonon calculations in materials science},
Expand All @@ -22,6 +23,25 @@ If you have used phonopy, please cite the following article:
}
```

- "First-principles Phonon Calculations with Phonopy and Phono3py",

Atsushi Togo, J. Phys. Soc. Jpn., **92**, 012001-1-21 (2023)

https://doi.org/10.7566/JPSJ.92.012001 (Open access)

```
@article{phonopy-phono3py-JPSJ,
author = {Togo ,Atsushi},
title = {First-principles Phonon Calculations with Phonopy and Phono3py},
journal = {J. Phys. Soc. Jpn.},
volume = {92},
number = {1},
pages = {012001},
year = {2023},
doi = {10.7566/JPSJ.92.012001}
}
```

## Some papers where phonopy was used

### `phonopy-qha`: Thermal properties, quasi-harmonic approximation used for thermal expansion
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# The short X.Y version.
version = "2.17"
# The full version, including alpha/beta/rc tags.
release = "2.17.1"
release = "2.17.2"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
40 changes: 39 additions & 1 deletion doc/setting-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ distribution functions of phonon modes.

An example of configure file for 2x2x2 supercell of NaCl conventional unit cell
is as follows.

```
CREATE_DISPLACEMENTS = .TRUE.
DIM = 2 2 2
Expand All @@ -285,6 +286,7 @@ calculation, therefore a set of data for the phonon calculation is necessary. In
the following example, `POSCAR-unitcell` and `FORCE_SETS` of NaCl example is
copied to an empty directory. Running following command, `phonopy_disp.yaml` is
generated.

```bash
mkdir rd && cd rd
cp <somewhere>/example/NaCl/POSCAR-unitcell .
Expand All @@ -304,7 +306,7 @@ See also {ref}`f_force_sets_option` for creating `FORCE_SETS` from a series of
sueprcell calculation. Be careful that if `FORCE_SETS` exists in the current
directory, it will be overwritten by creating new `FORCE_SETS`.

To obtain force constants with random displacements and
To obtain force constants with random displacements and
respective forces, an external force constants calculator is necessary. See
{ref}`fc_calculator_tag`.

Expand All @@ -319,6 +321,7 @@ imaginary modes are treated as their absolute values.

Distribution of displacement distances may be visualized and checked by a python
script like below.

```python
import matplotlib.pyplot as plt
import numpy as np
Expand All @@ -333,6 +336,41 @@ plt.show()
:scale: 50
```

An example case using this tag is as follows.

1. Compute supercell force sets in the usual manner with small displacements.
Generate `FORCE_SETS` in the current directory.
2. Create new directory and copy `FORCE_SETS` and input crystal structure, or
`phonopy_disp.yaml` to the new directory, then change to the new directory.
3. Using `FORCE_SETS`, generate supercells with random displacements at finite
temperature using this tag. `phonopy_disp.yaml` is generated at this step.
Therefore, if `phonopy_disp.yaml` already exists in this directory, it is
overwritten. The required number of supercells depends on your system and
also the purpose. It can be 10, or can be 1000.
4. Using those supercells with random displacements, calculate supercell forces
with some force calculator with VASP, QE, etc.
5. Generate `FORCE_SETS` in this directory, which overwrites previous
`FORCE_SETS`.
6. Run the force constants calculation, e.g., with ALM. ALM does the fitting
force constants using the dataset of displacements and forces stored in
`FORCE_SETS`. Run also phonon calculation. This is done for example,

```
phonopy -v --alm --mesh 10 10 10 -p
```

or

```bash
phonopy -v --alm --writefc
phonopy --readfc --mesh 10 10 10 -p
```

Normally the force constants calculation with ALM will not take much time,
but for some cases it can be. So it may be a good idea to store force constants like the second example.

To perform above procedure more systematically, it is recommended to write a
python script using phonopy API.

(random_seed_tag)=

Expand Down
3 changes: 1 addition & 2 deletions example/Al2O3/Al2O3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@
frequencies = bs["frequencies"]
qpoints = bs["qpoints"]

for (qs_at_segments, dists_at_segments, freqs_at_segments) in zip(
for qs_at_segments, dists_at_segments, freqs_at_segments in zip(
qpoints, distances, frequencies
):

for q, d, f in zip(qs_at_segments, dists_at_segments, freqs_at_segments):
print("# %f %f %f" % tuple(q))
print(("%s " + "%f " * len(f)) % ((d,) + tuple(f)))

0 comments on commit ad4eb5b

Please sign in to comment.