theory

New in version 1.0.3.

Module for theoretical calculations.

nexus.theory.CoherenceTime(coherence_length)

Calculates the coherence time of a given longitudinal coherence length \(\xi_{\parallel}\)

\[\tau = \frac{\xi_{\parallel}}{c}.\]

New in version 1.0.3.

Parameters:

coherence_length (float) – longitudinal coherence length (m).

Returns:

coherence time (s).

Return type:

float

nexus.theory.CrossSection(energy, isotope)

Calculates the absorption cross section [Gonser]

\[I = \sigma_0 \frac{\Gamma^2}{4(E-E_0)^2+\Gamma^2}\]

New in version 1.0.3.

Parameters:
  • energy (float or list or ndarray) – energy value(s) (eV).

  • isotope (MoessbauerIsotope) – Isotope for the calculation.

Returns:

absorption.

Return type:

float or ndarray

nexus.theory.DebyeTemperatureImpurity(Debye_temperature, mass_host, mass_impurity)

Calculates the Debye temperature for an impurity atom in a host matrix [Gonser]

\[\Theta^I_D = \sqrt{\frac{M_{host}}{M_{impurity}}}\Theta_D\]

New in version 1.0.3.

Parameters:
  • Debye_temperature (float) – Debye temperature of the host material (K).

  • mass_host (float) – mass of the host atom.

  • mass_impurity (float) – mass of the impurity atom.

Returns:

Debye temperature of the impurity (K).

Return type:

float

nexus.theory.DopplerEnergy(value, velocity)

Calculates the Doppler shifted energy or frequency [Gonser]

\[E_{\gamma} = \left(1 + \frac{v}{c}\right) E_0\]
Parameters:
  • value (float) – energy or frequency in units of choice.

  • velocity (float) – velocity (m/s).

Returns:

shifted energy or frequency.

Return type:

float

nexus.theory.DopplerShift(value, velocity)

Calculates the Doppler shift of energy or frequency [Gonser]

\[\Delta E = \frac{v}{c} E\]
Parameters:
  • value (float) – energy or frequency in units of choice.

  • velocity (float) – velocity (m/s).

Returns:

Doppler shift of energy or frequency.

Return type:

float

nexus.theory.HalfLifetime(lifetime)

Calculates the half lifetime \(t_{\frac{1}{2}}\) [Gonser]

\[t_{\frac{1}{2}} = \ln(2) \tau\]
Parameters:

lifetime (float) – lifetime \(\tau\) (arb. units).

Returns:

half lifetime (in units of lifetime).

Return type:

float

nexus.theory.LambMoessbauerDebye(temperature, Debye_temperature, energy, mass)

Calculates the Lamb Moessbauer factor in the Debye model [Gonser]

\[f_{LM} = \exp\left( -\frac{3 E_R}{2k_B\Theta_D} \left( 1+ 4 \left(\frac{T}{\Theta_D}\right)^2 \int_0^{\frac{\Theta_D}{T}} \frac{x}{e^x-1}dx \right) \right)\]

New in version 1.0.3.

Parameters:
  • temperature (float) – real temperature (K).

  • Debye_temperature (float) – Debye temperature (K).

  • energy (float) – Photon energy (eV).

  • mass (float) – mass in atomic mass units (amu).

Returns:

Lamb Moessbauer factor.

Return type:

float

nexus.theory.LambMoessbauerDebyeIsotope(temperature, Debye_temperature, isotope)

Calculates the Lamb Moessbauer factor in the Debye model [Gonser]

\[f_{LM} = \exp\left( -\frac{3 E_R}{2k_B\Theta_D} \left( 1+ 4 \left(\frac{T}{\Theta_D}\right)^2 \int_0^{\frac{\Theta_D}{T}} \frac{x}{e^x-1}dx \right) \right)\]

New in version 1.0.3.

Parameters:
  • temperature (float) – real temperature (K).

  • Debye_temperature (float) – Debye temperature (K).

  • isotope (MoessbauerIsotope) – isotope for the calculation.

Returns:

Lamb Moessbauer factor.

Return type:

float

nexus.theory.LongitudinalCoherence(wavelength, bandwidth)

Calculates the longitudinal coherence length for a given wavelength and its bandwidth via

\[\xi_{\parallel} = \left(\frac{\lambda}{2}\right) \left(\frac{\lambda}{\Delta\lambda}\right)\]

New in version 1.0.3.

Parameters:
  • wavelength (float) – Photon wavelength \(\lambda\) (m).

  • bandwidth (float) – Photon wavelength bandwidth \(\Delta\lambda\) in (m).

Returns:

longitudinal coherence length (m).

Return type:

float

nexus.theory.LongitudinalCoherenceEnergy(energy, bandwidth)

Calculates the longitudinal coherence length for a given energy and its bandwidth.

\[\xi_{\parallel} = \hbar c \frac{1 + \frac{\Delta E}{E}}{2 \Delta E}\]

New in version 1.0.3.

Parameters:
  • energy (float) – Photon energy (eV).

  • bandwidth (float) – Photon energy bandwidth \(\Delta E\) in (eV).

Returns:

longitudinal coherence length (m).

Return type:

float

nexus.theory.LongitudinalCoherenceFromTime(coherence_time)

Calculates the longitudinal coherence length from a given coherence time \(\tau\)

\[\xi_{\parallel} = \tau c\]

New in version 1.0.3.

Parameters:

coherence_time (float) – coherence time (s).

Returns:

longitudinal coherence length (m).

Return type:

float

nexus.theory.MagneticEnergy(m, g, Bhf)

Calculates the magnetic energy due to a hyperfine field [Gonser]

\[E = -mg \mu_N B_{hf}\]

New in version 1.0.3.

Parameters:
  • isotope (MoessbauerIsotope) – Isotope for the calculation.

  • Bhf (float) – Magnetic hyperfine field (T).

Returns:

energy (eV).

Return type:

float

nexus.theory.MagneticEnergyDifference(mg, gg, me, ge, Bhf)

Calculates the magnetic energy difference of magnetically split lines [Gonser]

\[\Delta E =\left(m_e g_e - m_g g_g \right)\mu_N B_{hf}\]

New in version 1.0.3.

Parameters:
  • mg (float) – magnetic quantum number of the ground state.

  • gg (float) – g factor of the ground state.

  • me (float) – magnetic quantum number of the excited state.

  • ge (float) – g factor of the excited state.

  • Bhf (float) – Magnetic hyperfine field (T).

Returns:

energy (eV).

Return type:

float

nexus.theory.MagneticSplittingSextet(isotope, Bhf)

Calculates the outer line splitting of a magnetic sextet, like for Fe57,

\[\Delta E = B_{hf} \mu_N \left(3|g_e| + |g_g| \right).\]

New in version 1.0.3.

Parameters:
  • isotope (MoessbauerIsotope) – Isotope for the calculation.

  • Bhf (float) – Magnetic hyperfine field (T)

Returns:

energy (eV).

Return type:

float

nexus.theory.MagneticSplittingSextetVelocity(isotope, Bhf)

Calculates the outer line splitting velocity of a magnetic sextet, like for Fe57, in units of velocity

New in version 1.0.3.

Parameters:
  • isotope (MoessbauerIsotope) – Isotope for the calculation.

  • Bhf (float) – Magnetic hyperfine field (T).

Returns:

velocity spacing (mm/s).

Return type:

float

nexus.theory.NuclearMagneticMoment(g, I)

Calculates the nuclear magnetic moment [Gonser] and [Drago]

\[\mu = g \mu_N I\]

New in version 1.0.3.

Parameters:
  • g (float) – g-factor of the (ground or excited) state.

  • I (float) – Spin of the (ground or excited) state.

Returns:

nuclear magnetic moment (eV/T).

Return type:

float

nexus.theory.QuadrupoleEnergy(I, m, Q, Vzz, asymmetry)

Calculates the quadrupole energy for I=3/2 [Gonser] and [Drago]

\[E = \frac{eQV_{zz}}{4I(2I+1)} \left(3m^2-I(I+1))\right) \sqrt{1 + \frac{\eta^2}{3}},\]

New in version 1.0.3.

Parameters:
  • I (float) – Spin of the (ground or excited) state \(I\).

  • m (float) – magnetic quantum number \(m = -I, ..., I\).

  • Q (float) – Quadrupole moment (barn).

  • Vzz (float) – Electric field gradient along main axis (V/m2).

  • asymmetry – Asymmetry parameter \(\eta\) (dimensionless 0 to 1).

Returns:

Quadrupole energy (eV).

Return type:

float

nexus.theory.QuadrupoleSplittingDoublet(Q, Vzz, asymmetry)

Calculates the quadrupole splitting for a doublet (I = 3/2) [Gonser] and [Drago]

\[\Delta E = \frac{eQV_{zz}}{2} \sqrt{1 + \frac{\eta^2}{3}},\]

New in version 1.0.3.

Parameters:
  • Q (float) – Quadrupole moment (barn).

  • Vzz (float) – Electric field gradient along main axis (V/m2). Note, \(V_{zz} = eq_{zz}\), where \(q_{zz}\) is the direction of the z-axis of the field gradient.

  • asymmetry – Asymmetry parameter \(\eta\) (dimensionless 0 to 1).

Returns:

Quadrupole energy (eV).

Return type:

float

nexus.theory.QuadrupoleSplittingDoubletVelocity(isotope, Q, Vzz, asymmetry)

Calculates the quadrupole splitting for a doublet (I = 3/2) in units of the velocity [Gonser] and [Drago]

New in version 1.0.3.

Parameters:
  • isotope (MoessbauerIsotope) – Isotope for the calculation.

  • Q (float) – Quadrupole moment (barn).

  • Vzz (float) – Electric field gradient along main axis (V/m2). Note, \(V_{zz} = eq_{zz}\), where \(q_{zz}\) is the direction of the z-axis of the field gradient.

  • asymmetry – Asymmetry parameter \(\eta\) (dimensionless 0 to 1).

Returns:

velocity spacing (mm/s).

Return type:

float

nexus.theory.RecoilEnergy(energy, mass)

Calculates the recoil energy of a photon at mass \(m\) [Gonser]

\[R = \frac{E^2}{2mc^2}\]
Parameters:
  • energy (float) – Photon energy (eV).

  • mass (float) – mass in atomic mass units (amu).

Returns:

recoil energy (eV).

Return type:

float

nexus.theory.RecoilEnergyIsotope(isotope)

Calculates the recoil energy of a photon at a specific isotope [Gonser]

\[R = \frac{E^2}{2m_{I}c^2}\]

New in version 1.0.3.

Parameters:

energy (MoessbuaerIsotope) – Isotope for the calculation.

Returns:

recoil energy (eV).

Return type:

float

nexus.theory.SecondOrderDopplerDebye(temperature, Debye_temperature, energy, mass)

Calculates the second order Doppler shift for a given temperature in the Debye model [Tanaka]

\[\Delta E = -E \frac{9 k_B \Theta_D}{16 M c^2} \left( 1 + 8 \left(\frac{T}{\Theta_D}\right)^4 \int_0^{\frac{\Theta_D}{T}} \frac{x^3}{e^x-1}dx \right)\]

New in version 1.0.3.

Parameters:
  • temperature (float) – real temperature (K).

  • Debye_temperature (float) – Debye temperature (K).

  • energy (float) – Transition energy (eV).

  • mass (float) – atomic mass in atomic units (amu).

Returns:

Energy shift (eV).

Return type:

float

nexus.theory.SecondOrderDopplerDebyeIsotope(temperature, Debye_temperature, isotope)

Calculates the second order Doppler shift for a given temperature in the Debye model [Tanaka]

\[\Delta E = -E \frac{9 k_B \Theta_D}{16 M c^2} \left( 1 + 8 \left(\frac{T}{\Theta_D}\right)^4 \int_0^{\frac{\Theta_D}{T}} \frac{x^3}{e^x-1}dx \right)\]

New in version 1.0.3.

Parameters:
  • temperature (float) – real temperature (K).

  • Debye_temperature (float) – Debye temperature (K).

  • isotope (MoessbauerIsotope) – isotope for the calculation.

Returns:

Energy shift (eV).

Return type:

float

nexus.theory.SecondOrderDopplerDebyeVelocity(temperature, Debye_temperature, mass)

Calculates the second order Doppler shift in units of velocity for a given temperature in the Debye model.

\[SOD = -\frac{9 k_B \Theta_D}{16 M c} \left( 1 + 8 \left(\frac{T}{\Theta_D}\right)^4 \int_0^{\frac{\Theta_D}{T}} \frac{x^3}{e^x-1}dx \right)\]

New in version 1.0.4.

Parameters:
  • temperature (float) – real temperature (K).

  • Debye_temperature (float) – Debye temperature (K).

  • mass (float) – atomic mass in atomic units (amu).

Returns:

SOD (mm/s).

Return type:

float

nexus.theory.SecondOrderDopplerDebyeVelocityIsotope(temperature, Debye_temperature, isotope)

Calculates the second order Doppler shift in units of velocity for a given temperature in the Debye model.

\[SOD = -\frac{9 k_B \Theta_D}{16 M c} \left( 1 + 8 \left(\frac{T}{\Theta_D}\right)^4 \int_0^{\frac{\Theta_D}{T}} \frac{x^3}{e^x-1}dx \right)\]

New in version 1.0.4.

Parameters:
  • temperature (float) – real temperature (K).

  • Debye_temperature (float) – Debye temperature (K).

  • isotope (MoessbauerIsotope) – isotope for the calculation.

Returns:

SOD (mm/s).

Return type:

float

nexus.theory.SecondOrderDopplerShift(velocity_mean, energy)

Calculates the second order Doppler shift for a given mean squared velocity [Josephson]

\[\Delta E = -E \frac{\langle v^2 \rangle}{2 c^2}.\]

New in version 1.0.3.

Parameters:
  • velocity_mean (float) – Mean squared velocity ((m/s) 2 ).

  • energy (float) – Energy of the transition (eV).

Returns:

Change in energy due to second order Doppler shift (eV).

Return type:

float

nexus.theory.SecondOrderDopplerVelocityShift(velocity_mean)

Calculates the second order Doppler shift for a given mean squared velocity [Nasu]

\[\Delta v = -\frac{\langle v^2 \rangle }{2 c}.\]

New in version 1.0.3.

Parameters:

velocity_mean (float) – Mean squared velocity ((m/s) 2 ).

Returns:

Change in velocity due to second order Doppler shift (mm/s).

Return type:

float

nexus.theory.TransverseCoherence(wavelength, source_size, source_distance)

Calculates the transverse coherence

\[\xi_{\perp} = \left(\frac{\lambda}{2}\right) \left(\frac{d}{s}\right)\]

This equation should be used for vertical and horizontal directions independently.

New in version 1.0.3.

Parameters:
  • wavelength (float) – wavelength \(\lambda\) (m).

  • source_size (float) – Source size \(s\) in (m).

  • source_distance (float) – Source distance \(d\) in (m).

Returns:

transverse coherence length (m).

Return type:

float

nexus.theory.TransverseCoherenceEnergy(energy, source_size, source_distance)

Calculates the transverse coherence

\[\xi_{\perp} = \left(\frac{hc}{2E}\right) \left(\frac{d}{s}\right)\]

This equation should be used for vertical and horizontal directions independently.

New in version 1.0.3.

Parameters:
  • energy (float) – energy (eV).

  • source_size (float) – Source size \(s\) in (m).

  • source_distance (float) – Source distance \(d\) in (m).

Returns:

transverse coherence length (m).

Return type:

float

nexus.theory.TransverseCoherenceNRS(energy, source_size, source_distance, detector_size, detector_distance, sample_size=None)

Calculates the transverse coherence via

\[\xi_{\perp} = \left(\frac{hc}{2 E}\right) \left(\frac{1}{\pi\sigma}\right) \textrm{ with } \sigma^2 = \left( \frac{\sigma_0}{S} \right)^2 + \left( \frac{\sigma_d}{D} \right)^2 + \left( \frac{\sigma_s}{D}+\frac{\sigma_s}{S} \right)^2 + \frac{1}{4k^2\sigma_s^2}\]

see [Baron96], [Baron99].

Here, especially the detector size typically determines the transverse coherence. This equation should be used for vertical and horizontal directions independently.

New in version 1.0.3.

Parameters:
  • energy (float) – Photon energy (eV).

  • source_size (float) – Source size (Gaussian \(\sigma_0\)) (m).

  • source_distance (float) – Source-sample distance \(S\) (m).

  • detector_size (float) – Detector size (Gaussian \(\sigma_d\)) (m).

  • detector_distance (float) – Detector-sample distance \(D\) (m).

  • sample_size (float) – Sample size (Gaussian \(\sigma_s\)) (m), illuminated part, optional.

Returns:

transverse coherence length (m).

Return type:

float