Documentation of user libs (user functions)

Supeconducting Gap-Integrals to calculate \(1/\lambda^2\) vs \(T\)

The details about the various superconducting gap-integrals are found in the pdf-file GapIntegrals.pdf which can be found in the musrfit source under <musrfit-dir>/src/external/libGapIntegrals/.

Depth resolved information (AS libs)

A method to extract depth-resolved information from the implantation energy dependence of the experimental parameters in a low-energy muon spin spectroscopy experiment. For details see A. F. A. Simões, et al. Review of Scientific Instruments. 2020; 91(2): 023906 (7 pp.).

If you have a layered material (e.g. \(N\) layers), properties like the asymmetry might depend on the layer in which the muons are stopped. For instance there might be different probabilities for muonium formation depending on the material, charge transfer layers, etc.

Since the muon stopping distribution, \(n(z)\), has some finite range, these properties will be smeared out. For the following we define the stopping probability, \(p_{i}(E)\) for a finite slice \(i\), ranging from \(z \in [a, b]\) as

\[p_{i}(E) = \int_a^b n(z,E) \, dz\]

Furthermore it is assumes that there is a sharp transition between the layers of the property of interest, e.g. the diamagnetic fraction, \(f_i\). Hence the measured property as function of energy is

\[f(E) = \sum_{i=1}^N p_{i}(E) \cdot f_i.\]

Note

Currently it is recommended to read in the data in ASCII or DAT format as a non-μSR fit (fit type 8).

The user library for the depth profile analysis looks for a 3 layer material, assuming one is looking for the diamagnetic fraction, like

###############################################################
FITPARAMETER
#      Nr.   Name        Value     Step      Pos_Error  Boundaries
        1    f1          0.54540   0.00072     none        0       1
        2    f2          0.23957   0.00048     none
        3    f3          0.05615   0.00047     none        0       1
        4    x1          63.5000   0.0014      none
        5    x2          101.5001  0.0044      none

###############################################################
THEORY
userFcn  libPDepthProfile PDepthProfile 1 2 3 4 5

Here, \(f1\) is the diamagnetic fraction of the first layer, etc. \(x1\) is the thickness of the first layer, etc.

In order to find the muon stopping profile, \(n(z,E)\), needed for the calculation, the library needs to find the corresponding trimsp rge-files (muon stoppping profiles). For this the library reads at start-up the following xml-file (example):

<?xml version="1.0" encoding="UTF-8"?>
<depthProf xmlns="http://nemu.web.psi.ch/musrfit/depthProf">
    <comment>
        TrimSp information
    </comment>
    <trim_sp>
        <data_path>./TRIMSP/</data_path>
        <rge_fln_pre>SiO2_70nm2.0_30nm2.2_SiC_E</rge_fln_pre>
        <energy_vect start="1000" stop="22000" step="1000"/>
    </trim_sp>
</depthProf>

Functions to analyze β-NMR data (BNMR libs)

This is a collection of C++ classes using the musrfit user-functions interface in order to facilitate the usage in conjunction with musrfit. It consists of two libraries:

  • libBNMR contains functions to fit spin lattice relaxation (SLR) data.
  • libLineProfile contains functions to fit resonance lineshapes.

Note

Currently it is recommended to read in the data in ASCII format as a non-μSR fit (fit type 8).

libBNMR

In β-NMR the SLR is usually measured by implanting a pulse of \(^8\)Li with a length \(t_0\) into the sample. The asymmetry is measured both during the pulse and afterwards. For a a general spin relaxation function \(f(t)\) the time evolution of the asymmetry is then given by [Z. Salman, et al., PRL 96, 147601 (2006)]:

\[\begin{split}P(t) = \left\{\begin{matrix} \frac{\int_0^t e^{-(t-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^t e^{-t'/\tau_{\mathrm{Li}}}dt' } & t\leq t_0\\[6pt] \frac{\int_0^{t_0}e^{-(t_0-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^{t_0}e^{-t'/\tau_{\mathrm{Li}}}dt'} & t> t_0, \end{matrix}\right.\end{split}\]

where \(\tau_{\mathrm{Li}}=1.21\)s is the \(^8\)Li lifetime.

Functions

The libBNMR library currently contains the following functions:

Exponential relaxation

userFcn libBNMR ExpRlx 1 2

The parameters are:

  1. pulse length \(t_0\) (s)
  2. relaxation rate \(\lambda\) (s\(^{-1}\))

This function implements \(f(t)=e^{-\lambda t}\).

Stretched exponential relaxation

userFcn libBNMR SExpRlx 1 2 3

The parameters are:

  1. pulse length \(t_0\) (s)
  2. relaxation rate \(\lambda\) (s\(^{-1}\))
  3. stretching exponent \(\beta\)

This function implements \(f(t)=e^{-(\lambda t)^{\beta}}\).

libLineProfile

In addition to some simple line shapes libLineProfile contains functions to fit chemical shift anisotropies in the powder average. Their functional form can be found in M. Mehring, Principles of High Resolution NMR in Solids (Springer 1983).

For an axially symmetric interaction it is given by:

\[\begin{split}I_{\mathrm ax}(f)=\left\{\begin{matrix} \frac{1}{2\sqrt{(f_\parallel-f_\perp)(f-f_\perp)}}& f\in(f_\perp,f_\parallel)\cup(f_\parallel,f_\perp)\\[6pt] 0 & \text{otherwise}\end{matrix} \right.\end{split}\]

where \(f_\parallel\) and \(f_\perp\) are the frequencies that would be observed if the field is oriented paralell or perpendicular to the symmetry axis, respectively.

In case of a completely anisotropic interaction, the powder average can be described by the frequencies along the three principle axis \(f_1,f_2,f_3\).
Assume without loss of generality that \(f_1<f_2<f_3\), then
\[\begin{split}I(f)&=\left\{\begin{matrix} \frac{K(m)}{\pi\sqrt{(f-f_1)(f_3-f_2)}},& f_3\geq f>f_2 \\[9pt] \frac{K(m)}{\pi\sqrt{(f_3-f)(f_2-f_1)}},& f_2>f\geq f_1\\[9pt] 0 & \text{otherwise} \end{matrix} \right. \\ \\ m&=\left\{\begin{matrix} \frac{(f_2-f_1)(f_3-f)}{(f_3-f_2)(f-f_1)},& f_3\geq f>f_2 \\[6pt] \frac{(f-f_1)(f_3-f_2)}{(f_3-f)(f_2-f_1)},& f_2>f\geq f_1\\[6pt] \end{matrix} \right. \\ \\ K(m)&=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\end{split}\]

\(K(m)\) is the complete elliptic integral of the first kind.

Functions

The libLineProfile library currently contains the following functions:

Gaussian

userFcn  libLineProfile LineGauss 1 2

The parameters are:

  1. center of the line \(f_0\)
  2. FWHM of the line \(\sigma\)
The height of the peak is 1.
The functional form is given by
\[A(f)=e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}}\]

Lorentzian

userFcn  libLineProfile LineLorentzian 1 2

The parameters are:

  1. center of the line \(f_0\)
  2. FWHM of the line \(w\)
The height of the peak is 1.
The functional form is given by
\[A(f)= \frac{w^2}{4(f-f_0)^2+w^2}\]

Laplacian

userFcn  libLineProfile LineLaplace 1 2

The parameters are:

  1. center of the line \(f_0\)
  2. FWHM of the line \(w\)
The height of the peak is 1.
The functional form is given by
\[A(f)=e^{-2\ln 2 \left|\frac{f-f_0}{w}\right|}\]

Skewed Lorentzian

userFcn  libLineProfile LineSkewLorentzian 1 2 3

The parameters are:

  1. center of the line \(f_0\)
  2. width of the line \(w\)
  3. skewness parameter \(a\)
The height of the peak is 1.
The functional form is given by
\[A(f)= \frac{w w_a}{4(f-f_0)^2+w_a^2}, \quad w_a=\frac{2w}{1+e^{a(f-f_0)}}\]

Skewed Lorentzian 2

userFcn  libLineProfile LineSkewLorentzian2 1 2 3

The parameters are:

  1. center of the line \(f_0\)
  2. width left of the center \(w_1\)
  3. width right of the center \(w_2\)
The height of the peak is 1.
The functional form is given by
\[\begin{split}A(f)= \left\{\begin{matrix}\frac{{w_1}^2}{4{(f-f_0)}^2+{w_1}^2},&f\leq f_0\\[9pt] \frac{{w_2}^2}{4{(f-f_0)}^2+{w_2}^2},&f>f_0\end{matrix}\right.\end{split}\]

Powder average of an axially symmetric interaction convoluted with a Lorentzian

userFcn  libLineProfile PowderLineAxialLor 1 2 3

The parameters are:

  1. frequency for the field oriented paralell to the symmetry axis \(f_\parallel\)
  2. frequency for the field oriented perpendicular to the symmetry axis \(f_\parallel\)
  3. FWHM of the Lorentzian \(w\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I_{\mathrm ax}(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]

with \(I_{\mathrm ax}(f)\) defined above.

Powder average of an axially symmetric interaction convoluted with a Gaussian

userFcn  libLineProfile PowderLineAxialGss 1 2 3

The parameters are:

  1. frequency for the field oriented paralell to the symmetry axis \(f_\parallel\)
  2. frequency for the field oriented perpendicular to the symmetry axis \(f_\parallel\)
  3. FWHM of the Gaussian \(\sigma\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I_{\mathrm ax}(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)\]

with \(I_{\mathrm ax}(f)\) defined above.

Powder average of an anisotropic interaction convoluted with a Lorentzian

userFcn  libLineProfile PowderLineAsymLor 1 2 3 4

The parameters are:

  1. \(f_1\)
  2. \(f_1\)
  3. \(f_3\) frequencies along the principal axes
  4. FWHM of the Lorentzian \(w\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]

with \(I(f)\) defined above. Note that \(f_1<f_2<f_3\) is not required by the code.

Powder average of an anisotropic interaction convoluted with a Gaussian

userFcn  libLineProfile PowderLineAsymGss 1 2 3 4

The parameters are:

  1. \(f_1\)
  2. \(f_1\)
  3. \(f_3\) frequencies along the principal axes
  4. FWHM of the Gaussian \(\sigma\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)\]

with \(I(f)\) defined above. Note that \(f_1<f_2<f_3\) is not required by the code.