Hyperfine
- class nexus.Hyperfine(id='', weight=1.0, isomer=0.0, magnetic_field=0.0, magnetic_theta=0.0, magnetic_phi=0.0, quadrupole=0.0, quadrupole_alpha=0.0, quadrupole_beta=0.0, quadrupole_gamma=0.0, quadrupole_asymmetry=0.0, texture=1.0, lamb_moessbauer=0.0, broadening=1.0, isomer_dist=None, magnetic_field_dist=None, magnetic_theta_dist=None, magnetic_phi_dist=None, quadrupole_dist=None, quadrupole_alpha_dist=None, quadrupole_beta_dist=None, quadrupole_gamma_dist=None, quadrupole_asymmetry_dist=None, isotropic=False)
Defines a set of hyperfine parameters acting on a Moessbauer isotope. Parameters can have distributions of type
Distribution
. Special random 2D and 3D distributions are available.- Parameters:
id (string) – User identifier.
weight (float or
Var
) – Relative weight of the site, > 0.isomer (float or
Var
) – Isomer shift (mm/s).magnetic_field (float or
Var
) – Magnetic hyperfine field amplitude (Tesla).magnetic_theta (float or
Var
) – Polar angle of the magnetic field with respect to the beam propagation direction - photon \(k\) vector (degree).magnetic_phi (float or
Var
) – Azimuthal angle of the magnetic field with respect to the \(sigma\) direction of the beam (degree).quadrupole (float or
Var
) – Quadrupole splitting (\(QS\)) value (mm/s). It is :math: QS = frac{c}{E_{trans}} frac{eQ_iV_{zz}}{2}`, with \(Q_i\) being the quadrupole moment of ground or excited state. For isotopes with only one quadrupole split state, the given value represents the value of the split state. For isotopes with split ground and excited state, it represents the quadrupole splitting of the excited state. The ground state quadrupole energy is then scaled by the ratio of the quadrupole moments \(Q_g/Q_e\).quadrupole_alpha (float or
Var
) – Euler angle of the electric field gradient \(\alpha\) in extrinsic ZYZ convention (degree).quadrupole_beta (float or
Var
) – Euler angle of the electric field gradient \(\beta\) in extrinsic ZYZ convention (degree).quadrupole_gamma (float or
Var
) – Euler angle of the electric field gradient \(\gamma\) in extrinsic ZYZ convention (degree).quadrupole_asymmetry (float or
Var
) – Asymmetry parameter of the electric field gradient, 0 to 1.texture (float or
Var
) –Texture coefficient between 0 and 1. It assumes the directional parameters of the site with a ratio of
texture
and a 3D isotropic distribution of the parameters with the ration1 - texture
. If isotropic isTrue
it is not taken into account. Setting texture to0
is the same as to set isotropic toTrue
.Added in version 1.2.0.
lamb_moessbauer (float or
Var
) –Lamb-Moessbauer factor of the hyperfine site. Only used when the
lamb_moessbauer
of the material isNone
.Added in version 1.2.0.
broadening (float or
Var
) –Optional inhomogeneous broadening parameter. It multiplies with the natural linewidth.
Added in version 1.2.0.
isomer_dist (
Distribution
) – Distribution to the isomer shift (mm/s).magnetic_field_dist (
Distribution
) – Distribution to the magnetic hyperfine field amplitude (Tesla).magnetic_theta_dist (
Distribution
) – Distribution to the polar angle of the magnetic field with respect to the beam propagation direction - photon \(k\) vector (degree).magnetic_phi_dist (
Distribution
) – Distribution to the azimuthal angle of the magnetic field with respect to the \(sigma\) direction of the beam (degree).quadrupole_dist (
Distribution
) – Distribution to the quadrupole splitting amplitude (mm/s).quadrupole_alpha_dist (
Distribution
) – Distribution to the Euler angle of the electric field gradient \(\alpha\) in extrinsic ZYZ convention (degree).quadrupole_beta_dist (
Distribution
) – Distribution to the Euler angle of the electric field gradient \(\beta\) in extrinsic ZYZ convention (degree).quadrupole_gamma_dist (
Distribution
) – Distribution to the Euler angle of the electric field gradient \(\gamma\) in extrinsic ZYZ convention (degree).quadrupole_asymmetry_dist (
Distribution
) – Distribution to the asymmetry parameter of the electric field gradient, 0 to 1.isotropic (bool) –
If True the hyperfine site is set to 3D angular distribution. The site parameters (the angels between the magnetic field and the quadrupole) are fixed.
Changed in version 1.2.0: Prior to version 1.2.0, it overrides all other distributions on angular values applied to the Hyperfine object. Since version 1.2.0 the random distributions are kept.
- id
User identifier.
- Type:
string
- magnetic_theta
Polar angle of the magnetic field with respect to the beam propagation direction - photon \(k\) vector (degree).
- Type:
- magnetic_phi
Azimuthal angle of the magnetic field with respect to the \(sigma\) direction of the beam (degree).
- Type:
- quadrupole
Quadrupole splitting (\(QS\)) value (mm/s). It is :math: QS = frac{c}{E_{trans}} frac{eQ_iV_{zz}}{2}`, with \(Q_i\) being the quadrupole moment of ground or excited state. For isotopes with only one quadrupole split state, the given value represents the value of the split state. For isotopes with split ground and excited state, it represents the quadrupole splitting of the excited state. The ground state quadrupole energy is then scaled by the ratio of the quadrupole moments \(Q_g/Q_e\).
- Type:
float or
Var
- quadrupole_alpha
Euler angle of the electric field gradient \(\alpha\) in extrinsic ZYZ convention (degree).
- Type:
- quadrupole_beta
Euler angle of the electric field gradient \(\beta\) in extrinsic ZYZ convention (degree).
- Type:
- quadrupole_gamma
Euler angle of the electric field gradient \(\gamma\) in extrinsic ZYZ convention (degree).
- Type:
- texture
Texture coefficient between 0 and 1. It assumes the directional parameters of the site with a ratio of
texture
and a 3D isotropic distribution of the parameters with the ration1 - texture
. If isotropic isTrue
it is not taken into account. Setting texture to0
is the same as to set isotropic toTrue
.Added in version 1.2.0.
- Type:
- lamb_moessbauer
Lamb-Moessbauer factor of the hyperfine site. Only used when the
lamb_moessbauer
of the material isNone
.Added in version 1.2.0.
- Type:
- broadening
Optional inhomogeneous broadening parameter. It multiplies with the natural linewidth.
Added in version 1.2.0.
- Type:
float or
Var
- isomer_dist
Distribution to the isomer shift (mm/s).
- Type:
- magnetic_field_dist
Distribution to the magnetic hyperfine field amplitude (Tesla).
- Type:
- magnetic_theta_dist
Distribution to the polar angle of the magnetic field with respect to the beam propagation direction - photon \(k\) vector (degree).
- Type:
- magnetic_phi_dist
Distribution to the azimuthal angle of the magnetic field with respect to the \(sigma\) direction of the beam (degree).
- Type:
- quadrupole_dist
Distribution to the quadrupole splitting amplitude (mm/s).
- Type:
- quadrupole_alpha_dist
Distribution to the Euler angle of the electric field gradient \(\alpha\) in extrinsic ZYZ convention (degree).
- Type:
- quadrupole_beta_dist
Distribution to the Euler angle of the electric field gradient \(\beta\) in extrinsic ZYZ convention (degree).
- Type:
- quadrupole_gamma_dist
Distribution to the Euler angle of the electric field gradient \(\gamma\) in extrinsic ZYZ convention (degree).
- Type:
- quadrupole_asymmetry_dist
Distribution to the asymmetry parameter of the electric field gradient, 0 to 1.
- Type:
- isotropic
If True the hyperfine site is set to 3D angular distribution. The site parameters (the angels between the magnetic field and the quadrupole) are fixed.
Changed in version 1.2.0: Prior to version 1.2.0, it overrides all other distributions on angular values applied to the Hyperfine object. Since version 1.2.0 the random distributions are kept.
- Type:
bool
- BareHyperfines
Holds all hyperfine parameters combinations assigned to the site. So each explicit parameter combination due to distributions.
- Type:
List of
BareHyperfine
- ClearRandomDistribution(target)
Clears the selected random or spherical distribution.
Added in version 1.2.0.
- Parameters:
target (string) –
mag
for magnetic distributions.efg
for quadrupole distributions.all
for mag and efg.
- Copy(ref_dist=True)
Copy the Hyperfine object.
- Parameters:
ref_dist (bool) – Determines whether the distribution references should be copied as well (True) or not (False). The distributions itself are not copied, just the reference is passed to the new object. Changing values in the distributions will affect both the original and the copied
Hyperfine
object. Hyperfine site nx.Distributions are not copied but use same reference.
- GetIsomerDistribution()
Get the isomer distribution.
- Returns:
isomer values, relative weight
- Return type:
ndarray, ndarray
- GetMagneticFieldDistribution()
Get the magnetic field distribution.
- Returns:
magnetic field values, relative weight
- Return type:
ndarray, ndarray
- GetMagneticPhiDistribution()
Get the magnetic phi angle distribution.
- Returns:
magnetic phi values, relative weight
- Return type:
ndarray, ndarray
- GetMagneticThetaDistribution()
Get the magnetic theta angle distribution.
- Returns:
magnetic theta values, relative weight
- Return type:
ndarray, ndarray
- GetQuadrupoleAlphaDistribution()
Get the quadrupole alpha angle distribution.
- Returns:
quadrupole alpha angle values, relative weight
- Return type:
ndarray, ndarray
- GetQuadrupoleAsymmetryDistribution()
Get the quadrupole asymmetry distribution.
- Returns:
quadrupole asymmetry values, relative weight
- Return type:
ndarray, ndarray
- GetQuadrupoleBetaDistribution()
Get the quadrupole beta angle distribution.
- Returns:
quadrupole beta angle values, relative weight
- Return type:
ndarray, ndarray
- GetQuadrupoleDistribution()
Get the quadrupole distribution.
- Returns:
quadrupole values, relative weight
- Return type:
ndarray, ndarray
- GetQuadrupoleGammaDistribution()
Get the quadrupole gamma angle distribution.
- Returns:
quadrupole gamma angle values, relative weight
- Return type:
ndarray, ndarray
- SetIsomerDistribution(dist)
Set an isomer shift distribution.
- Parameters:
dist (
Distribution
) – Distribution applied to the isomer shift.
- SetMagneticFieldDistribution(dist)
Set a magnetic field distribution.
- Parameters:
dist (
Distribution
) – Distribution applied to the magnetic field.
- SetMagneticPhiDistribution(dist)
Set a magnetic field azimuthal angle distribution.
- Parameters:
dist (
Distribution
) – Distribution applied to the magnetic field azimuthal angle.
- SetMagneticThetaDistribution(dist)
Set a magnetic field polar angle distribution.
- Parameters:
dist (
Distribution
) – Distribution applied to the magnetic field polar angle.
- SetQuadrupoleAlphaDistribution(dist)
Set a quadrupole distribution in the \(\alpha\) angle.
- Parameters:
dist (
Distribution
) – Distribution applied to \(\alpha\).
- SetQuadrupoleAsymmetryDistribution(dist)
Set a quadrupole distribution in the quadrupole asymmetry.
- Parameters:
dist (
Distribution
) – Distribution applied to the quadrupole asymmetry.
- SetQuadrupoleBetaDistribution(dist)
Set a quadrupole distribution in the \(\beta\) angle.
- Parameters:
dist (
Distribution
) – Distribution applied to \(\beta\).
- SetQuadrupoleDistribution(dist)
Set a quadrupole distribution.
- Parameters:
dist (
Distribution
) – Distribution applied to the quadrupole amplitude.
- SetQuadrupoleGammaDistribution(dist)
Set a quadrupole distribution in the \(\gamma\) angle.
- Parameters:
dist (
Distribution
) – Distribution applied to \(\gamma\).
- SetRandomDistribution(target, type, points=401, method='model', order=1)
Set a random distribution in the magnetic hyperfine field or the electric field gradient. For a hyperfine site random magnetic and random quadrupole magnitude distributions can be set in parallel.
Changed in version 1.2.0: In versions < 1.2.0 this function provided a real random distribution of vectors. However, this requires a large number of points and random sampling does not guarantee the correct spectrum. Since 1.2.0, complete random distributions are removed. Now two optimized versions are implemented. A new averaging method uses a group theoretical approach for optimized sampling of vectors. This method “model” should be used for most cases as it reduces the number of points needed considerably. The random distribution method “random” is still available but now use an optimized random sampling of points based on permutations and mirroring of random vectors, which leads to much better results. This algorithm requires multiple of 48 points for 3D and multiple of 8 points for 2D distributions and will choose a possible number of points closest to your point number input.
Note
For a quadrupole distribution a random orientation of the asymmetry parameter is not included. Only Vzz is randomly chosen and \(\alpha\) is always zero.
- Parameters:
target (string) –
mag
for magnetic distributions.efg
for quadrupole distributions.none
to reset all angular distributions.type (string) – 3D for 3-dimensional distribution or for 2-dimensional distributions one of the following options: 2Dks, 2Dkp, 2Dsp, 2Dsk, 2Dpk, 2Dps. Convention for 2Dxy is that xy give the plane of the distribution. x and y can be k (k-vector direction), s (\(sigma\) polarization direction) or p (\(pi\) polarization direction).
points (int) –
Number of points for the distribution. Only used for method random. Default is 401 points.
Changed in version 1.2.0.
method (string) –
random for random selection of points, which are permuted and mirrored. model for selected points to average over the parameter after [Hasselbach].
Added in version 1.2.0.
order (int) –
The order parameter determines the number of basis sets used in the spherical 3D approximation of the average method, not for the 2D one. For
order=1
48 vectors are used, up to 1008 vectors fororder=6
. Default is 1.Added in version 1.2.0.
Note
A hyperfine site should not have too many distributions.
Each distribution point number multiplies with the previously set distribution points.
For example, having three distributions with each 30 points will result in 27000 distribution points in total for the site.
In this case the calculations of the transitions takes quite long.
As a rule of thumb try to stay below 1000 distribution points per Hyperfine
object.
For 3D random distributions in the magnetic field and the quadrupole splitting set Hyperfine.isotropic
to True.
This will results in considerable faster calculations than setting two 3D distributions.
Examples
Various ways to define a Hyperfine
object without distributions.
site = nx.Hyperfine(
id = "user hyperfine site",
weight = 1,
isomer = -0.11,
magnetic_field = 0,
magnetic_theta = 0,
magnetic_phi = 45,
quadrupole = 0.8,
quadrupole_alpha = 90,
quadrupole_beta = 45,
quadrupole_gamma = 0,
quadrupole_asymmetry = 0.05,
isotropic = False)
site.quadrupole.value = 0
site.magnetic_field = 33
site.isotropic = True
print(site)
different ways to define distributions on hyperfine parameters
gauss_dist_mag = nx.lib.distribution.Gaussian(points = 11, fwhm = 3)
# initializer definition of magnetic field distribution
site = nx.Hyperfine(isomer = -0.11,
magnetic_field = 33,
magnetic_field_dist = gauss_dist_mag)
site = nx.Hyperfine(isomer = -0.11,
magnetic_field = 33)
# isomer distribution via set method
gauss_dist_isomer = nx.lib.distribution.Gaussian(points = 11, fwhm = 0.2)
site.SetIsomerDistribution(gauss_dist_isomer)
Random distributions have to be applied by set methods
site.SetRandomDistribution("efg", "3D", 201)
site.SetRandomDistribution("mag", "2Dsk", 201)