====== TropicalQuarticCurves ======
This is the software companion to the article "Computing tropical bitangents to smooth quartic curves in polymake" by
[[https://www.mis.mpg.de/people/alheydis-geiger|Alheydis Geiger]] and [[https://page.math.tu-berlin.de/~panizzut/|Marta Panizzut]]. This page also contains the updated version of the extension, which accompanies the article “Real Tropical Quartics and their Bitangents: Counting with Patchworking” by [[https://www.mis.mpg.de/people/alheydis-geiger|Alheydis Geiger]].
Smooth tropical quartic plane curves are parametrized by maximal cones in the unimodular secondary fan of the four-dilated 2-simplex. Up to $S_3$-symmetry there are 1278 such cones. They can be found at the [[https://db.polymake.org|database]]. This extension provides functions to determine the dual deformation motifs together with its real lifting conditions of the 7 bitangent classes for a given combinatorial type of a smooth tropical quartic. Moreover, we can compute the bitangent shapes for a chosen fixed tropical quartic curve as well as the number of real bitangents for any sign vector of a chosen lift of the quartic curve.
The collection QuarticCurves in the [[https://db.polymake.org|database]] can be accessed directly via a web front end or through [[https://api.mongodb.com/|mongodb's API]]. However, there are more functions available when this extension to polymake is used.
===== Download =====
{{ :extensions:tropicalquarticcurves-0.2.tgz |}} [28 Mar 2025], for polymake version 4.13 or newer.
Older Versions:
{{ :download:tropicalquarticcurves-0.1.tar.xz |}} [07 Dec 2021], for polymake version 4.5 or newer.
===== Installation =====
This requires an installation of polymake, version 4.13 or newer (for tropicalquarticcurves-0.1 polymake version 4.5 or newer is sufficient).
After download you first need to extract the code.
tar -xvzf tropicalquarticcurves-0.2.tgz
tar Jxpf tropicalquarticcurves-0.1.tar.xz
Suppose this ends up at ''/your/path/TropicalQuarticCurves-0.2''. Then you start up polymake. Within the polymake shell do:
import_extension "/your/path/TropicalQuarticCurves-0.2";
Do not forget to use an absolute path! Afterwards you are good to run the code. This import needs to be performed only once. The reference to the extension is permanently stored in ''$HOME/.polymake/settings''. For more details there is a [[user_guide/extend/extensions|guide to polymake's extension system]].
===== Examples =====
This extension contributes to the applications ''fan'' and ''tropical''. The first part shows only examples which are included in the functionality for version 0.1+. Examples for the new version 0.2 can be found below.
=== Examples for version 0.1+ ===
In the application `fan` you can create a ''DualSubdivisionOfQuartic'' derived from ''SubdivisionOfPoints'' by just specifying the maximal cells, as the points are predefined as the lattice points of the four dilated 2-simplex $4\Delta_2$ in a fixed ordering.
This extension contributes to the applications ''fan'' and ''tropical''.
> application "fan";
> $S = new DualSubdivisionOfQuartic(MAXIMAL_CELLS=>[[0,1,2],[2,4,5],[5,8,9],[9,11,12],[9,12,13],[9,13,14],[1,3,4],[3,7,8],[6,10,11],[3,6,11],[3,7,11],[3,4,8],[8,9,11],[1,2,4],[7,8,11],[4,5,8]]);
The ''DualSubdivisionOfQuartic'' encodes the combinatorial type of the tropical quartic curve. As proven in "A tropical count of real bitangents to plane quartic curves" the dual deformation motifs and the real lifting conditions of the bitangent classes only depend on the combinatorics, so they can be computed as properties of the ''DualSubdivisionOfQuartic''.
> $Motifs = $S->ALL_DEFORMATION_MOTIFS;
> for my $i (0..6) { print $Motifs->[$i]->TYPE,"\n"; }
A
A
A
B
EFJ
EFJ
G
> print $S->ALL_SIGN_CONDITIONS;
<{-1 5 8 9 11}
{-1 1 2 4 5}
>
<{-1 1 2 3 4}
{-1 3 7 8 11}
>
<{-1 3 7 8 11}
{3 5}
>
<{-1 3 7 8 11}
{7 9}
>
<{3 5}
{}
>
<{-1 1 2 3 4}
{}
>
<{-1 3 8 9 11}
{}
>
As the real lifting behavior of the bitangent classes only depends on the signs of the initial forms of the algebraic coefficients of the quartic curve, we can compute the number of real bitangents from the combinatorial type of the quartic curve and a sign vector of dimension 15.
> $v = new Vector([1,-1,1,-1,-1,1,1,1,1,1,1,1,1,1,1]);
> print give_pluecker($S,$v);
16
For investigating a concrete tropical quartic curve, we have the new object ''QuarticCurve'' in the application ''tropical'' that is derived from ''Hypersurface''. It can be computed by only giving the coefficients, as the monomials are fixed in the same order as the lattice points for ''DualSubdivisionOfQuartic''.
As ''QuarticCurve'' is derived from ''Hypersurface'' it can be used either in the max- or in the min-convention.
> application "tropical";
> $v = -$S->MIN_WEIGHTS;
> $H = new QuarticCurve(COEFFICIENTS=>$v);
In the above example, we used that the property ''MIN_WEIGHTS'' of ''DualSubdivisionOfQuartic'' computes a minimal integer vector in the associated secondary cone to gain a tropical quartic curve with the given combinatorial type.
For a given tropical quartic curve, we can compute the shapes of the 7 bitangent classes.
> print $H->BITANGENT_SHAPES;
A A A B J E G
The deformations between the shapes inside a deformation class of tropical bitangent class are given by hyperplanes that subdivide the secondary cone into chambers. We can determine the shape that is realized, by knowing in which half space the coefficient vector of a given tropical quartic curve is contained.
For every deformation motif that contains more than one shape, the extension can compute the corresponding hyperplanes inducing the deformations.
For deformation motifs that contain only one shape like deformation motif (A), there is no associated hyperplane.
> application "fan";
> print $Motifs->[0]->TYPE,"\n";
A
> print $Motifs->[0]->HYPERPLANES;
> print $Motifs->[5]->TYPE,"\n";
EFJ
> print $Motifs->[5]->HYPERPLANES;
0 -1 0 0 1 0 1 0 0 0 0 -1 0 0 0
To investigate the deformation behavior and to find coefficient vectors that give rise to different shapes, we can use the ''HyperplaneArrangment'' induced by the hyperplanes of the deformation motif(s).
> $Hyps = new Matrix([$Motifs->[4]->HYPERPLANES->row(0), $Motifs->[5]->HYPERPLANES->row(0) ]);
> $HA = new HyperplaneArrangement(HYPERPLANES=>$Hyps);
> $CD = $HA->CHAMBER_DECOMPOSITION;
> print $CD->N_MAXIMAL_CONES;
4
This subdivides the whole space into 4 maximal dimensional chambers.
> $R = $CD->RAYS;
> $NR0 = $R->minor($CD->MAXIMAL_CONES->[0], All);
> $C0 = new Cone(INPUT_RAYS=>$NR0,INPUT_LINEALITY=>$HA->LINEALITY_SPACE);
We have to intersect the cone from the chamber decomposition with the secondary cone of the ''DualSubdivisionOfQuartic'' and we have to test whether this intersection is still full-dimensional.
> $SC = $S->SECONDARY_CONE;
> $Cone0 = intersection($C0, $SC);
> print $Cone0->DIM == 15;
true
Taking the relative interior point in the new cone, we can define a quartic curve and ask for the bitangent shapes.
> $NP0 = $Cone0->REL_INT_POINT;
> $H0 = new tropical::QuarticCurve(COEFFICIENTS=>$NP0);
> print $H0->BITANGENT_SHAPES;
A A A B E E G
We can do the same for the remaining 3 chambers and see how the bitangent shapes deform. However, not all intersections of the chambers with the secondary cone will be maximal dimensional!
> $R = $CD->RAYS;
> $NR1 = $R->minor($CD->MAXIMAL_CONES->[1], All);
> $C1 = new Cone(INPUT_RAYS=>$NR1,INPUT_LINEALITY=>$HA->LINEALITY_SPACE);
> $Cone1 = intersection($C1, $SC);
> if ($Cone1->DIM == 15){
> $NP1 = $Cone1->REL_INT_POINT;
> $H1 = new tropical::QuarticCurve(COEFFICIENTS=>$NP1);
> print $H1->BITANGENT_SHAPES; }
A A A B F E G
If the dual subdivision is not generic, some attention is required!
> application "fan";
> $D = new DualSubdivisionOfQuartic(MAXIMAL_CELLS=>[[3,4,6],[5,8,9],[7,8,10],[8,9,10],[9,10,11],[9,11,12],[9,12,13],[9,13,14],[4,7,10],[1,3,4],[0,1,4],[0,4,8],[2,5,8],[4,6,10],[0,2,8],[4,7,8]]);
> print $D->IS_GENERIC;
false
> $Motifs = $D->ALL_DEFORMATION_MOTIFS;
> print $Motifs->[2]->TYPE;
C
For non-generic triangulations, the lifting conditions for shape C are not known, so the list of all sign conditions contains only 6 conditions.
> $Dsigns = $D->ALL_SIGN_CONDITIONS;
> print $Dsigns->rows(),"\n";
6
> print $Motifs->[2]->SIGN_CONDITIONS;
Triangulation is not generic.
Given a ''DualSubdivisionOfQuartic'', we can look for the identifier of the corresponding triangulation in the database collection ''TropicalQuarticCurves'' as showed below.
> $S = new DualSubdivisionOfQuartic(MAXIMAL_CELLS=>[[6,10,11],[3,6,11],[3,7,11],[7,11,12],[1,3,7],[4,8,12],[8,12,13],[0,4,8],[5,9,13],[9,13,14],[5,8,13],[2,5,8],[4,7,12],[0,4,7],[0,2,8],[0,1,7]]);
> print find_in_database($S);
100
=== Examples for version 0.2 ===
In the updated version, you can now
• compute the number of real bitangents for any unimodular triangulation of $4\Delta_2$ and a
given sign vector,
• obtain the sign conditions for any unimodular triangulation of $4\Delta_2$ also for the bitan-
gent class of shape (C),
• work with a real tropical curve and determine whether it is dividing, compute its
twisted edges and number of ovals.
The extension still contributes to the extensions ''fan'' and ''tropical''. The most additions were made within application tropical.
There exists now a new object, called ''RealQuarticCurve'', which consists of a tropical quartic curve with a sign distribution.
> application "tropical";
> $C = new RealQuarticCurve(COEFFICIENTS=>[5,1,2,2,0,0,4,0,1,16,7,9,12,16,33],SIGNS=>[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]);
The tropical quartic curve with its properties as demonstrated above can still be accessed.
> $Q = $C->QUARTIC_CURVE;
> print $Q->BITANGENT_SHAPES;
A H' J J G T W
The real quartic curve comes with real bitangents.
> print $C->N_REAL_BITANGENTS;
4
> print $C->REAL_BITANGENT_TYPES;
EFJ G GKUTT` W...HH+(xz)
> print $C->REAL_BITANGENT_SHAPES;
J G T W
> $Bitangentclasses = $C->REAL_BITANGENTS;
> for my $i (0..$C->N_REAL_BITANGENTS-1) {
> print $Bitangentclasses->[$i]->SIGN_CONDITIONS;
> }
{5 10}
{}
{5 10}
{}
{5 10}
{}
{}
{}
Further, the user can decide if a given real tropical quartic curve is dividing and how many ovals an real
algebraic lift would have.
> print $C->IS_DIVIDING;
false
> print $C->N_OVALS;
3
For a curve with two ovals, the property ''IS_DIVIDING'' allows to decide whether or not the two ovals are nested: If the curve is not dividing, the two ovals are not nested.
A picture of the real tropical curve can be accessed by using the visualization option of the Patchworking function in \texttt{polymake}.
> $p= $C->PATCHWORK;
> $p->realize->VISUAL;
Finally, the property ''TWISTED_EDGES'' records a list of edges in the dual subdivision(!) of the tropical curve that is twisted with respect to the given sign distribution.
> print $C->TWISTED_EDGES;
The twisted edges in the dual subdivision are
(8 10) (5 7) (5 8) (5 13) (4 7) (4 5) (1 7) (1 5) (1 4)
As the properties ''IS_DIVIDING'' and ''TWISTED_EDGES'' are only dependent on the dual subdivision of the curve and the given sign distribution, they were also added to application ''fan'' in the following two styles.
> application "fan";
> $S = new DualSubdivisionOfQuartic(MAXIMAL_CELLS=>[[0,1,2],[1,2,4], [2,4,12],[4,7,12],[2,8,12],[2,8,13],[8,12,13],[2,5,13],[5,9,13], [9,13,14],[7,11,12],[7,10,11],[4,7,10],[4,6,10],[3,4,6],[1,3,4]]);
> $v = new Vector([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]);
> print $S->IS_DIVIDING($v);
false
> print $S->TWISTED_EDGES($v);
(8 13) (8 12) (4 10) (2 4) (2 12) (2 13) (2 8) (1 4) (1 2)
The second way is more general, as it works for any ''SubdivisionOfPoints'' and not just for ''DualSubdivisionOfQuartic''.
> $T = new SubdivisionOfPoints(POINTS=>[[1,0,0],[1,1,0],[1,0,1],
[1,2,0],[1,1,1],[1,0,2]],MAXIMAL_CELLS=>[[0,1,2],[1,2,4],[2,4,5],
[2,3,4]]);
> $v = new Vector([1,1,1,1,1,1]);
> print twisted_edges($T,$v);
(1 2)
> print is_dividing($T,$v);
true
===Database update===
The updated data now additionally contains:
* for the 8 non-generic triangulations: ''PLUECKER_NUMBERS'' the number of possible real bitangents, and ''SIGN_REPRESENTATIVES'' an exemplary sign vector for each number of real bitangents,
* the sign conditions for the bitangent classes of shape (C),
* the property ''OVALS'' which contains the data that led to Theorem 3.10, i.e., the count of the number of sign vectors for which the triangulation has a given number of ovals together with an exemplary sign vector.