Skip to content

Commit

Permalink
Update pypolymlp example
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Jan 13, 2025
1 parent b2309d6 commit 5146070
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions example/NaCl-pypolymlp/README.md
Original file line number Diff line number Diff line change
@@ -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
```
13 changes: 13 additions & 0 deletions example/NaCl-pypolymlp/make_phono3py_params.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 5146070

Please sign in to comment.