TropAJ is a Python repository for computing the tropical Abel--Jacobi transform of a metric graph and tropical distances on its tropical Jacobian. This repository also contains source codes for experiments in the paper
Computing the Tropical Abel--Jacobi Transform and Tropical Distances for Metric Graphs
Some tutorials about the tropical Abel--Jacobi transform and this repository are included in notebooks.
The repository depends on several Python libraries from different scientific fields. For your purpose it is not necessary to install all of them.
- The computation of tropical Abel--Jacobi transform depends on NetworkX;
- The computation of tropical polarization distance depends on fplll and G6K (not available on Windows system);
- The computation of Foster--Zhang distance depends on Pyomo, and any MIP solver (in the paper, Cbc, Ipopt, GLPK, SCIP are tested).
The repository is organized as follows:
srccontains modules for tropical transform and tropical distances:mgraph.py: metric graph class, with functions for operations on metric graphs and computations of the tropical Abel--Jacobi transformtropdist: functions for computations of tropical distances
notebookscontains jupyter notebook tutorials:tropical transform: tutorial of tropical Abel--Jacobi transformtropical distances: tutorial of tropical distances on the tropical Jacobian
scriptscontains source codes for experiments in the original paper:fplll_l2_dist.py: computation usingfplllg6k_l2_dist.py: computation usingg6kfs_dist.py: computation using MIP solversbabai_dist_time.pyandbabai_dist_error.py: computation using Babai's algorithms
datacontains numerical outputs of experiments in the original paper
You can use the following BibTex entry:
@misc{cao2025computingtropicalabeljacobitransform,
title={Computing the Tropical Abel--Jacobi Transform and Tropical Distances for Metric Graphs},
author={Yueqi Cao and Anthea Monod},
year={2025},
eprint={2504.11619},
archivePrefix={arXiv},
primaryClass={math.AG},
url={https://arxiv.org/abs/2504.11619},
}
If you are interested in this work, or if you find any bug in the code, please contact y.cao21@imperial.ac.uk