StructureFactor¶
The StructureFactor object contains the structure factor at every q-point and mode, and optionally a temperature if temperature-dependent effects such as the Debye-Waller factor were used in the calculation.
Calculating Scattering Intensities¶
The structure factors can be used to create a \(S(Q, \omega)\) map
with Q on the x-axis and energy on the y-axis using
StructureFactor.calculate_sqw_map
(see docstring for algorithm details). This requires an array of energy bin
edges as a pint.Quantity. Calculating the Bose population factor
is optional, but if calc_bose=True the temperature stored in
StructureFactor is used. If there is no temperature in StructureFactor,
then it must be provided in the function arguments. This function returns a
generic Spectrum2D object.
from euphonic import ureg, StructureFactor
sf = StructureFactor.from_json_file('sf_100K.json')
energy_bins = np.arange(-100, 101, 1)*ureg('meV')
sqw_map = sf.calculate_sqw_map(energy_bins calc_bose=True)
Docstring¶
-
class
StructureFactor(crystal, qpts, frequencies, structure_factors, temperature=None)¶ Stores the structure factor calculated per q-point and per phonon mode
Variables: - crystal (Crystal) – Lattice and atom information
- n_qpts (int) – Number of q-points in the object
- qpts ((n_qpts, 3) float ndarray) – Q-point coordinates, in fractional coordinates of the reciprocal lattice
- frequencies ((n_qpts, 3*crystal.n_atoms) float Quantity) – Phonon frequencies per q-point and mode
- structure_factors ((n_qpts, 3*crystal.n_atoms) float Quantity) – Structure factor per q-point and mode
- temperature (float Quantity or None) – The temperature used to calculate any temperature-dependent parts of the structure factor (e.g. Debye-Waller, Bose population factor). None if no temperature-dependent effects have been applied
-
__init__(crystal, qpts, frequencies, structure_factors, temperature=None)¶ Parameters: - crystal (Crystal) – Lattice and atom information
- qpts ((n_qpts, 3) float ndarray) – Q-point coordinates, in fractional coordinates of the reciprocal lattice
- frequencies ((n_qpts, 3*crystal.n_atoms) float Quantity) – Phonon frequencies per q-point and mode
- structure_factors ((n_qpts, 3*crystal.n_atoms) float Quantity) – Structure factor per q-point and mode
- temperature (float Quantity or None) – The temperature used to calculate any temperature-dependent parts of the structure factor (e.g. Debye-Waller, Bose population factor). None if no temperature-dependent effects have been applied
-
calculate_sqw_map(e_bins, calc_bose=True, temperature=None)¶ Bin the structure factor in energy and apply the Bose population factor to produce a a S(Q,w) map
Parameters: - e_bins ((n_e_bins + 1,) float Quantity) – The energy bin edges
- calc_bose (boolean, optional) – Whether to calculate and apply the Bose population factor
- temperature (float Quantity, optional) – The temperature to use to calculate the Bose factor. Is only required if StructureFactor.temperature = None, otherwise the temperature stored in StructureFactor will be used
Returns: sqw_map – A spectrum containing the q-point bins on the x-axis, energy bins on the y-axis and scattering intensities on the z-axis
Return type: Raises: ValueError– If a temperature is provided and isn’t consistent with the temperature in the StructureFactor objectNotes
StructureFactor.structure_factors is defined as \(|F(Q, \nu)|\) per unit cell. To create an \(S(Q,\omega)\) map, it is binned in energy and the Bose factor is applied [1]:
\[S(Q, \omega) = |F(Q, \nu)|^2 (n_\nu+\frac{1}{2}\pm\frac{1}{2}) \delta(\omega\mp\omega_{q\nu})\]\(n_\nu\) is the Bose-Einstein distribution:
\[n_\nu = \frac{1}{e^{\frac{\hbar\omega_\nu}{k_{B}T}} - 1}\][1] M.T. Dove, Structure and Dynamics, Oxford University Press, Oxford, 2003, 225-226
-
to_dict()¶ Convert to a dictionary. See StructureFactor.from_dict for details on keys/values
Returns: Return type: dict
-
to_json_file(filename)¶ Write to a JSON file. JSON fields are equivalent to StructureFactor.from_dict keys
Parameters: filename (str) – Name of the JSON file to write to
-
classmethod
from_dict(d)¶ Convert a dictionary to a StructureFactor object
Parameters: d (dict) – A dictionary with the following keys/values:
- ’crystal’: dict, see Crystal.from_dict
- ’qpts’: (n_qpts, 3) float ndarray
- ’frequencies’: (n_qpts, 3*crystal.n_atoms) float ndarray
- ’frequencies_unit’: str
- ’structure_factors’: (n_qpts, 3*crystal.n_atoms) float ndarray
- ’structure_factors_unit’: str
There are also the following optional keys:
- ’temperature’: float
- ’temperature_unit’: str
Returns: Return type: StructureFactor
-
classmethod
from_json_file(filename)¶ Read from a JSON file. See StructureFactor.from_dict for required fields
Parameters: filename (str) – The file to read from Returns: Return type: StructureFactor