Function Repository Resource:

# RiemannSurfacePlot3D

Plot Riemann surfaces of compositions of elementary functions

Contributed by: Michael Trott
 ResourceFunction["RiemannSurfacePlot3D"][w⩵f(z), reim(z), {z, w}] generates a three-dimensional plot of the Riemann surface of w over the complex z-plane with reim(z) equal to Re(z) or Im(z). ResourceFunction["RiemannSurfacePlot3D"][w⩵f(z), {ζ1,ζ2,ζ3},{z,w}] generates a three-dimensional plot of the Riemann surface of w in ζ1,ζ2,ζ3-space. ζi can be any linear combination of Re(z),Im(z),Re(w),Im(w). ResourceFunction["RiemannSurfacePlot3D"][p(z,w),reim(z),{z, w}] generates a three-dimensional plot of the Riemann surface of w defined through the equality p(z,w) over the complex z-plane. ResourceFunction["RiemannSurfacePlot3D"][p(z,w),{φx,y,φx,u,φx,v,φy,u,φy,v,φu,v},{z,w}] generates a three-dimensional plot of the Riemann surface of w defined through the equality p(z,w) as a complex functions represented in (x=Re(z),y=Im(z),u=Re(w),v=Im(w)) rotated by the angles φx,y,φx,u,φx,v,φy,u,φy,v,φu,v, displayed as the first three components of the rotated points.

## Details and Options

The function allows to plot Riemann surfaces of compositions of elementary functions with a finite number of branch points; one branch point can be at .
The resulting plots are always centered at the origin and all finite branch points are included in the horizontal plot range.
For branch points with finite ramification index all sheets are included, for logarithmic branch points three sheets are included by default.
ResourceFunction["RiemannSurfacePlot3D"] has the same options as Graphics3D, with the following additions:
 PlotStyle Automatic graphics directives for the style for the complete surface or the patches making up the surface ColorFunction Automatic how to determine the color of surfaces "ShowBranchPoints" False if branch points positions should be indicated as thin vertical tubes with tootips "BranchPointStyle" Automatic how to draw the vertical tubes at branch points "BranchPointOffset" 10-6 offset from the branch points to start numerical computations "BranchPointPlotRangeFactor" 1.5 radial plot range factor with respect to the furthest branch point "LogSheets" {-1, 0, 1} list of sheets to use for logarithmic branch points with respect to the principal sheet PlotPoints {60, 30} approximate azimuthal and radial plot points "StitchPatches" False if neighboring patches should be stitched together WorkingPrecision 25 precision to use in numerical computations
With ColorFunctionfunc, the arguments supplied to func are z and w (both asumed to be complex numbers). No scaling is applied to z and w.
Stitching the surface patches together results in watertight surfaces, better suited for 3D printing.
Additionally, all options of Graphics3D can be specified in ResourceFunction["RiemannSurfacePlot3D"].
The patches of the surface are computed through numerically solving differential equations.
The last solution of the differential equations is cached for a given w=f(z). As a result varying the second argument is fast and interactive exploration is possible.

## Examples

### Basic Examples (5)

The Riemann surface of the square root functions plotted as the real part of :

 In[1]:=
 Out[1]=

The Riemann surface of the cube root functions plotted as the real part of :

 In[2]:=
 Out[2]=

The Riemann surface of the function w defined implicitly through w5=1-z3:

 In[3]:=
 Out[3]=

The Riemann surface of a function with three logarithmic branch points at z=1, z=-(-1)1/3, and z=-(-1)2/3:

 In[4]:=
 Out[4]=

The Riemann surface of a more complicated function with multiple logarithmic branch points:

 In[5]:=
 Out[5]=

### Scope (6)

The (vertical) function value displayed can be any linear combination of Re(z), Im(z), Re(w), Im(w):

 In[6]:=
 Out[6]=

The {x,y,z}-values displayed can be any linear combination of Re(z), Im(z), Re(w), Im(w):

 In[7]:=
 Out[7]=

A wide class of compositions of elementary functions can be visualized. Here are some examples containing trigonometric and inverse trigonometric functions:

 In[8]:=
 Out[8]=
 In[9]:=
 Out[9]=
 In[10]:=
 Out[10]=

Riemann surface of nested square and cube roots:

 In[11]:=
 Out[11]=
 In[12]:=
 Out[12]=

Root objects define implicitly bivariate polynomials and the corresponding Riemann surface can be plotted. Here is an irreducible quantic shown:

 In[13]:=
 Out[13]=

For the purpose of the RiemannSurfacePlot3D function, the product log function is considered an elementary function:

 In[14]:=
 Out[14]=

Here are the real and imaginary parts of the function :

 In[15]:=
 Out[15]=

The vertical value of the surface can be a linear combination of the real and imaginary parts of z and w:

 In[16]:=
 Out[16]=

Even all three coordinate values of the surface can be such a linear combination:

 In[17]:=
 Out[17]=

### Options (17)

#### PlotStyle (2)

Specify a plot style for the whole Riemann surface:

 In[18]:=
 Out[18]=

A list of style directives will be applied cyclically to the radial-azimuthal patches that result from the branch point-induced tensor-product subdivision of the complex z-plane:

 In[19]:=
 Out[19]=

#### ColorFunction (3)

Color the surface according to the argument of w:

 In[20]:=
 Out[20]=

Use a color functions that depends on :

 In[21]:=
 Out[21]=

Color a Riemann surface according to the distance to the nearest branch point, with parts of the surface that are near to a branch point being red:

 In[22]:=
 Out[22]=

#### ShowBranchPoints and BranchPointStyle (2)

With the setting "ShowBranchPoints"True, branch points over the z-plane will be indicated as vertical tubes (mouseover the vertical tubes to see z-positions of the branch points):

 In[23]:=
 Out[23]=

The option "BranchPointStyle" determines the color of these tubes:

 In[24]:=
 Out[24]=

#### BranchPointPlotRangeFactor (2)

The default plot range extends the distance from the origin to the furthest branch point by 50%:

 In[25]:=
 Out[25]=

Show the Riemann surface with more padding (but same box ratios):

 In[26]:=
 Out[26]=

#### LogSheets (1)

Logarithmic branch points connect infinitely many sheets. By default, the principal sheet and one sheet below and above are used. Using the option "LogSheets", more or fewer sheets could be displayed:

 In[27]:=
 Out[27]=

#### BranchPointOffset (2)

The default the numerical computation of the surface patches starts 10-6 away from any branch point. For most surfaces this results in defacto invisible gaps between the patches:

 In[28]:=
 Out[28]=

By specifying a larger offset from the branch point-generated patches gaps between the patches become visible. The next input colors the patches differently:

 In[29]:=
 Out[29]=

#### PlotPoints (1)

The option PlotPoints determines the approximate number of radial and azimuthal plot points:

 In[30]:=
 Out[30]=

#### StitchPatches (2)

The option "StitchPatches" tries to connect neighboring patches by stitching them together with tiny polygons to obtain water-tight surfaces:

 In[31]:=
 Out[31]=

While visually the two graphics are quite similar, the stitched patches result in a larger number of graphics complexes in the resulting 3D graphic:

 In[32]:=
 Out[32]=

#### Graphics3D options (2)

All options of Graphics3D can be specified:

 In[33]:=
 Out[33]=

Plot of the Riemann surface of a general quartic polynomial with multiple options specified:

 In[34]:=
 Out[34]=

### Applications (5)

Show the Riemann surfaces for the simple power functions colored by the argument of w:

 In[35]:=
 Out[35]=

Replacing zzn+z-n in the last example gives more complicated surfaces with a pole at z=0:

 In[36]:=
 Out[36]=

Riemann surfaces of general cubics (in total degree) polynomials might or might not have poles:

 In[37]:=
 Out[37]=

Real parts of logarithms typically show (logarithmic) singularities, visible as long thin tubes extending up or down. Imaginary parts often are bounded.:

 In[38]:=
 Out[38]=

Logarithmic and algebraic branch points can be at the same z-values:

 In[39]:=
 Out[39]=

### Properties and Relations (10)

Inverse trigonometric functions can be expressed through logarithms and so the Riemann surfaces of such functions show logarithmic branch points:

 In[40]:=
 Out[40]=
 In[41]:=
 Out[41]=
 In[42]:=
 Out[42]=

Two Riemann surfaces of functions containing square roots and logarithms:

 In[43]:=
 Out[43]=

When displaying the real or imaginary part vertically, Riemann surfaces can potentially separate into disconnected parts:

 In[44]:=

Linear combinations of Re(w) and Im(w) typically result in connected Riemann surfaces:

 In[45]:=
 Out[45]=

The Riemann surface of also splits into separate (intersecting, but not smoothly connected) pieces:

 In[46]:=
 Out[46]=

The Riemann surface of also splits into separate pieces:

 In[47]:=
 Out[47]=

Note that the classic identity holds only for positive real z:

 In[48]:=
 Out[48]=

Expressions containing square roots and logarithms that become equal after PowerExpand are often not equivalent for all complex numbers. Here is an example:

 In[49]:=
 Out[49]=
 In[50]:=
 Out[50]=

But the Riemann surfaces of such expressions are identical:

 In[51]:=
 Out[51]=

In the following example, asymptotically approaches a constant. The cube root shows the three values of the constant:

 In[52]:=
 Out[52]=

Using a logarithm instead shows a Riemann surface with infinitely many sheets (we display 5=4+1/2+1/2):

 In[53]:=
 Out[53]=

The Riemann surface of roots of polynomials displayed as the real and imaginary part are typically visually quite similar (note the slightly different orientation):

 In[54]:=
 Out[54]=

For functions containing logarithms, the real and imaginary parts typically look quite different:

 In[55]:=
 Out[55]=

Riemann surfaces constructed from nested radicals can take on a large variety of shapes:

 In[56]:=
 Out[56]=

Compare the result of RiemannSurfacePlot3D with two other construction methods for Riemann surfaces:

 In[57]:=
 Out[57]=

For Riemann surfaces defined through bivariate polynomials one can separate the real and imaginary parts and eliminate variables. The next inputs computes an implicit form of v=Im(w) as a functions of x=Re(z) and y=Im(z) for w3=1-z4:

 In[58]:=
 Out[58]=

The implicit form is a total degree 16 trivariate polynomial:

 In[59]:=
 Out[59]=

Using ContourPlot3D we obtain the following surface:

 In[60]:=
 Out[60]=

Alternatively one can use Plot3D to plot every sheet and then show all sheets (note the gaps that arise from the Exclusions option of Plot3D):

 In[61]:=
 Out[61]=

### Possible Issues (2)

Only multi-valued functions are plotted:

 In[62]:=
 Out[62]=

Even simple-looking functions with multiple logarithmic branch points can generates plots with many sheets:

 In[63]:=
 Out[63]=
 In[64]:=
 Out[64]=

### Neat Examples (18)

Compare the Riemann surface with the plaster model (left) from Schilling's catalog (image from the Göttingen Collection of Mathematical Models and Instruments) with the plot from RiemannSurfacePlot3D (right):

 In[65]:=
 In[66]:=
 Out[66]=

Two Riemann surfaces of quotients of square roots and logarithms:

 In[67]:=
 Out[67]=

The rotated (for a more interesting look) Riemann surface of :

 In[68]:=
 Out[68]=

The rotated (for a more interesting look) Riemann surface of :

 In[69]:=
 Out[69]=

The imaginary parts of of the Riemann surface of reminds of nested tops:

 In[70]:=
 Out[70]=

The Riemann surface of colored according to the argument of w:

 In[71]:=
 Out[71]=

Color the real part according to the imaginary part:

 In[72]:=
 Out[72]=

Color the sheets according to the argument of the z-value:

 In[73]:=
 Out[73]=

The internals of this Riemann surface of a ratio of arctan functions:

 In[74]:=
 Out[74]=

Color the surface blue when the real part of w is greater than the imaginary part, red otherwise:

 In[75]:=
 Out[75]=

The complicated Riemann surface of the square root of the logarithm of a polynomial:

 In[76]:=
 Out[76]=

Plot a camouflaged Riemann surface:

 In[77]:=
 Out[77]=

Plot a simple Riemann surface:

 In[78]:=
 Out[78]=

"Roughen" the Riemann surface by moving of the surface by small random amounts:

 In[79]:=
 In[80]:=
 Out[80]=

Add the Union Jack into the patches of a Riemann surface as a texture:

 In[81]:=
 Out[81]=

A Riemann surface that slowly fades out:

 In[82]:=
 Out[82]=

Plot an auto-rotating Riemann surface:

 In[83]:=
 Out[83]=

Cut a Riemann surface along shifted x-, y-planes:

 In[84]:=
 Out[84]=

Smoothly change from displaying the real part to displaying the imaginary parts of :

 In[85]:=
 Out[85]=

By considering a Riemann surface as part of , by rotating the surface and projecting into 2D space one can interactively explore the complete Riemann surface. Every angle results in a different 3D surface:

 In[86]:=
 Out[86]=

## Version History

• 1.0.0 – 18 October 2019