Knotted Portals in Virtual Reality

This article describes a software named"KnotPortal"for visualization of branched covers of knots based on an idea by Bill Thurston to view a knot as a portal to other universes. Our implementation allows users to explore these knotted portals either on a screen or in virtual reality using a head-mounted device with room-tracking. This allows users not only to see these glued different worlds, but experience them by being able to walk through the portals. This software can be used to enable students to learn about knots, gluing, (branched) covers, or just to have a fun look at portals.


Introduction
In a video titled "Knots to Narnia" [Thu12], Bill Thurston presents an approach to "visualize" the cyclic branched cover of a knot by interpreting the knot as a portal to other universes. 1He demonstrates this using a wire to create different life-sized knotted portals.The wire is "magical" and, when its ends are joined, creates a "rip in the fabric of the universe," creating a portal from our world to a parallel world called "Narnia" in reminiscence of the novels by C.S. Lewis.The only rule governing the portal is that by circling around the boundary curve twice, one returns to the original world one started in.He then proceeds to explain the phenomena arising in the context of such portals by walking through this wire portal (see Fig. 1).This notion of a portal being generated by a ring-shaped object is a quite common theme in movies and videogames, and is mathematically quite simple.Thurston then proceeds to ask a question: What if the wire generating the portal was to be knotted?This leads to different regions in the knot, generating multiple portals.But how many different portals would be generated, and in how many worlds would they lead?  Figure 5: A sideways view of the twisted unknot, revealing why "both" portals must lead into the same world; there is in fact only one portal.
The object being studied is a cyclic branched cover of order 2.This means that a knot defines a gluing of several sheets of R 3 , by regarding it as a branching curve.Each world is cut along surfaces generated by the knot in a way specified in Sec. 5, and then glued together according to permutations subject to certain rules.This is analogous to the two-dimensional case, where one has branching points and cut lines in the construction of, for example, the complex logarithm (see Fig. 6).This representation of branched covers of knots is fascinating, and for the unknot, it is easy enough to imagine.3If, however, the branching curve is knotted, it requires quite a lot of imagination to be able to picture these portals, even for simple cases.This gave the motivation to implement this vision as a computer program, to further recreate Thurston's experience of being able to step through portals as a virtual reality software, giving users the possibility to not only see these portals but actually be able to walk through them as Thurston did.
In this paper, we describe the implementation of this software and a description of the mathematics involved in the construction of the portals as well as the group structures given by them.

How to read this article
Sec. 3 gives details of previous work in recreating Thurston's idea.Sec. 4 contains a short introduction into branched coverings with some interesting examples.In Sec. 5, the software KnotPortal is described in detail.Finally, Sec. 6 provides examples of branched coverings and the corresponding deck transformation groups.
Readers only interested in the mathematical background of branched coverings of knots need only read Sec. 4 and maybe 6 for some examples.For understanding the project, all sections should be read in order, jumping to the examples in Sec.6 on occasion.This last section is of particular interest to those wanting to add own knots to KnotPortal, as it gives an algorithm for doing so.
Regardless the motivation, the reader is strongly advised to try out the software, or at least watch videos of its use, at https://imaginary.org/program/knotportal.

Project history
Previous attempts to model branched covers of knots include the software "Polycut" by Ken Brakke [Bra].This software was designed "for visualizing multiple universes connected by a certain kind of wormhole," with the purpose of illustrating "the author's contention that soap films are best viewed as minimal cuts in covering spaces."In the software, the user can view different knots and links and some of their branched covers as differently colored regions, as well as soap films, which are the minimal surfaces separating the sheets.
We wanted to achieve something different, as our goal was to give a real "world" instead of just colors, as well as to realize a virtual reality experience.
There was an attempt to achieve this by porting Ken Brakke's code to CAVE virtual reality technology by George Francis, Alison Ortony, Elizabeth Denne, Stuart Levy and John Sullivan during the illiMath2001 research program, however, this attempt remained unfruitful: "Though a complete solution to this visualization problem still eludes us, extensive geometrical documentation and evaluation of extant software was undertaken this summer and presented as a PME talk at MathFest, Madison, WI.", as reported at http://new.math.uiuc.edu/oldnew/im2001/In this project, we achieved our goal through a new software called KnotPortal, by using the combination of a game engine and a head-mounted virtual reality device capable of room-scale tracking (see Fig. 2).In our software, the user can move around in a fully immersive experience featuring different real worlds.It is adaptable as new knots can easily be added, and a non-VR version for use with a normal desktop computer can be used if a VR-headset is not available.

Mathematics background 4.1 Branched coverings
While this section gives a short overview on branched coverings, interested readers in this topic might want to consult a more comprehensive resource.Most standard textbooks on algebraic topology will do.
A covering map is a map p from a "covering space" E to a "base space" X, such that for any x ∈ X, the pre-image p −1 (U x ) of any neighborhood U x of x is a disjoint union of open sets Ũi∈I , with Ũi homeomorphic to U x for every i ∈ I.The cardinality of the index set I is also called the degree of the cover.In words, this means that every part of the base space has several copies of itself "above" it.Besides the trivial covering of the disjoint union of copies of a space covering the space itself, the classical example is the "exponential spiral".It is defined by the covering map p : R → S 1 from the covering space R to the base space S 1 , p(t) = exp 2πit , see Fig.The real line R coiled over the sphere S 1 .Every neighborhood of a point on the sphere has countably infinite many copies above it.As the covering space is simply connected, the cover is called universal as it covers every other cover of the base space.
If the assumption of every point being covered as described above is relaxed to most points, one obtains branched covering maps.To be precise, a map p is a branched covering map if it is a covering map for all points but those in a nowhere dense set S ⊆ B, the set of branch points.Here, classical examples are the complex square root function as a non-trivial cover of C on itself, which is a double, i.e. degree two, covering everywhere but at 0. Another example is the complex logarithm used as a countably infinite cover of the complex plane, giving rise to the "logarithmic spiral" in Fig. 6.
Another interesting example is the branched covering of the sphere by the torus, which is also known as Peirce quincuncial projection (see Fig. 8, or consult [Bae06] for a complete explanation).It is obtained by projecting the sphere to an octahedron, and then unfolding the octahedron by cutting all edges adjacent to a vertex on the square equator.The flattened version gives a square with the south pole at all corners (See Fig. 8a).This square can tile the plane by point reflection on the midpoint of the sides, as shown in Fig. 8b.This then defines a branched double covering of the sphere by the torus, depicted in Fig. 8d, with covering space the torus and base space the sphere.Every point on the globe is present on the torus twice, except for the branch points, which are only present once.Going around one of the branching points in the covering space also means going around the point on the globe twice.This is not apparent on the map, as Peirce placed the branch points in oceans, making them less visible.
Branched covers of the sphere are ubiquitous, as made precise by the Riemann existence theorem: every Riemann surface is the branched cover of the sphere [Har15].

History of the relationship between knots and branched coverings
Knots are everywhere in our world, and applications of knot theory range from understanding why headphones get tangled spontaneously [RS07] to phenomena in quantum physics [PAAI18].Although knots are found throughout human history, such as the famous Gordian Knot, their modern mathematical study first began in the 18 th century by Vandermonde [Van71] and rised together with topology [Prz07].The first applications of known mathematical methods to knots came with Poincaré's Analysis Situs [Poi95].Heegaard used topological methods to compute the 2-fold branch cover of the trefoil knot [Hee98], but did not use the result to discriminate the trefoil from the unknot, as this now central problem of knot theory was not of interest to him and was only proved by Tietze in 1908 using the fundamental group [Sti80,p. 226].He used the cover to construct "Riemann spaces," analog to the construction of Riemann surfaces in one dimension higher [Sti12].
Alexander then proved in [Ale20] that "Every closed orientable triangulable n-manifold M is a branched covering of the n-dimensional sphere", an extension of branched coverings of spheres of the Riemann existence theorem.The theory was even further developed when [HLM83] provided a universal knot, a knot such that every 3-manifold is a branched cover of the sphere with the knot as a branching set. 4he knot itself came into the center of attention when Wirtinger extended Heegaard's results and, together with his student Tietze, used the construction to compute a presentation of the fundamental group of the knot complement for every knot [Epp99].The knot group is thus a result of considerations of branched coverings of knots.

Software
The software was created with Unity3D [Uni17], the virtual reality gear is HP Mixed Reality5 .Scripts are in C# or, for the shaders, in DirectX 9-style HLSL.The deck transformation groups determining the gluing of the worlds as quotients of the respective knot group, as well as the associated multiplication tables were computed with the help of GAP [GAP19].

Input
As input, the software is given a knot through some parametrization, as well as a group multiplication table which can be generated with GAP.Examples for knot parametrizations together with group multiplication tables are given in Sec. 6.The software further needs a map defining which "cone segment" (see below) gets assigned to which group element, the generator-to-cone map.

The setting up of the cut surface
At the start of the program, the following steps are carried out.
1. Build all needed worlds 2. Set up a camera in each world, moving and rotating as the player camera moves and rotates.
3. Let each camera render to a full-screen sized texture, and assign the textures to the post-processing shader.Then, in the first world, we apply the cone construction from [Hee98] to the knot, see Fig. 9.The goal is to provide a cut surface for the gluing of the worlds.This is analogous to the cut line given in the construction of the domain of the complex logarithm in Fig. 6.In our case, we cut from the branch curve to a point at "infinity" (in the implementation a point sufficiently far away) so that the knot is in general position from its point of view.This defines a cone or cylinder6 and glue together the different worlds along the cutting surface.
1.The knot is placed in the world as a tubular mesh around a Catmull-Rom non self intersecting closed spline, given the control points from the discretized parametrization.
2. A point p is chosen, from which a normal knot projection is obtained.
3. A cone is built from this point by building a mesh formed by the triangles obtained through filling all line segments from p to every start and end of the line segments of the knot.This results in a sort of cone, possibly self-intersecting.
4. The cone is cut along the intersections, leading to a number of mesh pieces.These are duplicated and the duplicated has its normals flipped to give a backside.
5. Each "cone segment" is assigned a generator of the group according to the provided generator-tocone map.Its backside gets assigned the inverse of the generator.Now, in each frame, if the knot is visible, perform the following steps on the CPU: 1. Transform the knot's anchor points from world space into screen space.
2. Using the line segments, divide the screen space into polygonal regions by an algorithm of [dBCvKO08].
3. Find a central point in each region using a C# port of the "polylabel" algorithm from https: //github.com/mapbox/polylabelto find the pole of inaccessibility of the region.
4. Raycast each point from the camera, multiplying the current world generator with every generator from a cone segment encountered along the way.In this way, build a map assigning a generator to each polygonal screen region.1.For each pixel, perform an optimized7 point-in-polygon test.
2. Assign the pixel the pixel from the camera texture of the world corresponding to the polygon's generator.

Player teleportation
In each frame, perform a raycast from the players old position to his new one.Multiply the current world generator with every cone segment's generator encountered by the raycast, giving the new world.
Teleport the player to the point in the same place, but the new world.This implies that in contrast to expectation, teleportation occurs much later (or earlier, depending on the direction of approach to the knot) as one might think.It does not happen as one "passes through the portal," but as one passes through the cut surfaces, i.e. the cone segments, which are the "real" portal.

World design
The software comes with a two different sets of worlds, simple and real ones.The simple worlds are featureless colored places to enable low-end hardware to run the program, and for a more minimalist experience.
The other kind are the real worlds (such as in Fig. 2), which give the more rich experience.They were designed with several goals in mind.Firstly, they should be interesting enough to give the user a real motivation to step through the portal and look into other worlds.Secondly, they should not be too interesting, as to keep the focus of the experience on the knot and the portals, and not the world.The worlds are also color-coded, to enable the user to speak about "the white world" or "the blue world," which is also helpful in keeping the worlds apart, as well as easing the transition between simple and real worlds.The color codes where taken mainly from naturally occurring colors, with the addition of some colors not present on this planet but possible on other ones [KST + 07].

Example cases
These cases all describe branched covers of order 2, i.e. the knot as the branching curve has order 2. So a path going around a knot segment twice is back in the same world (sheet) it started in.
In general, the construction of the deck transformation groups is well-known.Given a (based) cyclic branched covering p : (E, e 0 ) → (X, x 0 ) the deck transformation groups can be computed through the Wirtinger presentation together with the fundamental theorem of covering spaces.
The Wirtinger presentation gives the generators of the knot group as loops around the knot strands, together with relations between them for every crossing of the strands.
The fundamental theorem then states that the deck transformation group is isomorphic to . Given a presentation of the knot group, as the covering is cyclic, we have for some coefficients k 1 , . . ., k n .As we restrict ourselves to branched covers of order 2, the coefficients are all 2. For the unknot K, the knot group is π 1 (S 3 \ K) which is π 1 (S 1 × D 2 ) ∼ = Z with presentation a .Taking the quotient of this group and the subgroup a 2 , which is the induced by the fundamental group of the covering space, as the simple generating loop has to go around the unknot twice before returning to the basepoint.This results in the presentation a | a 2 .This is thus a two-fold covering with deck transformation group Z 2 , or equivalently the (Coxeter) group A 1 .

Unknot
The unknot is represented in the software through the parametric equations   0.8 sin t 1.5 cos t 0   , generates |A 1 | = 2 worlds, and has 1 portal.The group multiplication matrix of A 1 is e a a e .As the cone associated to this knot has no self-intersections, the generator-to-cone map is trivial, assigning every cone segment the group element a.This case is of course the same as the unknot from a knot theoretical standpoint.

Twisted Unknot
As for the implementation, the knot is given by   2 sin(t + 1) 3 sin(t + 1) cos(t + 1) sin t   , but as there are two portals leading to the same world, the generator-to-cone map assigns a to both cone segments.This is the dihedral group of the triangle, and a Coxeter group with Coxeter matrix 1 3 3 1 .The group order 6 implies the construction of 6 worlds from this knot.In general, the r-fold branched covering of the torus knots of type (p, q) is a Brieskorn manifold M (p, q, r), the intersection of the 5-sphere S 5 in C 3 with the equation given through z p 1 + z q 2 + z r 3 = 1.[PAAI18].

Trefoil knot
In KnotPortal, the trefoil knot is represented through the parametric equations    .This group is a Coxeter group with matrix 1 2 2 1 , which is Z 2 2 , or equivalently, A 2 1 .This results in 4 worlds and 3 portals.8

Figure 1 :
Figure 1: Thurston stepping through a portal generated by the unknot from Earth to Narnia.

Figure 2 :
Figure 2: The author stepping through a portal given by the unknot.Screenshot from https: //youtu.be/Pgmfsl1e_vA

Figure 3 :
Figure 3: A twisted unknot in KnotPortal, showing two portals into a different world, as seen from the first (ice) world.

Figure 4 :
Figure 4: The same twisted unknot, now seen from the second (forest) world. 2

Figure 6 :
Figure6: Creating a branched cover of the complex plane by first cutting from the branch point to infinity, and then gluing together copies of the cut surface along the cutting line.

Figure 7 :
Figure7:The real line R coiled over the sphere S 1 .Every neighborhood of a point on the sphere has countably infinite many copies above it.As the covering space is simply connected, the cover is called universal as it covers every other cover of the base space.
(a) The map projection into a square.The red lines indicate the edges of the octahedron, which is obtained by folding the triangles at the corners backwards.Image from [Str12].(b) Tiling of the plane by the maps, which are marked in red.(c) The yellow fundamental region of the torus from Fig. 8b, with identical corners and identical opposing sides.The four branch points are now at the corner, the center, and the two midpoints of the sides.
(d) The fundamental region wrapped on a torus.The red lines both connect the Antarcticas.Image generated with[Per].

Figure 8 :
Figure 8: Different views of the Pierce quincuncial map projection.

Figure 10 :
Figure 10: Portals through the unknot, the twisted unknot, and the trefoil knot

Figure 11 :
Figure 11: The unknot under the z-projection

Figure 12 :
Figure 12: The twisted unknot under the z-projection

Figure 13 :
Figure 13: The trefoil knot under the z-projection

.
The generator-to-cone map assigns the elements a, b, and c to the three cone segments, respectively.The relationship between the group and the portals of the trefoil knot is detailed in Fig.14

Figure 14 :
Figure 14: The relationship between the elements of the symmetry group of the triangle D 3 and the portals generated by the trefoil knot, after the drawing in [Thu12].The outer portals correspond to reflections, the inner portal to a rotation.

Figure 15 :
Figure 15: The figure eight knot under the z-projection

Figure 16 :
Figure 16: The Hopf link under the z-projection