Update pypolymlp doc

This commit is contained in:
Atsushi Togo 2025-03-03 11:19:45 +09:00
parent 33827f7210
commit d7cb66417f
1 changed files with 23 additions and 12 deletions

View File

@ -64,7 +64,7 @@ in the distribution from GitHub or PyPI.
`phono3py_params.yaml`. Use {ref}`--cf3 <cf3_option>` and {ref}`--sp
<sp_option>` option simultaneously.
4. Develop MLPs. By default, 90 and 10 percents of the dataset are used for the
training and test, respectively. At this step `phono3py.pmlp` is saved.
training and test, respectively. At this step `polymlp.yaml` is saved.
5. Generate displacements in supercells either systematic or random displacements.
6. Evaluate MLPs for forces of the supercells generated in step 5.
7. Calculate force constants from displacement-force dataset from steps 5 and 6.
@ -217,7 +217,7 @@ Regression: model selection ...
- alpha = 1.000e-01 : rmse (train, test) = 0.00002 0.00002
- alpha = 1.000e+00 : rmse (train, test) = 0.00002 0.00002
- alpha = 1.000e+01 : rmse (train, test) = 0.00002 0.00002
MLPs were written into "phono3py.pmlp"
MLPs were written into "polymlp.yaml"
------------------------------ pypolymlp end -------------------------------
Generate displacements (--rd or -d) for proceeding to phonon calculations.
Summary of calculation was written in "phono3py.yaml".
@ -231,7 +231,7 @@ Summary of calculation was written in "phono3py.yaml".
Information about the development of MLPs using pypolymlp is provided between
the `pypolymlp start` and `pypolymlp end` sections. The polynomial MLPs are
saved in the `phono3py.pmlp` file, which can be reused in subsequent phono3py
saved in the `polymlp.yaml` file, which can be reused in subsequent phono3py
executions with the `--pypolymlp` option when only displacements (and no forces)
are provided.
@ -240,7 +240,7 @@ are provided.
With the `-d` option, displacements are systematically generated while taking
crystal symmetry into account. When running with the `--pypolymlp` option, MLPs
are read from `phono3py.pmlp` if the file exists. In this case, training data is
are read from `polymlp.yaml` if the file exists. In this case, training data is
no longer required, and files such as `phono3py.yaml` can be used as the input
structure file.
@ -274,7 +274,7 @@ NAC parameters were read from "phono3py.yaml".
Pypolymlp is a generator of polynomial machine learning potentials.
Please cite the paper: A. Seko, J. Appl. Phys. 133, 011101 (2023).
Pypolymlp is developed at https://github.com/sekocha/pypolymlp.
Load MLPs from "phono3py.pmlp".
Load MLPs from "polymlp.yaml".
------------------------------ pypolymlp end -------------------------------
Generate displacements
Displacement distance: 0.01
@ -318,7 +318,7 @@ Random displacements are generated by specifying {ref}`--rd
<random_displacements_option>` option. To compute force constants with random
displacements, an external force constants calculator is necessary. By default,
symfc is used unless another force constants solver is explicitly specified.
When running with the `--pypolymlp` option, MLPs are read from `phono3py.pmlp`
When running with the `--pypolymlp` option, MLPs are read from `polymlp.yaml`
if the file exists. In this case, training data is no longer required, and files
such as `phono3py.yaml` can be used as the input structure file.
@ -352,7 +352,7 @@ NAC parameters were read from "phono3py.yaml".
Pypolymlp is a generator of polynomial machine learning potentials.
Please cite the paper: A. Seko, J. Appl. Phys. 133, 011101 (2023).
Pypolymlp is developed at https://github.com/sekocha/pypolymlp.
Load MLPs from "phono3py.pmlp".
Load MLPs from "polymlp.yaml".
------------------------------ pypolymlp end -------------------------------
Generate random displacements
Twice of number of snapshots will be generated for plus-minus displacements.
@ -406,10 +406,10 @@ displacements. Note that to achieve accurate force constants, the actual number
of generated supercells is twice the specified number. If `--rd` is omitted,
systematic displacements are introduced.
Once the file `phono3py.pmlp` is obtained, force constants can be calculated
using MLPs from `phono3py.pmlp`. After removing the `fc3.hdf5` and `fc2.hdf5`
files, `phono3py-load` will detect `phono3py.pmlp` and then compute the force
constants by loading the MLPs from `phono3py.pmlp` as follows:
Once the file `polymlp.yaml` is obtained, force constants can be calculated
using MLPs from `polymlp.yaml`. After removing the `fc3.hdf5` and `fc2.hdf5`
files, `phono3py-load` will detect `polymlp.yaml` and then compute the force
constants by loading the MLPs from `polymlp.yaml` as follows:
```
% phono3py-load --pypolymlp --rd 100 --amplitude 0.005 phono3py.yaml
@ -441,7 +441,7 @@ NAC parameters were read from "phono3py.yaml".
Pypolymlp is a generator of polynomial machine learning potentials.
Please cite the paper: A. Seko, J. Appl. Phys. 133, 011101 (2023).
Pypolymlp is developed at https://github.com/sekocha/pypolymlp.
Load MLPs from "phono3py.pmlp".
Load MLPs from "polymlp.yaml".
------------------------------ pypolymlp end -------------------------------
Generate random displacements
Twice of number of snapshots will be generated for plus-minus displacements.
@ -542,3 +542,14 @@ the next 100 supercells) will be computed and included. With this procedure in
mind, it may be convenient to generate a sufficiently large number of supercells
with random displacements in advance, such as 1000 supercells, before starting
the LTC calculation with pypolymlp.
## Converting `phono3py.pmlp` to `polymlp.yaml`
In older versions, polynomial MLPs were stored in `phono3py.pmlp`. This file can
be converted to `polymlp.yaml` using the following Python snippet.
```python
from pypolymlp.mlp_dev.pypolymlp import Pypolymlp
polymlp = Pypolymlp()
polymlp.convert_to_yaml(filename_txt="phono3py.pmlp", filename_yaml="polymlp.yaml”)
```