Function Repository Resource:

UnwindingNumber

Source Notebook

Evaluate the unwinding number

Contributed by: Jan Mangaldan

ResourceFunction["UnwindingNumber"][z]

gives the unwinding number 𝒰(z).

Details

Mathematical function, suitable for both symbolic and numerical manipulation.
The unwinding number is defined by the relation z=log ez+2πi𝒰​(z).
ResourceFunction["UnwindingNumber"][z] returns an integer when z is any numeric quantity, whether or not it is an explicit number.
For exact numeric quantities, ResourceFunction["UnwindingNumber"] internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
ResourceFunction["UnwindingNumber"] automatically threads over lists.

Examples

Basic Examples (2) 

Evaluate numerically:

In[1]:=
ResourceFunction["UnwindingNumber"][3 - 4 I]
Out[1]=

Plot of the unwinding number in the complex plane:

In[2]:=
ComplexPlot3D[ResourceFunction["UnwindingNumber"][z], {z, 4 \[Pi]}, ColorFunction -> {ColorData[97, 2] &, None}, Mesh -> True, MeshFunctions -> {Re[#1] &, Im[#1] &}]
Out[2]=

Scope (4) 

Evaluate the unwinding number of a Root object:

In[3]:=
ResourceFunction["UnwindingNumber"][
Root[-22400000 - 480000 # + #^5& , 3, 0]]
Out[3]=

Evaluate the unwinding number of a machine precision number:

In[4]:=
ResourceFunction["UnwindingNumber"][N[2 ArcSin[10]]]
Out[4]=

Evaluate the unwinding number of an arbitrary precision number:

In[5]:=
ResourceFunction["UnwindingNumber"][N[2 ArcSin[10], 25]]
Out[5]=

UnwindingNumber threads elementwise over lists:

In[6]:=
ResourceFunction["UnwindingNumber"][
 RandomComplex[{-1, 1} 4 \[Pi] (1 + I), 5]]
Out[6]=

Applications (3) 

The identity does not generally hold for complex z and w:

In[7]:=
Sqrt[z w] == Sqrt[z] Sqrt[w] /. {z -> -1 - I, w -> 2 - 3 I} // FullSimplify
Out[7]=

Use the unwinding number to construct a formula that is valid in the entire complex plane:

In[8]:=
Sqrt[z w] == Sqrt[z] Sqrt[w] (-1)^
    ResourceFunction["UnwindingNumber"][Log[z] + Log[w]] /. {z -> -1 -
      I, w -> 2 - 3 I} // FullSimplify
Out[8]=

The identity does not generally hold for complex z and w:

In[9]:=
Log[z w] == Log[z] + Log[w] /. {z -> -1 - I, w -> 2 - 3 I} // FullSimplify
Out[9]=

Use the unwinding number to construct a formula that is valid in the entire complex plane:

In[10]:=
Log[z w] == Log[z] + Log[w] - 2 \[Pi] I ResourceFunction["UnwindingNumber"][
      Log[z] + Log[w]] /. {z -> -1 - I, w -> 2 - 3 I} // FullSimplify
Out[10]=

A relationship between the inverse sine and the inverse tangent:

In[11]:=
ArcSin[z] == ArcTan[z/Sqrt[
    1 - z^2]] + \[Pi] (ResourceFunction[
       "UnwindingNumber"][-Log[1 + z]] - ResourceFunction["UnwindingNumber"][-Log[1 - z]]) /. z -> -5.1
Out[11]=

Properties and Relations (2) 

The unwinding number is an integer:

In[12]:=
ResourceFunction[
 "UnwindingNumber"][{Cosh[5 + 3 I], Root[#^11 - 19 # + 13 &, 4]}]
Out[12]=

Compare UnwindingNumber with one of its definitions:

In[13]:=
ResourceFunction["UnwindingNumber"][z] == (z - Log[E^z])/(
   2 \[Pi] I) /. z -> RandomComplex[5 \[Pi] (1 + I) {-1, 1}, WorkingPrecision -> $MachinePrecision] // FullSimplify
Out[13]=

Possible Issues (2) 

Numerical decision procedures with default settings cannot automatically resolve this value:

In[14]:=
ResourceFunction["UnwindingNumber"][
 1 + I ((3 \[Pi] + 4 \[Pi]^2 + 2 \[Pi]^3) - 2 \[Pi] (\[Pi] + 1)^2)]
Out[14]=

Use Simplify to resolve:

In[15]:=
Simplify[%]
Out[15]=

Neat Examples (2) 

Define the Wright omega function:

In[16]:=
wrightOmega[z_] := ProductLog[ResourceFunction["UnwindingNumber"][z], Exp[z]]

Visualize the fringing fields of a semi-infinite parallel plate capacitor:

In[17]:=
ParametricPlot[
 With[{z = x + I y}, ReIm[z - 1 - wrightOmega[z - 1]]], {x, -10, 10}, {y, -2 \[Pi], 2 \[Pi]}, Sequence[
 Axes -> None, BoundaryStyle -> None, Mesh -> 30, MeshFunctions -> {#4& }, MeshStyle -> Opacity[0.6, 
RGBColor[0.368417, 0.506779, 0.709798]], PlotPoints -> 75, PlotRange -> {{-7, 2}, {-Pi, Pi}}, PlotStyle -> None]]
Out[17]=

Version History

  • 1.0.0 – 15 March 2021

Source Metadata

Author Notes

The sign convention used by UnwindingNumber is opposite from the one used in the paper of Corless and Jeffrey that originally introduced the concept of the unwinding number.

License Information