abinslib.almost_isotropic_incoherent¶
Semi-analytic powder averaging approximations in CLIMAX/AbINS lineage.
Functions¶
Calculate fundamental mode intensities in almost-isotropic approximation. |
|
Calculate second-order mode intensities in almost-isotropic approximation. |
|
Calculate INS intensities in almost-isotropic incoherent approximation. |
|
|
Calculate two-phonon intensities in almost-isotropic incoherent approximation. |
|
Calculate two-phonon intensities in almost-isotropic incoherent approximation. |
Calculate two-phonon intensities with approximations from Abins-Mantid. |
Module Contents¶
- abinslib.almost_isotropic_incoherent.calculate_almost_isotropic_incoherent_fundamentals(mode_displacements: abinslib.displacements.Displacements, atomic_displacements: euphonic.Quantity, nominal_q2: euphonic.Quantity) numpy.ndarray[source]¶
Calculate fundamental mode intensities in almost-isotropic approximation.
S = exp(-(Q^2 tr(A + 2 tr(A:B)/tr(B))/5)) Q^2 tr(B) / 3
Fundamentals only
Atomic cross sections not applied
Ignore actual q-points and use nominal Q^2 instead
- Parameters:
mode_displacements – phonon mode displacement dataset
atomic_displacements – thermal average atomic displacements indexed (atom, direction, direction)
nominal_q2 – Scalar Q^2 values corresponding to modes; note that all q-points are used and this is typically related to the mode frequency by neutron instrument parameters.
- Returns:
Dimensionless mode intensities with array indices (qpt, mode, atom)
- abinslib.almost_isotropic_incoherent.calculate_almost_isotropic_incoherent_combinations(mode_displacements: abinslib.displacements.Displacements, atomic_displacements: euphonic.Quantity, nominal_q2: euphonic.Quantity, include_dw: bool = False) numpy.ndarray[source]¶
Calculate second-order mode intensities in almost-isotropic approximation.
- S(Q, ω_ν + ω_ν’) =
exp(-Q^2 tr(A/3)) Q^4 / 15C (tr(B_ν)tr(B_ν’) + B_ν:B_ν’ + B_ν’:B_ν)
for some atom, where C = 2 if ν=ν’ else 1
Atomic cross sections not applied
Ignore actual q-points and use nominal Q^2 instead
Note that this has cubic scaling with system size as n_modes ∝ n_atoms; while this reference implementation constructs the whole array, memory-efficient approaches need to reduce the data to binned spectra on-the-fly.
It is also possible to reduce the calculation effort by calculating at constant Q and rescaling the intensity based on post-binning Q values; this is implemented in
q_scaling_almost_isotropic_incoherent_combination_spectra()- Parameters:
mode_displacements – phonon mode displacement dataset
atomic_displacements – thermal average atomic displacements indexed (atom, direction, direction)
nominal_q2 – Scalar Q^2 values corresponding to modes; note that all q-points are used and this is typically related to the mode frequency by neutron instrument parameters.
include_dw – Include mode-by-mode Debye-Waller intensity scaling
- Returns:
Dimensionless combination mode intensities with array indices (qpt1, mode1, qpt2, mode2, atom)
- abinslib.almost_isotropic_incoherent.calculate_almost_isotropic_incoherent_spectra(modes: euphonic.QpointPhononModes, mode_displacements: abinslib.displacements.Displacements, atomic_displacements: euphonic.Quantity, nominal_q2: euphonic.Quantity, bins: euphonic.Quantity, apply_cross_section: bool = True) euphonic.spectra.Spectrum1DCollection[source]¶
Calculate INS intensities in almost-isotropic incoherent approximation.
Actual q-points of phonon modes will be disregarded; instead each mode intensity will be based on a separate array of nominal Q^2 values corresponding to modes. This is intended to approximate powder-averaging with kinematic constraints: for indirect geometry the energy-Q^2 relationship can be determined using abinslib.utils.calculate_indirect_q2.
- Parameters:
modes – phonon frequency and eigenvector dataset
mode_displacements – phonon mode displacement dataset (This can be obtained using
Displacements.from_modes(modes)().)atomic_displacements – thermal average atomic displacements indexed (atom, direction, direction)
nominal_q2 – Scalar Q^2 values corresponding to modes; note that all q-points are used and this is typically related to the mode frequency by neutron instrument parameters.
bins – Energy or frequency bins used as x_data in resulting spectra
apply_cross_section – Multiply each atom/isotope spectrum by a corresponding total neutron scattering cross-section (σ_tot).
- Returns:
binned spectra of contribution from each nucleus
- abinslib.almost_isotropic_incoherent.calculate_almost_isotropic_incoherent_combination_spectra(modes: euphonic.QpointPhononModes, mode_displacements: abinslib.displacements.Displacements, atomic_displacements: euphonic.Quantity, nominal_q2: euphonic.Quantity, bins: euphonic.Quantity, apply_cross_section: bool = True) euphonic.spectra.Spectrum1DCollection[source]¶
Calculate two-phonon intensities in almost-isotropic incoherent approximation.
Actual q-points of phonon modes will be disregarded; instead each mode intensity will be based on a separate array of nominal Q^2 values corresponding to modes. This is intended to approximate powder-averaging with kinematic constraints: for indirect geometry the energy-Q^2 relationship can be determined using abinslib.utils.calculate_indirect_q2.
These should be determined for each two-phonon combination
- Parameters:
modes – phonon frequency and eigenvector dataset
mode_displacements – phonon mode displacement dataset (This can be obtained using
Displacements.from_modes(modes)().)atomic_displacements – thermal average atomic displacements indexed (atom, direction, direction)
nominal_q2 – Scalar Q^2 values for each combination of two fundamental modes, indexed by (q, band, q, band). This is typically related to the combination mode frequency by neutron instrument parameters.
bins – Energy or frequency bins used as x_data in resulting spectra
apply_cross_section – Multiply each atom/isotope spectrum by a corresponding total neutron scattering cross-section (σ_tot).
- Returns:
binned spectra of contribution from each nucleus
- abinslib.almost_isotropic_incoherent.q_scaling_almost_isotropic_incoherent_combination_spectra(modes: euphonic.QpointPhononModes, mode_displacements: abinslib.displacements.Displacements, atomic_displacements: euphonic.Quantity, nominal_q2: euphonic.Quantity, bins: euphonic.Quantity, apply_cross_section: bool = True) euphonic.spectra.Spectrum1DCollection[source]¶
Calculate two-phonon intensities in almost-isotropic incoherent approximation.
Actual q-points of phonon modes will be disregarded; instead each mode intensity will be based on a separate array of nominal Q^2 values corresponding to modes. This is intended to approximate powder-averaging with kinematic constraints.
Here we also make the “optimisation” that intensities are initially calculated at Q=1 and then re-scaled after binning. (Not actually a big computational optimisation here as we still multiply a large Q2 array, but it imitates the Mantid implementation.)
- Parameters:
modes – phonon frequency and eigenvector dataset
mode_displacements – phonon mode displacement dataset (This can be obtained using
Displacements.from_modes(modes)().)atomic_displacements – thermal average atomic displacements indexed (atom, direction, direction)
nominal_q2 – Scalar Q^2 values corresponding to bin centres. For indirect geometry the energy-Q^2 relationship can be determined using abinslib.utils.calculate_indirect_q2.
bins – Energy or frequency bins used as x_data in resulting spectra
apply_cross_section – Multiply each atom/isotope spectrum by a corresponding total neutron scattering cross-section (σ_tot).
- Returns:
binned spectra of contribution from each nucleus
- abinslib.almost_isotropic_incoherent.mantid_like_combination_spectra(modes: euphonic.QpointPhononModes, mode_displacements: abinslib.displacements.Displacements, atomic_displacements: euphonic.Quantity, nominal_q2: euphonic.Quantity, bins: euphonic.Quantity, apply_cross_section: bool = True) euphonic.spectra.Spectrum1DCollection[source]¶
Calculate two-phonon intensities with approximations from Abins-Mantid.
Currently the emphasis is on reproducibility, not efficiency.
DOS-like almost-isotropic incoherent approximation (i.e. semi-analytic powder-averaging equations with traces and contractions)
Calculate at nominal Q=1, rescale for Q4 relation and apply Debye-Waller _after_ binning
Treat each input q-point independently: - only consider combination modes at each q - weight each of these spectra with the weight of corresponding q
Order-2 scale factor is 1/60 for overtones and 1/30 for combinations
DW factor is still correctly averaged over q-point contributions
- Parameters:
modes – phonon frequency and eigenvector dataset
mode_displacements – phonon mode displacement dataset (This can be obtained using
Displacements.from_modes(modes)().)atomic_displacements – thermal average atomic displacements indexed (atom, direction, direction)
nominal_q2 – Scalar Q^2 values corresponding to bin centres. For indirect geometry the energy-Q^2 relationship can be determined using abinslib.utils.calculate_indirect_q2.
bins – Energy or frequency bins used as x_data in resulting spectra
apply_cross_section – Multiply each atom/isotope spectrum by a corresponding total neutron scattering cross-section (σ_tot).
- Returns:
binned spectra of contribution from each nucleus