Skip to content

Commit

Permalink
Add phonons (stfc#143)
Browse files Browse the repository at this point in the history
* Add phonopy dependency

* Add seekpath for qpoints calculation

* Update .gitignore to ignore pdf and yaml files

* Allow ax as variable name

* Add initial phonons

* Allow list of supercell dimensions

* Remove plotting for phonons

* Add kwargs for phonons optimizer

* Tidy phonons

* Add initial phonons CLI

* Fix docs

* Update docstrings

* Add options for phonon CLI

* Add file prefix option for phonons

* Separate thermal property calculation from phonons

* Add default supercell value for phonons

* Add structure name option for phonon CLI

* Fix setting structure name for phonons

* Enable setting DOS and PSDOS file prefixes

* Add initial tests for phonon CLI

* Add logging for optimize via phonons

* Add tests for phonons

* Add logging for phonons

* Rename phonon params file

* Update README for phonons

* Add phonon CLI flags to summary

* Create separate functions to write phonon results

* Change hdf5 force constants to option

* Fix default mesh for phonons

* Refactor setting default filenames for phonons

* Add hdf5 to gitignore

* Tidy printing thermal properties for phonons

* Change phonon supercell input to string

* Add tests for supercell

* Update tests/test_phonons_cli.py

Co-authored-by: Jacob Wilkins <[email protected]>

* Tidy supercell CLI parsing

* Update janus_core/cli/phonons.py

* Update janus_core/calculations/phonons.py

* Update janus_core/cli/phonons.py

* restructure a little bit and test the permissions

* Update janus_core/cli/phonons.py

Co-authored-by: Jacob Wilkins <[email protected]>

* restructure a little bit and test the permissions

---------

Co-authored-by: ElliottKasoar <[email protected]>
Co-authored-by: Jacob Wilkins <[email protected]>
Co-authored-by: Alin Marin Elena <[email protected]>
  • Loading branch information
4 people authored May 24, 2024
1 parent f12a5c7 commit 3e2adb8
Show file tree
Hide file tree
Showing 10 changed files with 1,195 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*.cif
*.xyz
*.yml
*.yaml
*.pdf
*.hdf5
*.traj
~*
*~
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Tools for machine learnt interatomic potentials
- NVT (Langevin(Eijnden/Ciccotti flavour) and Nosé-Hoover (Melchionna flavour))
- NPT (Nosé-Hoover (Melchiona flavour))
- [ ] Nudge Elastic Band
- [x] Phonons
- Phonopy
- [x] Equation of State
- [ ] Phonons
- vibroscopy
- [x] Training ML potentials
- MACE
- [x] Fine tunning MLIPs
Expand Down Expand Up @@ -196,6 +196,27 @@ janus eos --struct tests/data/NaCl.cif --minimize-all --fmax 0.0001
For all options, run `janus eos --help`.


### Phonons

Calculate phonons with a 2x2x2 supercell, after geometry optimization (using the [MACE-MP](https://github.com/ACEsuit/mace-mp):

```shell
janus phonons --struct tests/data/NaCl.cif --supercell 2x2x2 --minimize --arch mace_mp --calc-kwargs "{'model' : 'small'}"
```

This will save the Phonopy parameters, including displacements and force constants, to `NaCl-params.yml`, and the calculated band structure to `NaCl-auto-band.yml`, in addition to generating a log file, `phonons.log`, and summary of inputs, `phonons_summary.yml`.

Further calculations, including thermal properties, DOS, and PDOS, can also be calculated (using a 2x3x4 supercell):

```shell
janus phonons --struct tests/data/NaCl.cif --supercell 2x3x4 --dos --pdos --thermal --temp-start 0 --temp-end 300 --temp-step 50
```

This will create additional output files: `NaCl-cv.dat` for the thermal properties (heat capacity, entropy, and free energy) between 0K and 300K, `NaCl-dos.dat` for the DOS, and `NaCl-pdos.dat` for the PDOS.

For all options, run `janus phonons --help`.


### Using configuration files

Default values for all command line options may be specifed through a Yaml 1.1 formatted configuration file by adding the `--config` option. If an option is present in both the command line and configuration file, the command line value takes precedence.
Expand Down
21 changes: 21 additions & 0 deletions docs/source/apidoc/janus_core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ janus\_core.cli.train module
:undoc-members:
:show-inheritance:

janus\_core.cli.phonons module
------------------------------

.. automodule:: janus_core.cli.phonons
:members:
:special-members:
:private-members:
:undoc-members:
:show-inheritance:

janus\_core.cli.eos module
--------------------------

Expand Down Expand Up @@ -188,6 +198,17 @@ janus\_core.calculations.md module
:undoc-members:
:show-inheritance:

janus\_core.calculations.phonons module
---------------------------------------

.. automodule:: janus_core.calculations.phonons
:members:
:special-members:
:private-members:
:inherited-members:
:undoc-members:
:show-inheritance:

janus\_core.helpers.stats
-------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"ase": ("https://wiki.fysik.dtu.dk/ase/", None),
"phonopy": ("https://phonopy.github.io/phonopy/", None),
}

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -198,4 +199,5 @@
("py:class", "typer.models.Context"),
("py:class", "ellipsis"),
("py:class", "janus_core.helpers.stats.T"),
("py:class", "phonopy.structure.atoms.PhonopyAtoms"),
]
Loading

0 comments on commit 3e2adb8

Please sign in to comment.