Skip to content

Commit

Permalink
n_thermal back to normal definition
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuarezr committed Nov 18, 2024
1 parent 723e2f0 commit 47621ca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions qutip/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ def n_thermal(w, w_th):
return result.item() if w.ndim == 0 else result

non_zero = w != 0
# result[non_zero] = 1 / (np.exp(w[non_zero] / w_th) - 1)
# The same definition with no overflow warnings
result[non_zero] = np.exp(-w[non_zero] / w_th) / \
(1-np.exp(-w[non_zero] / w_th))
result[non_zero] = 1 / (np.exp(w[non_zero] / w_th) - 1)

return result.item() if w.ndim == 0 else result


Expand Down

0 comments on commit 47621ca

Please sign in to comment.