Skip to content

Commit f35466a

Browse files
authored
Merge pull request #12 from pyiron/docstring
add docstrings
2 parents 3701fbd + b0d7afe commit f35466a

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

pyiron_atomistics/atomistics/master/murnaghan.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,20 @@ def pouriertarantola(V, E0, B0, BP, V0):
591591

592592
# ToDo: not all abstract methods implemented
593593
class Murnaghan(AtomisticParallelMaster):
594+
"""
595+
Murnghan calculation to obtain the minimum energy volume and bulk modulus.
596+
597+
Example:
598+
599+
>>> pr = Project('my_project')
600+
>>> ref_job = pr.create_job('Lammps', 'lmp')
601+
>>> ref_job.structure = structure_of_your_choice
602+
>>> murn = ref_job.create_job('Murnaghan', 'murn')
603+
>>> murn.run()
604+
605+
The minimum energy volume and bulk modulus are stored in `ref_job['output/equilibrium_volume']`
606+
and `ref_job['output/equilibrium_bulk_modulus/']`.
607+
"""
594608
def __init__(self, project, job_name="murnaghan"):
595609
"""
596610

pyiron_atomistics/atomistics/master/quasi.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@ def calc_v0_from_fit_funct(fit_funct, x, save_range=0.0, return_ind=False):
4545

4646

4747
class QuasiHarmonicJob(AtomisticParallelMaster):
48+
"""
49+
Obtain finite temperature properties in the framework of quasi harmonic approximation. For the
50+
theoretical understanding take a look at the Wikipedia page:
51+
https://en.wikipedia.org/wiki/Quasi-harmonic_approximation
52+
53+
Example:
54+
55+
>>> pr = Project('my_project')
56+
>>> lmp = pr.create_job('Lammps', 'lmp')
57+
>>> lmp.structure = structure_of_your_choice
58+
>>> phono = lmp.create_job('PhonopyJob', 'phono')
59+
>>> qha = phono.create_job('QuasiHarmonicJob', 'qha')
60+
>>> qha.run()
61+
62+
The final results can be obtained through `qha.optimise_volume()`.
63+
64+
The temperature range defined in the input can be modified afterwards. For this, follow these
65+
lines:
66+
67+
>>> qha.input['temperature_end'] = temperature_end
68+
>>> qha.input['temperature_steps'] = temperature_steps
69+
>>> qha.input['temperature_start'] = temperature_start
70+
>>> qha.collect_output()
71+
"""
4872
def __init__(self, project, job_name="murnaghan"):
4973
"""
5074
@@ -104,6 +128,20 @@ def collect_output(self):
104128
hdf5_out[key] = val
105129

106130
def optimise_volume(self, bulk_eng):
131+
"""
132+
Get finite temperature properties.
133+
134+
Args:
135+
bulk_eng (numpy.ndarray): array of bulk energies corresponding to the box sizes given
136+
in the quasi harmonic calculations. For the sake of compatibility, it is strongly
137+
recommended to use the pyiron Murnaghan class (and make sure that you use the
138+
same values for `num_points` and `vol_range`).
139+
140+
Returns:
141+
volume, free energy, entropy, heat capacity
142+
143+
The corresponding temperature values can be obtained from `job['output/temperatures'][0]`
144+
"""
107145
v0_lst, free_eng_lst, entropy_lst, cv_lst = [], [], [], []
108146
for i, [t, free_energy, cv, entropy, v] in enumerate(
109147
zip(self["output/temperatures"].T,

0 commit comments

Comments
 (0)