Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lattice dynamics workflow using Pheasy #1063

Open
wants to merge 108 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
0775785
Add pheasy branch for phonon calculation using LASSO
leslie-zheng Sep 9, 2024
7891554
pheasy_phonons
leslie-zheng Sep 9, 2024
d643fc1
add_pheasy_to_vasp_folder
leslie-zheng Sep 10, 2024
93219ce
Add_pheasy_to_vasp_file
leslie-zheng Sep 10, 2024
f4b59c6
Merge branch 'main' into atomate2_jz_pheasy
JaGeo Sep 16, 2024
e514969
Merge branch 'main' into atomate2_jz_pheasy
JaGeo Sep 20, 2024
11d546b
Modified some parts based on Janine's comments.
leslie-zheng Sep 23, 2024
13acf5a
Merge branch 'atomate2_jz_pheasy' of https://github.com/leslie-zheng/…
leslie-zheng Sep 23, 2024
57ab59f
directly import the class methods from phonons
leslie-zheng Sep 23, 2024
647fe49
clean up the code
leslie-zheng Sep 23, 2024
94a1acc
remove some files.
leslie-zheng Sep 23, 2024
b92e34e
minor change
leslie-zheng Sep 23, 2024
05650d0
allow the users to define the number of displacements for random-disp…
leslie-zheng Sep 23, 2024
0bf1bf8
format_adjustment
leslie-zheng Sep 23, 2024
e9cd8a6
format_adjustment
leslie-zheng Sep 23, 2024
2bacc86
small update
leslie-zheng Sep 24, 2024
4535497
clean up the code and add more comments
leslie-zheng Sep 24, 2024
eab1fe6
minor update
leslie-zheng Sep 24, 2024
36aa5b7
allow the users to control the symmetry precision
leslie-zheng Sep 24, 2024
c69df93
Lower the symmetry precision to allow pheasy to find a correct space …
leslie-zheng Sep 24, 2024
92ea25a
Minor update
leslie-zheng Sep 24, 2024
5d6f122
minor adjustment
leslie-zheng Sep 24, 2024
e17a316
minor update for flow/pheasy.py
leslie-zheng Sep 24, 2024
f46c2fd
resuse some jobs from phonons
leslie-zheng Sep 25, 2024
34a197e
clean up the job(generate_phonon_displacements)
leslie-zheng Sep 25, 2024
be89bce
finished cleaning up the pheasy jobs module
leslie-zheng Sep 25, 2024
1316b1d
finished cleaning up the shemas/pheasy
leslie-zheng Sep 25, 2024
833205a
small adjustment to pass the lint
leslie-zheng Sep 28, 2024
f741a8c
raise a error if ALM is not installed.
leslie-zheng Sep 28, 2024
30de21a
minor update
leslie-zheng Sep 28, 2024
69956d7
Merge branch 'main' into atomate2_jz_pheasy
leslie-zheng Sep 28, 2024
1726fc9
first try
leslie-zheng Sep 29, 2024
0a7018b
finished testing
leslie-zheng Sep 29, 2024
f834a6e
Extract_higher_order_FCs
leslie-zheng Sep 30, 2024
0e54a10
anharmonic FCs cals. still in experiment.
leslie-zheng Sep 30, 2024
4a0256f
minor updata for the anharmonic FCs calculations
leslie-zheng Sep 30, 2024
516a066
minor update
leslie-zheng Oct 1, 2024
79590d8
minor update
leslie-zheng Oct 1, 2024
d6713d3
minor update
leslie-zheng Oct 1, 2024
14796ea
minor update
leslie-zheng Oct 1, 2024
63db3d1
adjustment and add comments
leslie-zheng Oct 1, 2024
a64bbfc
added the missing argument mp-id
hrushikesh-s Oct 1, 2024
47b4974
added support of force field
hrushikesh-s Oct 1, 2024
ff427dc
multiply a factor of 1.89 to convert the unit of A to Borh for ALM
leslie-zheng Oct 2, 2024
63e0a1c
use filed to define fcs_cutoff_radius instead of a simple list.
leslie-zheng Oct 2, 2024
09872f8
update definition of fcs_cutoff_radius
leslie-zheng Oct 2, 2024
e2b25f9
convert Bohr radius to Å
hrushikesh-s Oct 2, 2024
a1709cd
giving a reasonable displaced distance for the anharmonic case.
leslie-zheng Oct 2, 2024
e788a9d
Merge branch 'atomate2_jz_pheasy_anharmonic' of https://github.com/le…
leslie-zheng Oct 2, 2024
2909e65
minor update
leslie-zheng Oct 2, 2024
509615c
update
leslie-zheng Oct 2, 2024
63463be
Unit tests for pheasy wf
hrushikesh-s Oct 4, 2024
d43c3ee
Test # 1
hrushikesh-s Oct 4, 2024
4e8d491
avoid circular import
leslie-zheng Oct 11, 2024
41792d4
Merge branch 'atomate2_jz_pheasy_anharmonic' of https://github.com/le…
leslie-zheng Oct 11, 2024
de6befb
update some stupid over-writing
leslie-zheng Oct 11, 2024
5e923bd
update the matrix I should use
leslie-zheng Oct 12, 2024
c7c6a5d
using phono3py for lattice thermal conductivity calculation
leslie-zheng Oct 12, 2024
b978f61
update for phono3py thermal conductivity
leslie-zheng Oct 12, 2024
5875952
update phonon energy renomralization
leslie-zheng Oct 13, 2024
ffcbbdd
phonon renormalization
leslie-zheng Oct 13, 2024
7a6a0ad
Auto stash before rebase of "atomate2_jz_pheasy_anharmonic" onto "ori…
hrushikesh-s Oct 13, 2024
572ede4
test files for pheasy
hrushikesh-s Nov 21, 2024
30cab3f
added 1 extra disp
hrushikesh-s Nov 21, 2024
91481a0
ruff fixes to schemas/pheasy.py
hrushikesh-s Nov 21, 2024
905c8ac
ruff fixes to flows/pheasy.py
hrushikesh-s Nov 21, 2024
dc89ca6
ruff fixes to jobs/pheasy.py
hrushikesh-s Nov 21, 2024
4ec42ad
pre-commit vasp/flows/pheasy
hrushikesh-s Nov 22, 2024
4370a64
updated pyproject.toml
hrushikesh-s Nov 22, 2024
9ebcaec
Merge branch 'remote-main' into atomate2_jz_pheasy_anharmonic
hrushikesh-s Nov 22, 2024
6453445
updated the way to install pheasy for testing purposes
hrushikesh-s Nov 22, 2024
1708153
removed pheasy from [strict]
hrushikesh-s Nov 22, 2024
3f3a01a
added hiphive dependency
hrushikesh-s Nov 22, 2024
e56a6fb
added max_length argument
hrushikesh-s Nov 22, 2024
32d5523
removed forcefields/test_pheasy.py
hrushikesh-s Nov 22, 2024
294a787
add conda install steps for alamode
hrushikesh-s Nov 22, 2024
6ba11d5
updated conda command for alamode
hrushikesh-s Nov 22, 2024
efd1480
adding f90nml to strict
hrushikesh-s Nov 22, 2024
cae1727
adding further installation steps for alamode
hrushikesh-s Nov 22, 2024
dd5ec21
alamode installation -- bug fix 1
hrushikesh-s Nov 22, 2024
5a410d4
alamode installation -- bug fix 2
hrushikesh-s Nov 22, 2024
a8f805a
alamode installation -- bug fix 3
hrushikesh-s Nov 22, 2024
f1c5ee5
alamode installation -- bug fix 4
hrushikesh-s Nov 22, 2024
fc5901d
alamode installation -- bug fix 5
hrushikesh-s Nov 22, 2024
9880778
alamode installation -- bug fix 6
hrushikesh-s Nov 22, 2024
6a6c2aa
added tol to test_phonons.py
hrushikesh-s Nov 22, 2024
35ac961
bug fix for linear strain passing in qha (#1061)
JaGeo Nov 22, 2024
6fd44f1
Fix `generate_phonon_displacements` magmom removal side effect (#1064)
janosh Nov 22, 2024
3d22e6a
Bump emmet-core from 0.84.3rc3 to 0.84.3rc4 (#1065)
dependabot[bot] Nov 25, 2024
bc11904
Bump jobflow from 0.1.18 to 0.1.19 (#1067)
dependabot[bot] Nov 25, 2024
2189373
add openmm description to docs (#1069)
JaGeo Nov 25, 2024
6eca446
fix minor code formatting issues + typos (#1070)
janosh Nov 25, 2024
8a0541a
Docs update, forcefield elastic convenience maker, forcefield enum hy…
esoteric-ephemera Nov 26, 2024
7b16765
Fix bump phonopy (#1006)
naik-aakash Nov 30, 2024
7a98a88
Bump mp-api from 0.42.2 to 0.43.0 (#1075)
dependabot[bot] Dec 2, 2024
66dfd5b
Bump pytest from 8.3.3 to 8.3.4 (#1077)
dependabot[bot] Dec 2, 2024
305bc3b
Bump ipython from 8.29.0 to 8.30.0 (#1076)
dependabot[bot] Dec 2, 2024
244da21
Bump sevenn from 0.10.1 to 0.10.2 (#1080)
dependabot[bot] Dec 9, 2024
de84bc0
Bump emmet-core from 0.84.3rc4 to 0.84.3rc6 (#1081)
dependabot[bot] Dec 9, 2024
dc9335e
update calorine version (#1083)
naik-aakash Dec 9, 2024
31474ef
soften the assert output["relax"]["EOS"]["birch_murnaghan"]["b0"]
hrushikesh-s Dec 10, 2024
a525799
further softening
hrushikesh-s Dec 10, 2024
b2493f9
providing absolute path for FC file
hrushikesh-s Dec 10, 2024
4618005
changed the location of reading FC file
hrushikesh-s Dec 10, 2024
b6964f3
changed the run_locally's attribute of create_folders to false
hrushikesh-s Dec 10, 2024
35a2c40
changed it back to True
hrushikesh-s Dec 10, 2024
0836d1e
adding some print statements for debugging
hrushikesh-s Dec 10, 2024
af27d7b
adding more logger statements for debugging
hrushikesh-s Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,20 @@ jobs:
mkdir -p ~/.abinit/pseudos
cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos
uv pip install .[strict,strict-forcefields,tests,abinit]
uv pip install -i https://test.pypi.org/simple/ pheasy==0.0.1 # Install pheasy
uv pip install torch-runstats
uv pip install --no-deps nequip==0.5.6


- name: Install ALA-Mode
run: |
micromamba activate a2
micromamba install -n a2 -c conda-forge numpy scipy h5py compilers “libblas=*=*mkl” spglib boost eigen cmake ipython mkl-include openmpi --yes
git clone https://github.com/ttadano/ALM.git # do I need to modify this?
cd ALM # do I need to modify this?
cd python
python setup.py build # do I need to modify this?
uv pip install -e . # do I need to modify this?

- name: Install pymatgen from master if triggered by pymatgen repo dispatch
if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger'
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
exclude: ^(.github/|tests/test_data/abinit/)
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.7.3
rev: v0.8.0
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -45,7 +45,7 @@ repos:
args: [--ignore-words-list, 'titel,statics,ba,nd,te,atomate']
types_or: [python, rst, markdown]
- repo: https://github.com/kynan/nbstripout
rev: 0.8.0
rev: 0.8.1
hooks:
- id: nbstripout
args:
Expand Down
1 change: 1 addition & 0 deletions docs/user/codes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ The section gives the instructions for codes supported by atomate2.

```{toctree}
vasp
openmm
```
39 changes: 34 additions & 5 deletions docs/user/codes/vasp.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(codes.vasp)=

# VASP

At present, most workflows in atomate2 use the Vienna *ab initio* simulation package
Expand Down Expand Up @@ -260,20 +261,48 @@ With the help of phonopy, these forces are then converted into a dynamical matri
The dynamical matrices of three structures are then used as an input to the phonopy Grueneisen api
to compute mode-dependent Grueneisen parameters.


### Quasi-harmonic Workflow

Uses the quasi-harmonic approximation with the help of Phonopy to compute thermodynamic properties.
First, a tight relaxation is performed. Subsequently, several optimizations at different constant
volumes are performed. At each of the volumes, an additional phonon run is performed as well.
Afterwards, equation of state fits are performed with phonopy.



### Equation of State Workflow
An equation of state workflow is implemented. First, a tight relaxation is performed. Subsequently, several optimizations at different constant

An equation of state (EOS) workflow is implemented. First, a tight relaxation is performed. Subsequently, several optimizations at different constant
volumes are performed. Additional static calculations might be performed afterwards to arrive at more
accurate energies. Then, an equation of state fit is performed with pymatgen.
accurate energies. Then, an EOS fit is performed with pymatgen.

The output of the workflow is, by default, a dictionary containing the energy and volume data generated with DFT, in addition to fitted equation of state parameters for all models currently available in pymatgen (Murnaghan, Birch-Murnaghan, Poirier-Tarantola, and Vinet/UBER).

#### Materials Project-compliant workflows

If the user wishes to reproduce the EOS data currently in the Materials Project, they should use the atomate 1-compatible `MPLegacy`-prefixed flows (and jobs and input sets). For performing updated PBE-GGA EOS flows with Materials Project-compliant parameters, the user should use the `MPGGA`-prefixed classes. Lastly, the `MPMetaGGA`-prefixed classes allow the user to perform Materials Project-compliant r<sup>2</sup>SCAN EOS workflows.

**Summary:** For Materials Project-compliant equation of state (EOS) workflows, the user should use:
* `MPGGAEosMaker` for faster, lower-accuracy calculation with the PBE-GGA
* `MPMetaGGAEosMaker` for higher-accuracy but slower calculations with the r<sup>2</sup>SCAN meta-GGA
* `MPLegacyEosMaker` for consistency with the PBE-GGA data currently distributed by the Materials Project

#### Implementation details

The Materials Project-compliant EOS flows, jobs, and sets currently use three prefixes to indicate their usage.
* `MPGGA`: MP-compatible PBE-GGA (current)
* `MPMetaGGA`: MP-compatible r<sup>2</sup>SCAN meta-GGA (current)
* `MPLegacy`: a reproduction of the atomate 1 implementation, described in
K. Latimer, S. Dwaraknath, K. Mathew, D. Winston, and K.A. Persson, npj Comput. Materials **vol. 4**, p. 40 (2018), DOI: 10.1038/s41524-018-0091-x

For reference, the original atomate workflows can be found here:
* [`atomate.vasp.workflows.base.wf_bulk_modulus`](https://github.com/hackingmaterials/atomate/blob/main/atomate/vasp/workflows/presets/core.py#L564)
* [`atomate.vasp.workflows.base.bulk_modulus.get_wf_bulk_modulus`](https://github.com/hackingmaterials/atomate/blob/main/atomate/vasp/workflows/base/bulk_modulus.py#L21)

In the original atomate 1 workflow and the atomate2 `MPLegacyEosMaker`, the k-point density is **extremely** high. This is despite the convergence tests in the supplementary information
of Latimer *et al.* not showing strong sensitivity when the "number of ***k***-points per reciprocal atom" (KPPRA) is at least 3,000.

To make the `MPGGAEosMaker` and `MPMetaGGAEosMaker` more tractable for high-throughput jobs, their input sets (`MPGGAEos{Relax,Static}SetGenerator` and `MPMetaGGAEos{Relax,Static}SetGenerator` respectively) still use the highest ***k***-point density in standard Materials Project jobs, `KSPACING = 0.22` Å<sup>-1</sup>, which is comparable to KPPRA = 3,000.

This choice is justified by Fig. S12 of the supplemantary information of Latimer *et al.*, which shows that all fitted EOS parameters (equilibrium energy $E_0$, equilibrium volume $V_0$, bulk modulus $B_0$, and bulk modulus pressure derivative $B_1$) do not deviate by more than 1.5%, and typically by less than 0.1%, from well-converged values when KPPRA = 3,000.

### LOBSTER

Expand Down
20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ amset = ["amset>=0.4.15", "pydash"]
cclib = ["cclib"]
mp = ["mp-api>=0.37.5"]
phonons = ["phonopy>=1.10.8", "seekpath>=2.0.0"]
pheasy = ["hiphive==1.3.1"]
lobster = ["ijson>=3.2.2", "lobsterpy>=0.4.0"]
defects = [
"dscribe>=1.2.0",
Expand All @@ -51,7 +52,7 @@ defects = [
]
forcefields = [
"ase>=3.23.0",
"calorine<=2.2.1",
"calorine>=3.0",
"chgnet>=0.2.2",
"mace-torch>=0.3.3",
"matgl>=1.1.3",
Expand All @@ -74,7 +75,7 @@ docs = [
"FireWorks==2.0.3",
"autodoc_pydantic==2.2.0",
"furo==2024.8.6",
"ipython==8.29.0",
"ipython==8.30.0",
"jsonschema[format]",
"myst_parser==4.0.0",
"numpydoc==1.8.0",
Expand All @@ -89,7 +90,7 @@ tests = [
"pytest-cov==6.0.0",
"pytest-mock==3.14.0",
"pytest-split==0.10.0",
"pytest==8.3.3",
"pytest==8.3.4",
]
strict = [
"PyYAML==6.0.2",
Expand All @@ -98,17 +99,17 @@ strict = [
"click==8.1.7",
"custodian==2024.10.16",
"dscribe==2.1.1",
"emmet-core==0.84.3rc3",
"emmet-core==0.84.3rc6",
"ijson==3.3.0",
"jobflow==0.1.18",
"jobflow==0.1.19",
"lobsterpy==0.4.9",
"mdanalysis==2.7.0",
"monty==2024.10.21",
"mp-api==0.42.2",
"mp-api==0.43.0",
"numpy",
"openmm-mdanalysis-reporter==0.1.0",
"openmm==8.1.1",
"phonopy==2.27.0",
"phonopy==2.30.1",
"pydantic-settings==2.6.1",
"pydantic==2.9.2",
"pymatgen-analysis-defects==2024.10.22",
Expand All @@ -117,14 +118,16 @@ strict = [
"seekpath==2.1.0",
"tblite==0.3.0; python_version < '3.12'",
"typing-extensions==4.12.2",
"hiphive==1.3.1",
"f90nml==1.4.4",
]
strict-forcefields = [
"calorine==3.0",
"chgnet==0.4.0",
"mace-torch>=0.3.6",
"matgl==1.1.3",
"quippy-ase==0.9.14; python_version < '3.12'",
"sevenn==0.10.1",
"sevenn==0.10.2",
"torch==2.5.1",
"torchdata==0.7.1", # TODO: remove when issue fixed
]
Expand Down Expand Up @@ -207,7 +210,6 @@ ignore = [
"PLR0913", # too many arguments
"PLR0915", # too many local statements
"PLR2004",
"PT004", # pytest-missing-fixture-name-underscore
"PT006", # pytest-parametrize-names-wrong-type
"PT013", # pytest-incorrect-pytest-import
"PTH", # prefer Pathlib to os.path
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/ase/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class AseBaseModel(BaseModel):
)
molecule: Optional[Molecule] = Field(None, description="The molecule at this step.")

def model_post_init(self, __context: Any) -> None:
def model_post_init(self, _context: Any) -> None:
"""Establish alias to structure and molecule fields."""
if self.structure is None and isinstance(self.mol_or_struct, Structure):
self.structure = self.mol_or_struct
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/common/flows/anharmonicity.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def make(
A previous calculation directory to use for copying outputs.
Default is None.
born: Optional[list[Matrix3D]]
Instead of recomputing born charges and epsilon, these values can also be
Instead of recomputing Born charges and epsilon, these values can also be
provided manually. If born and epsilon_static are provided, the born run
will be skipped it can be provided in the VASP convention with information
for every atom in unit cell. Please be careful when converting structures
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/common/flows/gruneisen.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BaseGruneisenMaker(Maker, ABC):
generated for all the three structures (ground state, expanded and shrunk volume)
and accurate forces are computed for these structures. With the help of phonopy,
these forces are then converted into a dynamical matrix. This dynamical matrix of
three structures is then used as an input for the phonopy Grueneisen api
three structures is then used as an input for the phonopy Grueneisen API
to compute Grueneisen parameters.


Expand Down
Loading
Loading