-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TropicalGeometry: tests for varieties and bugfixes
- Loading branch information
Showing
4 changed files
with
46 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
@testset "src/TropicalGeometry/{variety,hypersurface,curve,linear_space}.jl" begin | ||
|
||
# no dedicated tests for variety.jl | ||
# will be tested inside the following testsets | ||
|
||
@testset "hypersurface.jl" begin | ||
# semiring min | ||
T = tropical_semiring() | ||
R,(x,y) = T["x","y"] | ||
f = x^3+y^3+1*x*y+0 | ||
TropH = tropical_hypersurface(f) | ||
S,(x,y) = QQ["x","y"]; | ||
TropV = first(tropical_variety(ideal(S,[x^3+y^3+1]))) # default trivial valuation, min convention | ||
@test issetequal(vertices_and_rays(TropH),vertices_and_rays(TropV)) | ||
@test n_maximal_polyhedra(TropH)==3 | ||
|
||
# semiring max | ||
T = tropical_semiring(max) | ||
R,(x,y) = T["x","y"] | ||
f = x^3+y^3+(-1)*x*y+0 | ||
TropH = tropical_hypersurface(f) | ||
S,(x,y) = QQ["x","y"]; | ||
nu = tropical_semiring_map(QQ,max) | ||
TropV = first(tropical_variety(ideal(S,[x^3+y^3+1]),nu)) | ||
@test issetequal(vertices_and_rays(TropH),vertices_and_rays(TropV)) | ||
@test n_maximal_polyhedra(TropH)==3 | ||
# constructing various tropicalizations two ways | ||
# and comparing their results | ||
@testset "hypersurface and linear spaces" begin | ||
R,(x,y,z) = QQ["x","y","z"] | ||
f = x+2*y+4*z | ||
nu = tropical_semiring_map(QQ,2) | ||
TropH = tropical_hypersurface(f,nu) | ||
TropL = tropical_linear_space(ideal(R,f),nu) | ||
@test issetequal(maximal_polyhedra(TropH),maximal_polyhedra(TropL)) | ||
nu = tropical_semiring_map(QQ,2,max) | ||
TropH = tropical_hypersurface(f,nu) | ||
TropL = tropical_linear_space(ideal(R,f),nu) | ||
@test issetequal(maximal_polyhedra(TropH),maximal_polyhedra(TropL)) | ||
end | ||
|
||
# trivial, min | ||
R,(x,y) = QQ["x","y"] | ||
f = x^3+y^3+x*y+0 | ||
TropH = tropical_hypersurface(f) | ||
TropV = first(tropical_variety(f)) | ||
issetequal(vertices_and_rays(TropH),vertices_and_rays(TropV)) | ||
n_maximal_polyhedra(TropH)==3 | ||
@testset "binomial ideals and linear spaces" begin | ||
R,(x,y,z,w) = QQ["x","y","z","w"] | ||
I = ideal(R,[x+2*y,z+4*w]) | ||
nu = tropical_semiring_map(QQ,2) | ||
TropV = first(tropical_variety(I,nu)) | ||
TropL = tropical_linear_space(I,nu) | ||
@test issetequal(maximal_polyhedra(TropV),maximal_polyhedra(TropL)) | ||
nu = tropical_semiring_map(QQ,2,max) | ||
TropV = first(tropical_variety(I,nu)) | ||
TropL = tropical_linear_space(I,nu) | ||
@test issetequal(maximal_polyhedra(TropV),maximal_polyhedra(TropL)) | ||
end | ||
|
||
# trivial, max | ||
nu = tropical_semiring_map(QQ,max) | ||
@testset "hypersurface and binomial ideals" begin | ||
R,(x,y,z) = QQ["x","y","z"] | ||
f = x*y*z+2 | ||
nu = tropical_semiring_map(QQ,2) | ||
TropH = tropical_hypersurface(f,nu) | ||
TropV = first(tropical_variety(ideal(R,f),nu)) | ||
@test issetequal(maximal_polyhedra(TropH),maximal_polyhedra(TropV)) | ||
nu = tropical_semiring_map(QQ,2,max) | ||
TropV = first(tropical_variety(ideal(R,f),nu)) | ||
TropH = tropical_hypersurface(f,nu) | ||
TropV = first(tropical_variety(f,nu)) | ||
issetequal(vertices_and_rays(TropH),vertices_and_rays(TropV)) | ||
n_maximal_polyhedra(TropH)==3 | ||
@test issetequal(maximal_polyhedra(TropH),maximal_polyhedra(TropV)) | ||
end | ||
|
||
end |