Skip to content

Commit

Permalink
Merge pull request #270 from gpetretto/develop
Browse files Browse the repository at this point in the history
fix qha
  • Loading branch information
gmatteo authored Sep 11, 2023
2 parents 0dff457 + cc34246 commit 305f9af
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions abipy/dfpt/qha.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ def write_phonopy_qha_inputs(self, tstart=0, tstop=2100, num=211, path=None) ->
with open(os.path.join(path, "thermal_properties-{}.yaml".format(j)), 'wt') as f:
f.write("\n".join(lines))

def get_phonopy_qha(self, tstart=0, tstop=2100, num=211, eos='vinet', t_max=None, energy_plot_factor=None):
def get_phonopy_qha(self, tstart=0, tstop=2100, num=211, eos='vinet', t_max=None,
energy_plot_factor=None, pressure=None):
"""
Creates an instance of phonopy.qha.core.QHA that can be used generate further plots and output data.
The object is returned right after the construction. The "run()" method should be executed
Expand All @@ -419,6 +420,7 @@ def get_phonopy_qha(self, tstart=0, tstop=2100, num=211, eos='vinet', t_max=None
"murnaghan" and "birch_murnaghan". Passed to phonopy's QHA.
t_max: maximum temperature. Passed to phonopy's QHA.
energy_plot_factor: factor multiplying the energies. Passed to phonopy's QHA.
pressure: pressure value, passed to phonopy.
Returns: An instance of phonopy.qha.core.QHA
"""
Expand All @@ -437,7 +439,18 @@ def get_phonopy_qha(self, tstart=0, tstop=2100, num=211, eos='vinet', t_max=None

en = self.energies + self.volumes * self.pressure / abu.eVA3_GPa

qha_p = QHA_phonopy(self.volumes, en, temperatures, cv, entropy, fe, eos, t_max, energy_plot_factor)
qha_p = QHA_phonopy(
volumes=self.volumes,
electronic_energies=en,
temperatures=temperatures,
cv=cv,
entropy=entropy,
fe_phonon=fe,
pressure=pressure,
eos=eos,
t_max=t_max,
energy_plot_factor=energy_plot_factor
)

return qha_p

Expand Down

0 comments on commit 305f9af

Please sign in to comment.