RationalPolygons.jl
RationalPolygons.jl is a pure Julia package for computations with rational convex polygons. It implements
- counting lattice points, Ehrhart Theory, normal forms, automorphism groups, computation of subpolygons,
- various classification algorithms for integral and rational polygons.
I have written RationalPolygons.jl in the span of about six months while working on a joint project with Martin Bohnert [1]. Its main purpose is to provide reference implementations of the classification algorithms developed in our paper. However, it also implements many more basic algorithms for computations with rational polygons that I believe might be useful in other projects, hence I have documented them here. RationalPolygons.jl does not make use of any external computer algebra system but implements all necessary algorithms, including two-dimensional euclidian geometry, from scratch in pure Julia. This allows for quite good performance, with computations involving billions of polygons being feasable on a personal computer.
Quick start
julia> using RationalPolygons
julia> P = convex_hull(LatticePoint{Int}[(1,0),(0,1),(-1,1),(-1,0),(0,-1),(1,-1)])
Rational polygon of rationality 1 with 6 vertices.
julia> plot_polygon(P)
ERROR: UndefVarError: plot_polygon not defined
julia> number_of_interior_lattice_points(P)
1
julia> number_of_boundary_lattice_points(P)
6
julia> euclidian_area(P)
3//1
julia> ehrhart_quasipolynomial(P)
1×3 Matrix{Int64}: 6 6 2
julia> affine_automorphism_group(P)
D6
julia> is_ldp(P)
true
julia> dual(P)
Rational polygon of rationality 1 with 6 vertices.
julia> are_affine_equivalent(P, dual(P))
true
julia> gorenstein_index(P)
1
- [1]
- M. Bohnert and J. Springer. Classifying rational polygons with small denominator and few interior lattice points (2024), arXiv:2410.17244 [math.CO].
- [2]
- J. Springer. The Picard index of a surface with torus action. Collectanea Mathematica (2024).
- [3]
- D. Haettig, B. Hafner, J. Hausen and J. Springer. Del Pezzo surfaces of Picard number one admitting a torus action (2022), arXiv:2207.14790 [math.AG].
- [4]
- D. Haettig, J. Hausen and J. Springer. Classifying log del Pezzo surfaces with torus action (2023), arXiv:2302.03095 [math.AG].
- [5]
- [6]
- D. A. Cox, J. B. Little and H. K. Schenck. Toric varieties. Vol. 124 of Graduate Studies in Mathematics (American Mathematical Society, Providence, RI, 2011); p. xxiv+841.
- [7]
- R. J. Koelman. The number of moduli of families of curves on toric surfaces. Ph.D. Thesis, University of Nijmegen (1991).
- [8]
- W. Castryck. Moving out the edges of a lattice polygon. Discrete Comput. Geom. 47, 496–518 (2012).
- [9]
- G. Brown and A. M. Kasprzyk. Small polygons and toric codes. J. Symbolic Comput. 51, 55–62 (2013).
- [10]
- A. M. Kasprzyk, M. Kreuzer and B. Nill. On the combinatorial classification of toric log del Pezzo surfaces. LMS J. Comput. Math. 13, 33–46 (2010).
- [11]
- A. Bäuerle. Sharp volume and multiplicity bounds for Fano simplices (2023), arXiv:2308.12719 [math.CO].