## The simplest pants decompositions¶

Here we explore, test, and correct code written earlier for enumerating pants decompositions. A component to illustrate these has been added

In [1]:
import $cp.bin.superficial-f34f201810.jar import superficial._  Out[1]: import$cp.\$

import superficial._
In [2]:
import superficial._

Out[2]:
import superficial._

We enumerate all the pants decompositions with 2 pairs of pants, i.e., for surfaces of genus 2, up to isomorphism. There are two such decompositions.

In [3]:
val genus2 = PantsSurface.allClosed(2).toVector
genus2.size

Out[3]:
genus2: Vector[PantsSurface] = Vector(
PantsSurface(
2,
Set(
Curve(PantsBoundary(0, Z3(0)), PantsBoundary(1, Z3(0))),
Curve(PantsBoundary(0, Z3(1)), PantsBoundary(1, Z3(1))),
Curve(PantsBoundary(0, Z3(2)), PantsBoundary(1, Z3(2)))
)
),
PantsSurface(
2,
Set(
Curve(PantsBoundary(0, Z3(0)), PantsBoundary(0, Z3(1))),
Curve(PantsBoundary(0, Z3(2)), PantsBoundary(1, Z3(0))),
Curve(PantsBoundary(1, Z3(1)), PantsBoundary(1, Z3(2)))
)
)
)
res2_1: Int = 2
In [4]:
val Vector(surf1, surf2) = genus2

Out[4]:
surf1: PantsSurface = PantsSurface(
2,
Set(
Curve(PantsBoundary(0, Z3(0)), PantsBoundary(1, Z3(0))),
Curve(PantsBoundary(0, Z3(1)), PantsBoundary(1, Z3(1))),
Curve(PantsBoundary(0, Z3(2)), PantsBoundary(1, Z3(2)))
)
)
surf2: PantsSurface = PantsSurface(
2,
Set(
Curve(PantsBoundary(0, Z3(0)), PantsBoundary(0, Z3(1))),
Curve(PantsBoundary(0, Z3(2)), PantsBoundary(1, Z3(0))),
Curve(PantsBoundary(1, Z3(1)), PantsBoundary(1, Z3(2)))
)
)

We now make pictures for these. First we generate these as svg using scala.xml

In [5]:
val pics = genus2.map(SvgPlot.plotPantsSurface)

Out[5]:
pics: Vector[xml.Elem] = Vector(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
Seq(
...

Now we can view them.

In [6]:
import almond.interpreter.api._
val picData = pics.map(p => DisplayData.svg(p.toString))

Out[6]:
import almond.interpreter.api._

picData: Vector[DisplayData] = Vector(
DisplayData(
Map(
"image/svg+xml" -> """<svg version="1.1" baseProfile="full" viewBox="0 0 600 300" xmlns="http://www.w3.org/2000/svg">
<line x1="125" x2="100" y1="75" y2="118" stroke="hsl(288, 100%, 50%)" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="106" x2="105" y1="107" y2="103" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="106" x2="110" y1="107" y2="106" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><text x="118" y="85">9</text><line x1="100" x2="50" y1="118" y2="118" stroke="hsl(9, 100%, 50%)" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="62" x2="65" y1="118" y2="115" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="62" x2="65" y1="118" y2="121" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><text x="87" y="118">10</text><line x1="50" x2="25" y1="118" y2="75" stroke="hsl(171, 100%, 50%)" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="31" x2="35" y1="85" y2="86" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="31" x2="30" y1="85" y2="89" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><text x="43" y="107">12</text><line x1="25" x2="49" y1="75" y2="31" stroke="hsl(0, 100%, 50%)" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="43" x2="44" y1="42" y2="46" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="43" x2="39" y1="42" y2="43" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><text x="31" y="64">1</text><line x1="49" x2="100" y1="31" y2="31" stroke="hsl(243, 100%, 50%)" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="87" x2="84" y1="31" y2="34" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="87" x2="84" y1="31" y2="28" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><text x="62" y="31">4</text><line x1="100" x2="125" y1="31" y2="74" stroke="hsl(45, 100%, 50%)" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="118" x2="114" y1="64" y2="63" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="118" x2="119" y1="64" y2="60" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><text x="106" y="42">6</text><line x1="125" x2="100" y1="225" y2="268" stroke="hsl(81, 100%, 50%)" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="106" x2="105" y1="257" y2="253" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><line x1="106" x2="110" y1="257" y2="256" stroke="black" stroke-width="1" xmlns="http://www.w3.org/2000/svg"></line><text x="118" y="235">2</text><line x1="100" x2="50" ...
In [7]:
display(picData(0))

In [8]:
display(picData(1))

In [ ]: