I was going through this code and got error. But I could not understand why this is the case.
sage: T = TropicalSemiring(QQ) sage: T(1) 1 sage: T(2) 2 sage: T(-2) -2 sage: -T(2) --------------------------------------------------------------------------- ArithmeticError Traceback (most recent call last) Cell In[26], line 1 ----> 1 -T(Integer(2)) File ~/sage/src/sage/rings/semirings/tropical_semiring.pyx:278, in sage.rings.semirings.tropical_semiring.TropicalSemiringElement.__neg__() 276 if self._val is None: 277 return self --> 278 raise ArithmeticError("cannot negate any non-infinite element") 279 280 cpdef _mul_(left, right) noexcept: ArithmeticError: cannot negate any non-infinite element sage: It looks like starting with T(-2) and reaching to -2 from T(2) by comparing with zero(+Inf) are different things. T(-2) = -2 T(2) -T(2) = T.zero(+inf) = T(2) + (-T(2)) My doubt is : if we cannot negate the elements, then how can we compute the determinant of a Matrix over Tropical Semiring. For example in 2x2 matrix : [[a,b], [c,d]] the determinant should be ad - bc But can it be expressed as ad + (-bc) -->> min ( add(a,d), -1*add(b,c) )? In fact we connot even do matrix subtraction directly. What can be done in these cases?? On Thursday, March 21, 2024 at 8:48:26 PM UTC+5:30 Animesh Shree wrote: > Hello Sir, > > I have submitted my proposal. > Please review it and let me know necessary updates and improvements. > > I want to verify soundness of my approach and extend the proposal for > Multivariate Polynomials. > > Thank You > Animesh Shree > On Tuesday, March 12, 2024 at 12:26:38 AM UTC+5:30 tcscrims wrote: > >> Mathematically speaking, you can always weaken axioms. However, there are >> some extra advantages that additive groups have that commutative semirings >> don't have (mainly 0, the additive identity). >> >> That being said, there isn't anything prevent you from constructing the >> appropriate categories. It would be good to have a more specific use-case >> in mind, but that isn't necessary. However, one should be careful with the >> name because it would conflict with what "most" people would call an >> algebra (which is why we have MagmaticAlgebras). >> >> Best, >> Travis >> >> >> On Tuesday, March 12, 2024 at 2:57:29 AM UTC+9 anime...@iiits.in wrote: >> >>> Hello Sir, >>> >>> I was going through "Algebras" and I had a doubt. >>> Does MagmaticAlgebra and AssociativeAlgebra have to be implemented over >>> Ring only? >>> I went through internet and google uses rings to define those algebras, >>> but the axioms that those algebra follow (Unital, Associative) are also >>> preserved by commutative semirings. >>> Would it be good to define MagmaticAlgebra and AssociativeAlgebra over >>> other objects that follow those axioms too or come-up with alternative >>> Algebra? >>> >> -- You received this message because you are subscribed to the Google Groups "sage-gsoc" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-gsoc+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-gsoc/4b90a7f0-bc3c-4ccd-b180-dbf3362ff235n%40googlegroups.com.