Function Repository Resource:

# NPseudoVoigt

Fast numerical approximation to the PDF of the Voigt distribution with around 1.2% of maximum deviation

Contributed by: Julien Kluge
Quantum Optical Metrology; Joint Lab Integrated Quantum Sensors
Department of Physics
Humboldt-Universität zu Berlin
(julien@physik.hu-berlin.de)
 ResourceFunction["NPseudoVoigt"][x,b,σ] calculates the approximation at postions x of a Voigt distribution with CauchyDistribution parameter b and NormalDistribution parameter σ.

## Details and Options

ResourceFunction["NPseudoVoigt"] is approximately normed to 1 for all parameters b and σ above 0.

## Examples

### Basic Examples

NPseudoVoigt always returns numerical results, even for exact inputs:

 In[1]:=
 Out[1]=

NPseudoVoigt compared to the analytic solution:

 In[2]:=
 Out[2]=

### Scope

 In[3]:=
 Out[3]=

NPseudoVoigt is approximately normed to 1 for b and σ greater than 0:

 In[4]:=
 Out[4]=

NPseudoVoigt's norm has four additional terms that cancel out for non-extreme values of b and σ:

 In[5]:=
 Out[5]=

NPseudoVoigt's deviation to the analytic solution in the maximum is usually less than ±1% for every parameter combination b and σ:

 In[6]:=
 Out[6]=

NPseudoVoigt's relative deviation increases if b and σ approach one another:

 In[7]:=
 Out[7]=

NPseudoVoigt is also stable against σ being 0:

 In[8]:=
 Out[8]=

### Applications

NPseudoVoigt can be compiled to obtain faster execution times:

 In[9]:=
 Out[3]=
 In[10]:=
 Out[10]=
 In[11]:=
 Out[11]=

### Possible Issues

Negative b parameters can produce imaginary values:

 In[12]:=
 Out[12]=

Negative σ parameters do not yield symmetric values:

 In[13]:=
 Out[13]=

### Neat Examples

NPseudoVoigt can be used to approximate an atomic absorption spectrum efficiently:

 In[14]:=
 Out[15]=
 Out[16]=

NPseudoVoigt can be used to show that σ is negligible or even 0, whereas the VoigtDistribution could throw errors:

 In[17]:=
 Out[19]=