Tropical Semirings
AUTHORS:
Bases: sage.structure.parent.Parent, sage.structure.unique_representation.UniqueRepresentation
The tropical semiring.
Given an ordered additive semigroup , we define the tropical
semiring
by defining tropical addition
and multiplication as follows:
In particular, note that there are no (tropical) additive inverses
(except for ), and every element in
has a (tropical)
multiplicative inverse.
There is an alternative definition where we define
and alter tropical addition to be defined by
To use the definition, set the argument use_min = False.
INPUT:
EXAMPLES:
sage: T = TropicalSemiring(QQ)
sage: elt = T(2); elt
2
Recall that tropical addition is the minimum of two elements:
sage: T(3) + T(5)
3
Tropical multiplication is the addition of two elements:
sage: T(2) * T(3)
5
sage: T(0) * T(-2)
-2
We can also do tropical division and arbitrary tropical exponentiation:
sage: T(2) / T(1)
1
sage: T(2)^(-3/7)
-6/7
Note that “zero” and “one” are the additive and multiplicative
identities of the tropical semiring. In other words,
they are not and
respectively, but instead
the (tropical) additive and multiplicative identities
and
respectively:
sage: T.zero() + T(3) == T(3)
True
sage: T.one() * T(3) == T(3)
True
alias of TropicalSemiringElement
Return the (tropical) additive identity element
.
EXAMPLES:
sage: T = TropicalSemiring(QQ) sage: T.zero_element() +infinity
Return the generators of self.
EXAMPLES:
sage: T = TropicalSemiring(QQ)
sage: T.gens()
(1, +infinity)
Return the (tropical) additive identity element
.
EXAMPLES:
sage: T = TropicalSemiring(QQ) sage: T.zero_element() +infinity
Return the (tropical) multiplicative identity element
.
EXAMPLES:
sage: T = TropicalSemiring(QQ) sage: T.one_element() 0
Return the (tropical) multiplicative identity element
.
EXAMPLES:
sage: T = TropicalSemiring(QQ) sage: T.one_element() 0
Return the (tropical) multiplicative identity element
.
EXAMPLES:
sage: T = TropicalSemiring(QQ) sage: T.one_element() 0
Return the (tropical) additive identity element
.
EXAMPLES:
sage: T = TropicalSemiring(QQ) sage: T.zero_element() +infinity
Return the (tropical) additive identity element
.
EXAMPLES:
sage: T = TropicalSemiring(QQ) sage: T.zero_element() +infinity
Bases: sage.structure.element.RingElement
An element in the tropical semiring over an ordered additive semigroup
. Either in
or
. The operators
are defined as
the tropical operators
respectively.
Return the multiplicative order of self.
EXAMPLES:
sage: T = TropicalSemiring(QQ)
sage: T.one().multiplicative_order()
1
sage: T.zero().multiplicative_order()
+Infinity
Bases: sage.categories.map.Map
Map from the tropical semiring to itself (possibly with different bases). Used in coercion.