Skip to content

Commit

Permalink
Merge branch 'develop' into rc
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Aug 6, 2024
2 parents 9e70ecd + f937c9f commit 7804f2d
Show file tree
Hide file tree
Showing 26 changed files with 520 additions and 145 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/phono3py-pytest-conda-mkl-phphmtblas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
conda activate test
conda install --yes python=${{ matrix.python-version }}
conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler
conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest spglib alm cmake c-compiler cxx-compiler
- name: Install symfc develop branch
run: |
conda activate test
Expand All @@ -45,8 +45,5 @@ jobs:
PHPHCALC_USE_MTBLAS=ON pip install -e . -vvv
- name: Run pytest
run: |
pytest -v --cov=./ --cov-report=xml test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
conda activate test
pytest -v test
9 changes: 3 additions & 6 deletions .github/workflows/phono3py-pytest-conda-mkl-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
conda activate test
conda install --yes python=${{ matrix.python-version }}
conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler
conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest spglib alm cmake c-compiler cxx-compiler
- name: Install symfc develop branch
run: |
conda activate test
Expand All @@ -45,8 +45,5 @@ jobs:
pip install -e . -vvv
- name: Run pytest
run: |
pytest --v2 -v --cov=./ --cov-report=xml test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
conda activate test
pytest --v2 -v test
1 change: 1 addition & 0 deletions .github/workflows/phono3py-pytest-conda-mkl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
pip install -e . -vvv
- name: Run pytest
run: |
conda activate test
pytest -v --cov=./ --cov-report=xml test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/phono3py-pytest-conda-numpy2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
conda activate test
conda install --yes python=${{ matrix.python-version }}
conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py "numpy=2" scipy pytest codecov pytest-cov cmake c-compiler cxx-compiler
conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py "numpy=2" scipy pytest cmake c-compiler cxx-compiler
- name: Install spglib develop branch
run: |
conda activate test
Expand Down Expand Up @@ -52,8 +52,5 @@ jobs:
pip install -e . -vvv
- name: Run pytest
run: |
conda activate test
pytest -v test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
9 changes: 3 additions & 6 deletions .github/workflows/phono3py-pytest-conda-phphmtblas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
conda activate test
conda install --yes python=${{ matrix.python-version }}
conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler
conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest spglib alm cmake c-compiler cxx-compiler
- name: Install symfc develop branch
run: |
conda activate test
Expand All @@ -45,8 +45,5 @@ jobs:
PHPHCALC_USE_MTBLAS=ON pip install -e . -vvv
- name: Run pytest
run: |
pytest -v --cov=./ --cov-report=xml test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
conda activate test
pytest -v test
9 changes: 3 additions & 6 deletions .github/workflows/phono3py-pytest-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
conda activate test
conda install --yes python=${{ matrix.python-version }}
conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler
conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest spglib alm cmake c-compiler cxx-compiler
- name: Install phonopy develop branch
run: |
conda activate test
Expand All @@ -38,8 +38,5 @@ jobs:
pip install -e . -vvv
- name: Run pytest
run: |
pytest -v --cov=./ --cov-report=xml test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
conda activate test
pytest -v test
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: check-added-large-files

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

# Change Log

## Jul-22-2024: Version 3.3.3

- Provide functionality by `--cf3` and `--cf2` command options to create force
constants from displacement-force dataset of random displacements when
an external force constants calculator is specified.
- New command line options `--rd`, `--rd-fc2`, `--fc-calc`, `--fc-calc-opt` and
`--sp` to support random displacements.

## Jul-22-2024: Version 3.3.2

- Minor fix of `phono3py.load` function for reading displacements from
Expand Down
81 changes: 71 additions & 10 deletions doc/command-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ CELL_FILENAME = POSCAR-unitcell
where the setting tag names are case insensitive. This is run by

```bash
% phono3py setting.conf [comannd options]
% phono3py setting.conf [command options]
```

or

```bash
% phono3py [comannd options] -- setting.conf
% phono3py [command options] -- setting.conf
```

```{contents}
Expand All @@ -48,7 +48,7 @@ or
This specifies input unit cell filename.

```bash
% phono3py -c POSCAR-unitcell ... (many options)
% phono3py -c POSCAR-unitcell ... (options)
```

## Calculator interface
Expand Down Expand Up @@ -174,6 +174,27 @@ created from `FORCES_FC2` and `phono3py_disp.yaml` instead of `FORCES_FC3` and
% phono3py --cfs --dim-fc2="x x x"
```

(sp_option)=

### `--sp` or `--save-params`

Instead of `FORCES_FC3`, `phono3py_params.yaml` is generated. This option must
be used with `--cf3`, and optionally with `--cf2`. If the force calculator
supports reading energy of supercell, those are written into
`phono3y_params.yaml`. These energies are necessary for using `--pypolymlp`
option.

```bash
% phono3py --cf3 disp-{00001..00755}/vasprun.xml --sp
```

When using with `--cf2`, `--cf3` has to be specified simultaneously as below,

```bash
% phono3py --cf3 disp-{00001..00755}/vasprun.xml --cf2 disp_fc2-{00001..00002}/vasprun.xml --sp
```


## Supercell, primitive cell, masses, magnetic moments

(dim_option)=
Expand Down Expand Up @@ -250,7 +271,6 @@ web page](https://phonopy.github.io/phonopy/setting-tags.html#magmom).
## Displacement creation

(create_displacements_option)=

### `-d` (`CREATE_DISPLACEMENTS = .TRUE.`)

Supercell with displacements are created. Using with `--amplitude` option,
Expand All @@ -259,15 +279,16 @@ supercells with displacements and `phono3py_disp.yaml` file are created. `--pa`
should be specified if the input unit cell structure is not a primitive cell,
e.g., `--pa="F"` if the input unit cell has F-centring.

(amplitude_option)=

(random_displacements_option)=
### `--rd` (`RANDOM_DISPLACEMENTS`), `--rd-fc2` (`RANDOM_DISPLACEMENTS_FC2`) and `--random-seed` (`RANDOM_SEED`)

Random directional displacements are generated for fc3 and fc2 supercells by
`--rd` and `--rd-fc2`, respectively. `--amplitude` and `--random-seed` options
may be used together. These are used in the equivalent way to [`--rd` of
phonopy](https://phonopy.github.io/phonopy/setting-tags.html#random-displacements).

(amplitude_option)=
### `--amplitude` (`DISPLACEMENT_DISTANCE`)

Atomic displacement distance is specified. This value may be increased for the
Expand All @@ -277,6 +298,44 @@ very accurate.
The default value depends on calculator. See
{ref}`default_displacement_distance_for_calculator`.

(fc_calculator_option)=
### `--fc-calc`, `--fc-calculator` (`FC_CALCULATOR`)

Choice of force constants calculator.

```
% phono3py --fc-calc symfc ...
```

To use different force constants calculators for fc2 and fc3
```
% phono3py --fc-calc "symfc|" ...
```
Those for fc2 and fc3 are seprated by `|` such as `symfc|` . Blank means to
employ the finite difference method for systematic displacements generated by
the option `-d`.

(fc_calculator_options_option)=
### `--fc-calc-opt`, `--fc-calculator-options` (`FC_CALCULATOR_OPTIONS`)

Special options for force constants calculators.

```
% phono3py --fc-calc-opt "cutoff=8" ...
```

Similarly to `--fc-calc`, `|` can be used to separated those for fc2 and fc3.

#### Options for symfc

* cutoff : cutoff pair distance beyond that third-order force constants are zero
(fc3 only).
* use_mkl : sparse_dot_mkl is employed when it is available.

### `--symfc` and `--alm`

These are shortcuts of `--fc-calc symfc` and `--fc-calc alm`, respectively.

## Force constants

(compact_fc_option)=
Expand Down Expand Up @@ -331,14 +390,16 @@ supercell size and the second choice is using `--cutoff-pair` option.

### `--cutoff-pair` or `--cutoff-pair-distance` (`CUTOFF_PAIR_DISTANCE`)

This option is only used together with `-d` option.
This option works differently for the `-d` and `--rd` options.

A cutoff pair-distance in a supercell is used to reduce the number of necessary
supercells with displacements to obtain third order force constants. As the
drawback, a certain number of third-order-force-constants elements are abandoned
or computed with less numerical accuracy. More details are found at
For `-d`, A cutoff pair-distance in a supercell is used to reduce the number of
necessary supercells with displacements to obtain third order force constants.
As the drawback, a certain number of third-order-force-constants elements are
abandoned or computed with less numerical accuracy. More details are found at
{ref}`command_cutoff_pair`.

For `--rd`, `--cutoff-pair VAL` is equivalent to `--fc-calc-opt "cutoff=VAL"`.

### `--alm`

This invokes ALM as the force constants calculator for fc2 and fc3. See the
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# The short X.Y version.
version = "3.3"
# The full version, including alpha/beta/rc tags.
release = "3.3.2"
release = "3.3.3"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 5 additions & 1 deletion doc/cutoff-pair.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# Force constants calculation with cutoff pair-distance

Here the detail of the command option {ref}`--cutoff_pair <cutoff_pair_option>`
Since this calculation is a little bit tricky. It may be recommended to try
{ref}`random-displacements` with `--fc-calc-opt "cutoff = VAL"` before trying
this option.

Here the detail of the command option {ref}`--cutoff-pair <cutoff_pair_option>`
is explained.

<!-- See also reference {cite}`Mizokami-PRB-2018`. -->
Expand Down
1 change: 1 addition & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ auxiliary-tools
direct-solution
wigner-solution
workload-distribution
random-displacements
cutoff-pair
external-tools
phono3py-api
Expand Down
9 changes: 5 additions & 4 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ wrong python libraries can be imported.
% cd phonopy
% pip install -e . -vvv
% cd ../phono3py
% pip install -e . -vvv
% pip install . -vvv
```

The conda packages dependency can often change and this recipe may not work
properly. So if you find this instruction doesn't work, it is very
appreciated if letting us know it in the phonopy mailing list.
The editable install (`pip install -e`) may not work depending on the
computer environment. The conda packages dependency can often change and this
recipe may not work properly. So if you find this instruction doesn't work,
it is very appreciated if letting us know it in the phonopy mailing list.

(install_lapacke)=
## Installation of LAPACKE
Expand Down
Loading

0 comments on commit 7804f2d

Please sign in to comment.