Skip to content

Commit e4b9d39

Browse files
Added code snippets for Grüneisen, QHA and EOS wfs documentation (#1130)
* 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]>
1 parent e5a5ba8 commit e4b9d39

File tree

3 files changed

+65
-12
lines changed

3 files changed

+65
-12
lines changed

Diff for: docs/user/codes/vasp.md

+63-10
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ adjust them if necessary. The default might not be strict enough
248248
for your specific case.
249249
```
250250

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

262262
phonon_flow = PhononMaker(min_length=15.0, store_force_constants=False).make(
263-
structure=struct
263+
structure=structure
264264
)
265265
```
266266

267-
268-
269-
270-
### Gruneisen parameter workflow
267+
### Grüneisen parameter workflow
271268

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

@@ -277,8 +274,25 @@ shrunk by 1 % (default) of its volume.
277274
Subsequently, supercells with one displaced atom are generated for all the three structures
278275
(ground state, expanded and shrunk volume) and accurate forces are computed for these structures.
279276
With the help of phonopy, these forces are then converted into a dynamical matrix.
280-
The dynamical matrices of three structures are then used as an input to the phonopy Grueneisen api
281-
to compute mode-dependent Grueneisen parameters.
277+
The dynamical matrices of three structures are then used as an input to the phonopy Grüneisen api
278+
to compute mode-dependent Grüneisen parameters.
279+
280+
A Grüneisen workflow for VASP can be started as follows:
281+
```python
282+
from atomate2.vasp.flows.gruneisen import GruneisenMaker
283+
from pymatgen.core.structure import Structure
284+
285+
286+
structure = Structure(
287+
lattice=[[0, 2.13, 2.13], [2.13, 0, 2.13], [2.13, 2.13, 0]],
288+
species=["Mg", "O"],
289+
coords=[[0, 0, 0], [0.5, 0.5, 0.5]],
290+
)
291+
292+
qha_flow = GruneisenMaker(kpath_scheme="seekpath", vol=0.01, mesh=(15, 15, 15)).make(
293+
structure=structure
294+
)
295+
```
282296

283297
### Quasi-harmonic Workflow
284298

@@ -287,13 +301,52 @@ First, a tight relaxation is performed. Subsequently, several optimizations at d
287301
volumes are performed. At each of the volumes, an additional phonon run is performed as well.
288302
Afterwards, equation of state fits are performed with phonopy.
289303

304+
The following script allows you to start the default workflow for VASP with some adjusted parameters:
305+
```python
306+
from atomate2.vasp.flows.qha import QhaMaker
307+
from pymatgen.core.structure import Structure
308+
309+
310+
structure = Structure(
311+
lattice=[[0, 2.13, 2.13], [2.13, 0, 2.13], [2.13, 2.13, 0]],
312+
species=["Mg", "O"],
313+
coords=[[0, 0, 0], [0.5, 0.5, 0.5]],
314+
)
315+
316+
qha_flow = QhaMaker(
317+
linear_strain=(-0.10, 0.10),
318+
number_of_frames=10,
319+
).make(structure=structure)
320+
```
321+
290322
### Equation of State Workflow
291323

292-
An equation of state (EOS) workflow is implemented. First, a tight relaxation is performed. Subsequently, several optimizations at different constant
324+
An equation of state (EOS) workflow has the following structure: First, a tight relaxation is performed.
325+
Subsequently, several optimizations at different constant
293326
volumes are performed. Additional static calculations might be performed afterwards to arrive at more
294327
accurate energies. Then, an EOS fit is performed with pymatgen.
295328

296-
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).
329+
You can start the workflow as follows:
330+
```python
331+
from atomate2.vasp.flows.eos import EosMaker
332+
from pymatgen.core.structure import Structure
333+
334+
335+
structure = Structure(
336+
lattice=[[0, 2.13, 2.13], [2.13, 0, 2.13], [2.13, 2.13, 0]],
337+
species=["Mg", "O"],
338+
coords=[[0, 0, 0], [0.5, 0.5, 0.5]],
339+
)
340+
341+
qha_flow = EosMaker(
342+
linear_strain=(-0.10, 0.10),
343+
number_of_frames=10,
344+
).make(structure=structure)
345+
```
346+
347+
The output of the workflow is a dictionary by default containing the energy and volume data generated with DFT,
348+
in addition to fitted equation of state parameters for all models currently available in pymatgen
349+
(Murnaghan, Birch-Murnaghan, Poirier-Tarantola, and Vinet/UBER).
297350

298351
#### Materials Project-compliant workflows
299352

Diff for: src/atomate2/common/flows/eos.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CommonEosMaker(Maker):
3939
Maker to relax deformed structures for the EOS fit.
4040
static_maker : .Maker | None
4141
Maker to generate statics after each relaxation, defaults to None.
42-
strain : tuple[float]
42+
linear_strain : tuple[float]
4343
Percentage linear strain to apply as a deformation, default = -5% to 5%.
4444
number_of_frames : int
4545
Number of strain calculations to do for EOS fit, default = 6.

Diff for: src/atomate2/vasp/flows/eos.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class EosMaker(CommonEosMaker):
8383
Maker to relax deformed structures for the EOS fit.
8484
static_maker : .Maker | None
8585
Maker to generate statics after each relaxation, defaults to None.
86-
strain : tuple[float]
86+
linear_strain : tuple[float]
8787
Percentage linear strain to apply as a deformation, default = -5% to 5%.
8888
number_of_frames : int
8989
Number of strain calculations to do for EOS fit, default = 6.

0 commit comments

Comments
 (0)