structures.atoms
#
Classes:
|
Smallest structural unit of which larger structures can be build. |
|
Representation of mixed atoms in alloys and stochiometric mixtures. |
- class udkm1Dsim.structures.atoms.Atom(symbol, **kwargs)[source]#
Bases:
object
Smallest structural unit of which larger structures can be build.
It holds real physical properties of on the atomic level.
- Parameters:
symbol (str) – symbol of the atom.
- Keyword Arguments:
id (str) – id of the atom, may differ from symbol and/or name.
ionicity (int) – ionicity of the atom.
atomic_form_factor_path (str) – path to atomic form factor coeffs.
atomic_form_factor_source (str) – either _henke_ or default _chantler_
magnetic_form_factor_path (str) – path to magnetic form factor coeffs.
- Attributes:
symbol (str) – symbol of the element.
id (str) – id of the atom, may differ from symbol and/or name.
name (str) – name of the element (generic).
atomic_number_z (int) – Z atomic number.
mass_number_a (float) – A atomic mass number.
ionicity (int) – ionicity of the atom.
mass (float) – mass of the atom [kg].
atomic_form_factor_coeff (ndarray[float]) – atomic form factor. coefficients for energy-dependent atomic form factor.
cromer_mann_coeff (ndarray[float]) – cromer-mann coefficients for angular-dependent atomic form factor.
magnetic_form_factor_coeff (ndarray[float]) – magnetic form factor coefficients for energy-dependent magnetic form factor.
mag_amplitude (float) – magnetization amplitude -1 .. 1.
mag_phi (float) – phi angle of magnetization [rad].
mag_gamma (float) – gamma angle of magnetization [rad].
References
Methods:
read_atomic_form_factor_coeff
([source, filename])The coefficients for the atomic form factor \(f\) in dependence of the photon energy \(E\) is read from a parameter file given by [1] or by [2] as default.
get_atomic_form_factor
(energy)The complex atomic form factor for the photon energy \(E\) [eV] is calculated by:
The Cromer-Mann coefficients (Ref.
get_cm_atomic_form_factor
(energy, qz)The atomic form factor \(f\) is calculated in dependence of the photon energy \(E\) [eV] and the \(z\)-component of the scattering vector \(q_z\) [Å \(^{-1}\)] (Ref.
read_magnetic_form_factor_coeff
([filename])The coefficients for the magnetic form factor \(m\) in dependence of the photon energy \(E\) is read from a parameter file.
get_magnetic_form_factor
(energy)The complex magnetic form factor is claculated by:
- read_atomic_form_factor_coeff(source='chantler', filename='')[source]#
The coefficients for the atomic form factor \(f\) in dependence of the photon energy \(E\) is read from a parameter file given by [1] or by [2] as default.
- Parameters:
source (str, optional) – source of atmoic form factors can be either _henke_ or _chantler_. Defaults to _chantler_.
filename (str, optional) – full path and filename to the atomic form factor coefficients.
- Returns:
f (ndarray[float]) – atomic form factor coefficients.
- get_atomic_form_factor(energy)[source]#
The complex atomic form factor for the photon energy \(E\) [eV] is calculated by:
\[f(E)=f_1 - i f_2\]Convention of Ref. [3] (p. 11, footnote) is a negative \(f_2\).
- Parameters:
energy (ndarray[float]) – photon energy [eV].
- Returns:
f (ndarray[complex]) – energy-dependent atomic form factors.
- read_cromer_mann_coeff()[source]#
The Cromer-Mann coefficients (Ref. [4]) are read from a parameter file and are returned in the following order:
\[a_1\; a_2\; a_3\; a_4\; b_1\; b_2\; b_3\; b_4\; c\]- Returns:
cm (ndarray[float]) – Cromer-Mann coefficients.
- get_cm_atomic_form_factor(energy, qz)[source]#
The atomic form factor \(f\) is calculated in dependence of the photon energy \(E\) [eV] and the \(z\)-component of the scattering vector \(q_z\) [Å \(^{-1}\)] (Ref. [4]). Note that the Cromer-Mann coefficients are fitted for \(q_z\) in [Å \(^{-1}\)]!
See Ref. [3] (p. 235).
\[f(q_z,E) = f_{CM}(q_z) + \delta f_1(E) -i f_2(E)\]\(f_{CM}(q_z)\) is given in Ref. [4]:
\[f_{CM}(q_z) = \sum(a_i \, \exp(-b_i \, (q_z/4\pi)^2))+ c\]\(\delta f_1(E)\) is the dispersion correction:
\[\delta f_1(E) = f_1(E) - \left(\sum^4_i(a_i) + c\right)\]Thus:
\[f(q_z,E) = \sum(a_i \, \exp(-b_i \, q_z/2\pi)) + c + f_1(E)-i f_2(E) - \left(\sum(a_i) + c\right)\]\[f(q_z,E) = \sum(a_i \, \exp(-b_i \, q_z/2\pi)) + f_1(E) -i f_2(E) - \sum(a_i)\]- Parameters:
energy (ndarray[float]) – photon energy [eV].
qz (ndarray[float]) – scattering vector [1/m].
- Returns:
f (ndarray[complex]) – energy- and qz-dependent Cromer-Mann atomic form factors.
- read_magnetic_form_factor_coeff(filename='')[source]#
The coefficients for the magnetic form factor \(m\) in dependence of the photon energy \(E\) is read from a parameter file.
- Parameters:
filename (str) – optional full path and filename to the magnetic form factor coefficients.
- Returns:
m (ndarray[float]) – magnetic form factor coefficients.
- get_magnetic_form_factor(energy)[source]#
The complex magnetic form factor is claculated by:
\[m(E) = m_1 - i m_2\]for the photon energy \(E\) [eV].
Convention of Ref. [3] (p. 11, footnote) is a negative \(m_2\)
- Parameters:
energy (ndarray[float]) – photon energy [eV].
- Returns:
m (ndarray[complex]) – energy-dependent magnetic form factors.
- class udkm1Dsim.structures.atoms.AtomMixed(symbol, **kwargs)[source]#
Bases:
Atom
Representation of mixed atoms in alloys and stochiometric mixtures.
All properties of the included sub-atoms of class Atom are averaged and weighted with their stochiometric ratio.
- Parameters:
symbol (str) – symbol of the atom.
- Keyword Arguments:
id (str) – id of the atom, may differ from symbol and/or name.
name (str) – name of the mixed atom, default is symbol.
atomic_form_factor_path (str) – path to atomic form factor coeffs.
magnetic_form_factor_path (str) – path to magnetic form factor coeffs.
- Attributes:
symbol (str) – symbol of the element.
id (str) – id of the atom, may differ from symbol and/or name.
name (str) – name of the mixed atom, default is symbol.
atomic_number_z (int) – Z atomic number.
mass_number_a (float) – A atomic mass number.
ionicity (int) – ionicity of the atom.
mass (float) – mass of the atom [kg].
atomic_form_factor_coeff (ndarray[float]) – atomic form factor. coefficients for energy-dependent atomic form factor.
magnetic_form_factor_coeff (ndarray[float]) – magnetic form factor coefficients for energy-dependent magnetic form factor.
mag_amplitude (float) – magnetization amplitude -1 .. 1.
mag_phi (float) – phi angle of magnetization [rad].
mag_gamma (float) – gamma angle of magnetization [rad].
atoms (list[Atoms]) – list of Atoms.
num_atoms (int) – number of atoms.
Methods:
add_atom
(atom, fraction)Add an Atom instance with its stochiometric fraction and recalculate averaged properties.
read_atomic_form_factor_coeff
([filename])The coefficients for the atomic form factor \(f\) in dependence of the photon energy \(E\) must be read from an external file given by
filename
.get_atomic_form_factor
(energy)Averaged energy dependent atomic form factor.
get_cm_atomic_form_factor
(energy, qz)Averaged energy and qz-dependent atomic form factors.
read_magnetic_form_factor_coeff
([filename])The coefficients for the magnetic form factor \(m\) in dependence of the photon energy \(E\) must be read from an external file given by
filename
.get_magnetic_form_factor
(energy)Mixed energy dependent magnetic form factors.
- add_atom(atom, fraction)[source]#
Add an Atom instance with its stochiometric fraction and recalculate averaged properties.
- Parameters:
atom (Atom) – atom to add.
fraction (float) – fraction of the atom - sum of all fractions must be 1.
- read_atomic_form_factor_coeff(filename='')[source]#
The coefficients for the atomic form factor \(f\) in dependence of the photon energy \(E\) must be read from an external file given by
filename
.- Parameters:
filename (str, optional) – full path and filename to the atomic form factor coefficients.
- Returns:
f (ndarray[float]) – atomic form factor coefficients.
- get_atomic_form_factor(energy)[source]#
Averaged energy dependent atomic form factor. If
atomic_form_factor_path
was given on initialization this file will be used instead.- Parameters:
energy (ndarray[float]) – photon energy [eV].
- Returns:
f (ndarray[complex]) – energy-dependent atomic form factors.
- get_cm_atomic_form_factor(energy, qz)[source]#
Averaged energy and qz-dependent atomic form factors.
- Parameters:
energy (ndarray[float]) – photon energy [eV].
qz (ndarray[float]) – scattering vector [1/m].
- Returns:
f (ndarray[complex]) – energy- and qz-dependent Cromer-Mann atomic form factors.
- read_magnetic_form_factor_coeff(filename='')[source]#
The coefficients for the magnetic form factor \(m\) in dependence of the photon energy \(E\) must be read from an external file given by
filename
.- Parameters:
filename (str) – optional full path and filename to the magnetic form factor coefficients.
- Returns:
m (ndarray[float]) – magnetic form factor coefficients.