Detailed Balance¶
Detailed balance describes the relationship between the intensity of inelastic and quasielastic scattering at positive and negative energy transfers. The equation is $S(-{\bf Q}, E) = \exp(-\beta E) S({\bf Q}, E)$, where $E$ is the energy transfer, ${\bf {Q}}$ is the momentum transfer and $\beta=1/k_BT$ is the inverse of the temperature ($T$) multiplied by Boltzman's constant ($k_B$). To enforce this relationship, we can multiply our scattering function using the Detailed Balance Factor (DBF), defined by $DBF = E (1+n)$, where $n$ is the Bose occupation factor.
In some communities it is customary to normalise the DBF by temperature, i.e. $DBF_N = E/(k_B T) (1+n)$.
This notebook shows how to calculate and use the DBF. Note that it will be automatically applied if temperature is set, so you do not have to think about it.
Details on detailed balancing can be found in most textbooks on neutron scattering.
import matplotlib.pyplot as plt
import numpy as np
from easydynamics.utils import _detailed_balance_factor as detailed_balance_factor
%matplotlib widget
temperatures = [1, 10, 100]
temperature_unit = 'K'
energy = np.linspace(-1, 1, 100)
# energy=1.0
energy_unit = 'meV'
plt.figure()
for temperature in temperatures:
DBF = detailed_balance_factor(energy, temperature, energy_unit, temperature_unit)
plt.plot(energy, DBF, label=f'T={temperature} K')
plt.legend()
plt.xlabel('Energy transfer (meV)')
plt.ylabel('Detailed balance factor')
plt.title(
'Detailed balance factor for different temperatures, \n '
'normalized to 1 at zero energy transfer'
)
plt.show()
temperatures = [1, 10, 100]
temperature_unit = 'K'
energy = np.linspace(-1, 1, 100)
# energy=1.0
energy_unit = 'meV'
plt.figure()
for temperature in temperatures:
DBF = detailed_balance_factor(
energy, temperature, energy_unit, temperature_unit, divide_by_temperature=False
)
plt.plot(energy, DBF, label=f'T={temperature} K')
plt.legend()
plt.xlabel('Energy transfer (meV)')
plt.ylabel('Detailed balance factor')
plt.title('Detailed balance factor for different temperatures, not normalized')
plt.show()