Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.14 KB

File metadata and controls

45 lines (31 loc) · 1.14 KB

PyTropical

License: MIT Open In Colab PyPI version


PyTropical is a Python package for tropical mathematics.

Installation

pip3 install pytropical

Examples

from pytropical.tropical_algebra import MaxPlusAlgebra
from pytropical.utils import *

maxp = MaxPlusAlgebra()
inf = maxp.inf #inf is the additive identity

#tropical sum
maxp.trop_sum(2.8, 3)

#tropical multiplication
maxp.trop_mult(90, inf)

#tropical exponentiation
print("2^3 = 2⨀2⨀2 = ", maxp.trop_pow(2, 3))

More examples are available in the Jupyter Notebook.

Dependencies