Skip to content

Commit

Permalink
Added code snippets for Grüneisen, QHA and EOS wfs documentation (#1130)
Browse files Browse the repository at this point in the history
* Create high_level_overview.md

Drafting the tutorial text.

* added Job and Flow makers section to the tutorial

* added Job and Flow makers section to the tutorial

* changed the style of the tutorial

* structure the text better

* Added todo

Noting some idea

* added the section for InputSet and Builder

* adding job maker @job decorator explanation

* Update key_concepts_overview.md

* removing unnecessary line

* remove unnecessary lines

* added section for taskdocs

* fixing typo

* fixing typo

* Noting some idea

* revised the tutorial, fixed tpos etc.

* minor changes

* minor changes

* Auto-update pre-commit hooks

* Update docs/user/key_concepts_overview.md

Co-authored-by: J. George <[email protected]>

* fix small things

* fix docstring

* added example code snippets

---------

Co-authored-by: QuantumChemist <[email protected]>
Co-authored-by: J. George <[email protected]>
  • Loading branch information
3 people authored Feb 24, 2025
1 parent e5a5ba8 commit e4b9d39
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 12 deletions.
73 changes: 63 additions & 10 deletions docs/user/codes/vasp.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ adjust them if necessary. The default might not be strict enough
for your specific case.
```

You can use the following code to start the standard version of the workflow:
You can use the following code to start the default VASP version of the workflow:
```py
from atomate2.vasp.flows.phonons import PhononMaker
from pymatgen.core.structure import Structure
Expand All @@ -260,14 +260,11 @@ structure = Structure(
)

phonon_flow = PhononMaker(min_length=15.0, store_force_constants=False).make(
structure=struct
structure=structure
)
```




### Gruneisen parameter workflow
### Grüneisen parameter workflow

Calculates mode-dependent Grüneisen parameters with the help of Phonopy.

Expand All @@ -277,8 +274,25 @@ shrunk by 1 % (default) of its volume.
Subsequently, supercells with one displaced atom are 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.
The dynamical matrices of three structures are then used as an input to the phonopy Grueneisen api
to compute mode-dependent Grueneisen parameters.
The dynamical matrices of three structures are then used as an input to the phonopy Grüneisen api
to compute mode-dependent Grüneisen parameters.

A Grüneisen workflow for VASP can be started as follows:
```python
from atomate2.vasp.flows.gruneisen import GruneisenMaker
from pymatgen.core.structure import Structure


structure = Structure(
lattice=[[0, 2.13, 2.13], [2.13, 0, 2.13], [2.13, 2.13, 0]],
species=["Mg", "O"],
coords=[[0, 0, 0], [0.5, 0.5, 0.5]],
)

qha_flow = GruneisenMaker(kpath_scheme="seekpath", vol=0.01, mesh=(15, 15, 15)).make(
structure=structure
)
```

### Quasi-harmonic Workflow

Expand All @@ -287,13 +301,52 @@ First, a tight relaxation is performed. Subsequently, several optimizations at d
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.

The following script allows you to start the default workflow for VASP with some adjusted parameters:
```python
from atomate2.vasp.flows.qha import QhaMaker
from pymatgen.core.structure import Structure


structure = Structure(
lattice=[[0, 2.13, 2.13], [2.13, 0, 2.13], [2.13, 2.13, 0]],
species=["Mg", "O"],
coords=[[0, 0, 0], [0.5, 0.5, 0.5]],
)

qha_flow = QhaMaker(
linear_strain=(-0.10, 0.10),
number_of_frames=10,
).make(structure=structure)
```

### Equation of State Workflow

An equation of state (EOS) workflow is implemented. First, a tight relaxation is performed. Subsequently, several optimizations at different constant
An equation of state (EOS) workflow has the following structure: 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 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).
You can start the workflow as follows:
```python
from atomate2.vasp.flows.eos import EosMaker
from pymatgen.core.structure import Structure


structure = Structure(
lattice=[[0, 2.13, 2.13], [2.13, 0, 2.13], [2.13, 2.13, 0]],
species=["Mg", "O"],
coords=[[0, 0, 0], [0.5, 0.5, 0.5]],
)

qha_flow = EosMaker(
linear_strain=(-0.10, 0.10),
number_of_frames=10,
).make(structure=structure)
```

The output of the workflow is a dictionary by default 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

Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/common/flows/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CommonEosMaker(Maker):
Maker to relax deformed structures for the EOS fit.
static_maker : .Maker | None
Maker to generate statics after each relaxation, defaults to None.
strain : tuple[float]
linear_strain : tuple[float]
Percentage linear strain to apply as a deformation, default = -5% to 5%.
number_of_frames : int
Number of strain calculations to do for EOS fit, default = 6.
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/vasp/flows/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class EosMaker(CommonEosMaker):
Maker to relax deformed structures for the EOS fit.
static_maker : .Maker | None
Maker to generate statics after each relaxation, defaults to None.
strain : tuple[float]
linear_strain : tuple[float]
Percentage linear strain to apply as a deformation, default = -5% to 5%.
number_of_frames : int
Number of strain calculations to do for EOS fit, default = 6.
Expand Down

0 comments on commit e4b9d39

Please sign in to comment.