Skip to content

Commit

Permalink
fix qha to fit new phonopy API
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetretto committed Sep 11, 2023
1 parent ece2770 commit cc34246
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 cc34246

Please sign in to comment.