1

I want to calculate boltzmann distribution which is e**-(b*dE). b is 1/kT where k is boltzmann constant and T is temperature. dE is delta energy.

I use from scipy.constants import k to get the value of k and import math to get the value of e. dE and T are integer.

Is there any library that can import to get the value of e^-(b*dE) easily?

Severin Pappadeux
  • 18,636
  • 3
  • 38
  • 64

1 Answers1

0

You should not use the ^ (xor) operator, but ** (pow):

e**-(b*dE)

Or:

import math
math.exp(-(b*dE))
Netwave
  • 40,134
  • 6
  • 50
  • 93