Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix qha #270

Merged
merged 6 commits into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading