I've checked it properly, so there may be some mistakes.
TL;DR
Sage or SageMath is one of the computational algebraic systems implemented by extending Python, and is a free version of Mathematica. It is also a development environment that integrates computational algebraic libraries released as various open source software aiming at alternatives.
The structure of the object handled in mathematics is more complicated than the structure of types handled in programming languages (for example, inheritance and derivation. It is complicated enough because there are various other structures, but ...), so to handle this In Sage, a unique type conversion mechanism (cercion system) is implemented.
Therefore, if you want to define a new target on your own, you can benefit from the type conversion mechanism by defining it according to the rules of this implementation. Sage is an extension of Python, so of course you can implement it as a Python language. In this case, you cannot benefit from Sage's type conversion mechanism.
Simply put, all objects are basically treated as instances of classes derived from the Element class. Also, if there is some set corresponding to the concept of type such as a set, group, or field, and you want to extract (generate) an element from this set, you can associate the derived class of Parent class with the derived class of Element class. , Implement this relationship. In Sage, by writing the code according to certain rules, it is possible to implement a unique target while using the type conversion mechanism in Sage.
Category
TODO: Not investigated.
Recommended Posts