From 6e3cd5fc1cedab31c66df0a79eec257db0c07791 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:59:06 +0200 Subject: [PATCH 01/10] Update variety.md --- docs/src/TropicalGeometry/variety.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/src/TropicalGeometry/variety.md b/docs/src/TropicalGeometry/variety.md index a609a08aff7a..0e12b2ce6641 100644 --- a/docs/src/TropicalGeometry/variety.md +++ b/docs/src/TropicalGeometry/variety.md @@ -38,3 +38,6 @@ vertices_and_rays(TropV::TropicalVariety) vertices(TropV::TropicalVariety) visualize(TropV::TropicalVariety) ``` + +## Examples +I am working on creating some examples. From 5168d89576fa874b3ec028a04152918146e580f1 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:21:58 +0200 Subject: [PATCH 02/10] Moving changes to hypersurface.md --- docs/src/TropicalGeometry/variety.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/src/TropicalGeometry/variety.md b/docs/src/TropicalGeometry/variety.md index 0e12b2ce6641..a609a08aff7a 100644 --- a/docs/src/TropicalGeometry/variety.md +++ b/docs/src/TropicalGeometry/variety.md @@ -38,6 +38,3 @@ vertices_and_rays(TropV::TropicalVariety) vertices(TropV::TropicalVariety) visualize(TropV::TropicalVariety) ``` - -## Examples -I am working on creating some examples. From 2d0d6f8c61676a07202dbd289e469bd70c8d17c5 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:22:55 +0200 Subject: [PATCH 03/10] Added section for examples --- docs/src/TropicalGeometry/hypersurface.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index 812f54c28904..d653f2fda4d9 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -23,3 +23,6 @@ algebraic_polynomial(TropH::TropicalHypersurface) tropical_polynomial(TropH::TropicalHypersurface) dual_subdivision(TropH::TropicalHypersurface) ``` + +## Examples +I am working on creating some examples. From 5d2fe187a949e4f1b4656a8a13543312578eeae2 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:37:45 +0200 Subject: [PATCH 04/10] Update hypersurface.md Added example --- docs/src/TropicalGeometry/hypersurface.md | 59 ++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index d653f2fda4d9..67d6a351835d 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -25,4 +25,61 @@ dual_subdivision(TropH::TropicalHypersurface) ``` ## Examples -I am working on creating some examples. +The following code sets up an example and prints the vertices and rays of the tropical hypersurface (in no particular order). +```julia-repl +julia> TRing = tropical_semiring(); + +julia> Tx,(x1,x2) = polynomial_ring(TRing, 2); + +julia> g = 1 + 2*x1^2 + 2*x2^2 + 1*x1*x2; + +julia> THg = tropical_hypersurface(g); + +julia> vertRays = vertices_and_rays(THg) +5-element SubObjectIterator{Union{PointVector{QQFieldElem}, RayVector{QQFieldElem}}}: + [-1, -1] + [1, 0] + [0, 1] + [-1//2, 1//2] + [1//2, -1//2] +``` +By broadcasting the `typeof()` command, we can see, which are vertices, and which are rays. +```julia-repl +julia> typeof.(vertRays) +5-element Vector{DataType}: + RayVector{QQFieldElem} + RayVector{QQFieldElem} + RayVector{QQFieldElem} + PointVector{QQFieldElem} + PointVector{QQFieldElem} +``` +The maximal polyhedra of our tropical hypersurface is simply the edges (both bounded and unbounded). The command `maximal_polyhedra()` gives us a list of these edges (in no particular order). +```julia-repl +julia> maxPolTg = maximal_polyhedra(THg) +5-element SubObjectIterator{Polyhedron{QQFieldElem}}: + Polyhedron in ambient dimension 2 + Polyhedron in ambient dimension 2 + Polyhedron in ambient dimension 2 + Polytope in ambient dimension 2 + Polyhedron in ambient dimension 2 +``` +The polyhedrons are the unbounded edges, and the polytopes are the bounded edges. This is also made clear if we ask for the vertices of each of the maximal polyhedra (the bounded edges have a vertex at each end, while the unbounded only have one vertex). +```julia-repl +julia> vertices.(maxPolTg) +5-element Vector{SubObjectIterator{PointVector{QQFieldElem}}}: + [[-1//2, 1//2]] + [[1//2, -1//2]] + [[-1//2, 1//2]] + [[-1//2, 1//2], [1//2, -1//2]] + [[1//2, -1//2]] +``` +Instead of being between two vertices, the unbounded edges are defined by a vertex and a ray. +```julia-repl +julia> rays.(maxPolTg) +5-element Vector{SubObjectIterator{RayVector{QQFieldElem}}}: + [[-1, -1]] + [[-1, -1]] + [[0, 1]] + 0-element SubObjectIterator{RayVector{QQFieldElem}} + [[1, 0]] +``` From 81c9718010f021a3185b8aa280908b54b8a52441 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:38:30 +0200 Subject: [PATCH 05/10] Update hypersurface.md Changed "Examples" to "Example" --- docs/src/TropicalGeometry/hypersurface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index 67d6a351835d..790e4aeae31d 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -24,7 +24,7 @@ tropical_polynomial(TropH::TropicalHypersurface) dual_subdivision(TropH::TropicalHypersurface) ``` -## Examples +## Example The following code sets up an example and prints the vertices and rays of the tropical hypersurface (in no particular order). ```julia-repl julia> TRing = tropical_semiring(); From fd864973189299aec5893d999fd334d273f6e792 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:40:21 +0200 Subject: [PATCH 06/10] Update hypersurface.md Changed code-environments to jldoctest --- docs/src/TropicalGeometry/hypersurface.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index 790e4aeae31d..3cb6fa63681b 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -26,7 +26,7 @@ dual_subdivision(TropH::TropicalHypersurface) ## Example The following code sets up an example and prints the vertices and rays of the tropical hypersurface (in no particular order). -```julia-repl +```jldoctest julia> TRing = tropical_semiring(); julia> Tx,(x1,x2) = polynomial_ring(TRing, 2); @@ -44,7 +44,7 @@ julia> vertRays = vertices_and_rays(THg) [1//2, -1//2] ``` By broadcasting the `typeof()` command, we can see, which are vertices, and which are rays. -```julia-repl +```jldoctest julia> typeof.(vertRays) 5-element Vector{DataType}: RayVector{QQFieldElem} @@ -54,7 +54,7 @@ julia> typeof.(vertRays) PointVector{QQFieldElem} ``` The maximal polyhedra of our tropical hypersurface is simply the edges (both bounded and unbounded). The command `maximal_polyhedra()` gives us a list of these edges (in no particular order). -```julia-repl +```jldoctest julia> maxPolTg = maximal_polyhedra(THg) 5-element SubObjectIterator{Polyhedron{QQFieldElem}}: Polyhedron in ambient dimension 2 @@ -64,7 +64,7 @@ julia> maxPolTg = maximal_polyhedra(THg) Polyhedron in ambient dimension 2 ``` The polyhedrons are the unbounded edges, and the polytopes are the bounded edges. This is also made clear if we ask for the vertices of each of the maximal polyhedra (the bounded edges have a vertex at each end, while the unbounded only have one vertex). -```julia-repl +```jldoctest julia> vertices.(maxPolTg) 5-element Vector{SubObjectIterator{PointVector{QQFieldElem}}}: [[-1//2, 1//2]] @@ -74,7 +74,7 @@ julia> vertices.(maxPolTg) [[1//2, -1//2]] ``` Instead of being between two vertices, the unbounded edges are defined by a vertex and a ray. -```julia-repl +```jldoctest julia> rays.(maxPolTg) 5-element Vector{SubObjectIterator{RayVector{QQFieldElem}}}: [[-1, -1]] From 6fa560c5fec941944e017d34e8716c87211d01ac Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:41:06 +0200 Subject: [PATCH 07/10] Update hypersurface.md Added meta setup for doctest and labels for codeblocks --- docs/src/TropicalGeometry/hypersurface.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index 3cb6fa63681b..089f1904936f 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -25,8 +25,12 @@ dual_subdivision(TropH::TropicalHypersurface) ``` ## Example +```@meta +CurrentModule = Oscar +DocTestSetup = Oscar.doctestsetup() +``` The following code sets up an example and prints the vertices and rays of the tropical hypersurface (in no particular order). -```jldoctest +```jldoctest exampleHypersurface julia> TRing = tropical_semiring(); julia> Tx,(x1,x2) = polynomial_ring(TRing, 2); @@ -44,7 +48,7 @@ julia> vertRays = vertices_and_rays(THg) [1//2, -1//2] ``` By broadcasting the `typeof()` command, we can see, which are vertices, and which are rays. -```jldoctest +```jldoctest exampleHypersurface julia> typeof.(vertRays) 5-element Vector{DataType}: RayVector{QQFieldElem} @@ -54,7 +58,7 @@ julia> typeof.(vertRays) PointVector{QQFieldElem} ``` The maximal polyhedra of our tropical hypersurface is simply the edges (both bounded and unbounded). The command `maximal_polyhedra()` gives us a list of these edges (in no particular order). -```jldoctest +```jldoctest exampleHypersurface julia> maxPolTg = maximal_polyhedra(THg) 5-element SubObjectIterator{Polyhedron{QQFieldElem}}: Polyhedron in ambient dimension 2 @@ -64,7 +68,7 @@ julia> maxPolTg = maximal_polyhedra(THg) Polyhedron in ambient dimension 2 ``` The polyhedrons are the unbounded edges, and the polytopes are the bounded edges. This is also made clear if we ask for the vertices of each of the maximal polyhedra (the bounded edges have a vertex at each end, while the unbounded only have one vertex). -```jldoctest +```jldoctest exampleHypersurface julia> vertices.(maxPolTg) 5-element Vector{SubObjectIterator{PointVector{QQFieldElem}}}: [[-1//2, 1//2]] @@ -74,7 +78,7 @@ julia> vertices.(maxPolTg) [[1//2, -1//2]] ``` Instead of being between two vertices, the unbounded edges are defined by a vertex and a ray. -```jldoctest +```jldoctest exampleHypersurface julia> rays.(maxPolTg) 5-element Vector{SubObjectIterator{RayVector{QQFieldElem}}}: [[-1, -1]] From 8a06538dadca36e8098ffc6d17aff32e094a4245 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:18:49 +0200 Subject: [PATCH 08/10] Update hypersurface.md Moved the meta setup to top of document to match structure of other documents. --- docs/src/TropicalGeometry/hypersurface.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index 089f1904936f..5b22e02d6139 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -1,3 +1,7 @@ +```@meta +CurrentModule = Oscar +DocTestSetup = Oscar.doctestsetup() +``` # Tropical hypersurfaces ## Introduction @@ -25,10 +29,6 @@ dual_subdivision(TropH::TropicalHypersurface) ``` ## Example -```@meta -CurrentModule = Oscar -DocTestSetup = Oscar.doctestsetup() -``` The following code sets up an example and prints the vertices and rays of the tropical hypersurface (in no particular order). ```jldoctest exampleHypersurface julia> TRing = tropical_semiring(); From 2d8e0c99c33b18adcdeb2b64034edaf94ecb6709 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:59:03 +0200 Subject: [PATCH 09/10] Update hypersurface.md Changed TRing to T and THg to TropH for consistency. --- docs/src/TropicalGeometry/hypersurface.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index 5b22e02d6139..f094037a53c2 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -31,15 +31,15 @@ dual_subdivision(TropH::TropicalHypersurface) ## Example The following code sets up an example and prints the vertices and rays of the tropical hypersurface (in no particular order). ```jldoctest exampleHypersurface -julia> TRing = tropical_semiring(); +julia> T = tropical_semiring(); -julia> Tx,(x1,x2) = polynomial_ring(TRing, 2); +julia> Tx,(x1,x2) = polynomial_ring(T, 2); julia> g = 1 + 2*x1^2 + 2*x2^2 + 1*x1*x2; -julia> THg = tropical_hypersurface(g); +julia> TropH = tropical_hypersurface(g); -julia> vertRays = vertices_and_rays(THg) +julia> vertRays = vertices_and_rays(TropH) 5-element SubObjectIterator{Union{PointVector{QQFieldElem}, RayVector{QQFieldElem}}}: [-1, -1] [1, 0] @@ -59,7 +59,7 @@ julia> typeof.(vertRays) ``` The maximal polyhedra of our tropical hypersurface is simply the edges (both bounded and unbounded). The command `maximal_polyhedra()` gives us a list of these edges (in no particular order). ```jldoctest exampleHypersurface -julia> maxPolTg = maximal_polyhedra(THg) +julia> maxPol = maximal_polyhedra(TropH) 5-element SubObjectIterator{Polyhedron{QQFieldElem}}: Polyhedron in ambient dimension 2 Polyhedron in ambient dimension 2 @@ -69,7 +69,7 @@ julia> maxPolTg = maximal_polyhedra(THg) ``` The polyhedrons are the unbounded edges, and the polytopes are the bounded edges. This is also made clear if we ask for the vertices of each of the maximal polyhedra (the bounded edges have a vertex at each end, while the unbounded only have one vertex). ```jldoctest exampleHypersurface -julia> vertices.(maxPolTg) +julia> vertices.(maxPol) 5-element Vector{SubObjectIterator{PointVector{QQFieldElem}}}: [[-1//2, 1//2]] [[1//2, -1//2]] @@ -79,7 +79,7 @@ julia> vertices.(maxPolTg) ``` Instead of being between two vertices, the unbounded edges are defined by a vertex and a ray. ```jldoctest exampleHypersurface -julia> rays.(maxPolTg) +julia> rays.(maxPol) 5-element Vector{SubObjectIterator{RayVector{QQFieldElem}}}: [[-1, -1]] [[-1, -1]] From e8f3f278154b2601e0c3f7f4560ddc4cc7a108a2 Mon Sep 17 00:00:00 2001 From: MarieKaltoft <151847984+MarieKaltoft@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:22:09 +0200 Subject: [PATCH 10/10] Update hypersurface.md Added IncidenceMatrix and rewrote text to fit. --- docs/src/TropicalGeometry/hypersurface.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/src/TropicalGeometry/hypersurface.md b/docs/src/TropicalGeometry/hypersurface.md index f094037a53c2..427af5d57174 100644 --- a/docs/src/TropicalGeometry/hypersurface.md +++ b/docs/src/TropicalGeometry/hypersurface.md @@ -67,7 +67,20 @@ julia> maxPol = maximal_polyhedra(TropH) Polytope in ambient dimension 2 Polyhedron in ambient dimension 2 ``` -The polyhedrons are the unbounded edges, and the polytopes are the bounded edges. This is also made clear if we ask for the vertices of each of the maximal polyhedra (the bounded edges have a vertex at each end, while the unbounded only have one vertex). +The polyhedrons are the unbounded edges, and the polytopes are the bounded edges. + +The incidence matrix of the maximal polyhedra is a list of the relations between the elements of `vertices_and_rays(TropH)`. +From these relations, we can draw the hypersurface. However, one should be careful, as there is no distinction between vertices and rays in the incidence matrix. +```jldoctest exampleHypersurface +julia> IncidenceMatrix(maxPol) +5×5 IncidenceMatrix +[1, 4] +[1, 5] +[3, 4] +[4, 5] +[2, 5] +``` +This is made clearer if we ask for the vertices of each of the maximal polyhedra (the bounded edges have a vertex at each end, while the unbounded only have one vertex). ```jldoctest exampleHypersurface julia> vertices.(maxPol) 5-element Vector{SubObjectIterator{PointVector{QQFieldElem}}}: @@ -77,7 +90,7 @@ julia> vertices.(maxPol) [[-1//2, 1//2], [1//2, -1//2]] [[1//2, -1//2]] ``` -Instead of being between two vertices, the unbounded edges are defined by a vertex and a ray. +Instead of being between two vertices, the unbounded edges are defined by a vertex and a ray. These rays can be seen in the following way. ```jldoctest exampleHypersurface julia> rays.(maxPol) 5-element Vector{SubObjectIterator{RayVector{QQFieldElem}}}: