Function Repository Resource:

RiemannSphereComplexPlot

Source Notebook

A 3D rotatable Riemann sphere version of ComplexPlot

Contributed by: Jan Mangaldan

ResourceFunction["RiemannSphereComplexPlot"][f,z]

generates a plot of Arg[f] over the Riemann sphere.

Details and Options

ResourceFunction["RiemannSphereComplexPlot"] has the attribute HoldAll.
The Riemann sphere is a stereographic projection of the extended complex plane onto a sphere that includes the point at infinity.
ResourceFunction["RiemannSphereComplexPlot"] treats the variable z as local, effectively using Block.
ResourceFunction["RiemannSphereComplexPlot"] uses a cyclic color function over Arg[f] to identify features such as zeros, poles and essential singularities. The color function goes from -π to π counterclockwise around zeros, clockwise around poles and infinite cycles near essential singularities.
No color is applied in any regions where the corresponding f evaluates to None.
Most options for ComplexPlot and SphericalPlot3D are supported.

Examples

Basic Examples (3) 

Plot a complex function with a zero at 1 and poles at (-1)±2/3:

In[1]:=
ResourceFunction["RiemannSphereComplexPlot"][(z - 1)/(1 + z + z^2), z]
Out[1]=

Specify a custom ColorFunction and color shading:

In[2]:=
ResourceFunction["RiemannSphereComplexPlot"][(z - 1)/(1 + z + z^2), z,
  ColorFunction -> {ResourceFunction["DLMFHue"], "CyclicLogAbsArgBoundaries"}]
Out[2]=

Include a legend showing how the colors vary from -π to π:

In[3]:=
ResourceFunction["RiemannSphereComplexPlot"][(z - 1)/(1 + z + z^2), z,
  ColorFunction -> {ResourceFunction["DLMFHue"], "CyclicLogAbsArgBoundaries"}, PlotLegends -> Automatic]
Out[3]=

Scope (1) 

For functions with a branch cut, RiemannSphereComplexPlot will display a discontinuity in color:

In[4]:=
{ResourceFunction["RiemannSphereComplexPlot"][Log[z], z, ViewPoint -> Above], ResourceFunction["RiemannSphereComplexPlot"][Log[z], z, ViewPoint -> Left]}
Out[4]=

Options (1) 

Most options for ComplexPlot and SphericalPlot3D are supported:

In[5]:=
ResourceFunction["RiemannSphereComplexPlot"][(z^2 - I z - 1 + I)/(
 z - I), z, Boxed -> True, ColorFunction -> "CyclicLogAbs", PlotLegends -> Automatic]
Out[5]=

Properties and Relations (1) 

In RiemannSphereComplexPlot, the origin is projected to the South Pole of the sphere, and the point at infinity is mapped to the North Pole:

In[6]:=
{ComplexPlot[(8 z^3 - 1)/(8 z), {z, 1}], ResourceFunction["RiemannSphereComplexPlot"][(8 z^3 - 1)/(8 z), z, ViewPoint -> Below]} // GraphicsRow
Out[6]=

Neat Examples (1) 

Use resource function SpinShow to create a spinning Riemann sphere visualization:

In[7]:=
ResourceFunction["SpinShow"][
 ResourceFunction["RiemannSphereComplexPlot"][(z + 1 + I)/(
  1 - I + I z - z^2), z, ColorFunction -> {ResourceFunction["DLMFHue"], "CyclicReImLogAbs"}]]
Out[7]=

Version History

  • 1.0.0 – 15 January 2021

Related Resources

License Information