Update pypolymlp example

This commit is contained in:
Atsushi Togo 2025-01-13 16:19:45 +09:00
parent b2309d69a3
commit 5146070780
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,9 @@
# Example to create force constants using MLPs by pypolymlp
This is an example to follow the documentation
https://phonopy.github.io/phono3py/pypolymlp.html.
`phono3py_params.yaml` can be also generated by
```bash
% python make_phono3py_params.py ../NaCl-rd/phono3py_params_NaCl.yaml.xz
```

View File

@ -0,0 +1,13 @@
import sys
import phono3py
ph3 = phono3py.load(sys.argv[1], produce_fc=False, log_level=1)
ph3_new = phono3py.Phono3py(
ph3.unitcell,
supercell_matrix=ph3.supercell_matrix,
primitive_matrix=ph3.primitive_matrix,
)
ph3_new.dataset = ph3.dataset
ph3_new.nac_params = ph3.nac_params
ph3_new.save("phono3py_params.yaml")