The Planck constant appears throughout quantum mechanics, most famously in the relation connecting a photon's energy to its frequency, E equals h times f. Since 2019, like the speed of light, the Planck constant's value has been fixed by international definition, as part of redefining the kilogram in terms of fundamental constants rather than a physical reference object, making its value exact rather than an experimentally measured approximation with uncertainty.
1Understanding constants.h
The Planck constant appears throughout quantum mechanics, most famously in the relation connecting a photon's energy to its frequency, E equals h times f. Since 2019, like the speed of light, the Planck constant's value has been fixed by international definition, as part of redefining the kilogram in terms of fundamental constants rather than a physical reference object, making its value exact rather than an experimentally measured approximation with uncertainty.
Use constants.h together with a frequency to compute photon energy directly instead of looking up and hardcoding the Planck constant's numeric value yourself.
from scipy import constants
print(constants.h)2Practical Example
Here is a real-world application of constants.h showing how it is used in production SciPy code.
from scipy import constants
frequency = 5e14 # visible light, roughly green
energy = constants.h * frequency
print(f"{energy:.3e} joules")3Best Practices
Follow these guidelines when working with constants.h:
1. Use constants.h directly in energy/frequency calculations rather than hardcoding its numeric value
2. Check whether you need h or the reduced Planck constant, h-bar, which scipy.constants also provides separately as hbar, since physics formulas use different conventions
3. Keep consistent SI units throughout a calculation involving h, since it's expressed specifically in joule-seconds
Tip: Use constants.h together with a frequency to compute photon energy directly instead of looking up and hardcoding the Planck constant's numeric value yourself.
from scipy import constants
print(constants.h)