Hi Vincent, On 2017-12-26, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > While working on Puiseux series [1] I wanted to introduce a construction > functor for them. When the base ring is algebraically closed then it is > an algebraic closure functor (from power series). But when it is not, it > is an infinite algebraic extension (ie adding all x^(1/n)). I think that > it would make sense for such a functor since the same construction is in > action from QQ to the universal cyclotomic field. > > Any suggestion on what should be done here?
I am not sure if I understand what you're asking. Let's try: Is the construction a functor? If yes: What categories are domain and range of the functor? It is of course possible that domain/range depend on parameters. The construction() method of an appropriate parent P then needs to return an instance F of that construction functor, plus a parent Q such that P is F(Q). To implement a construction functor: - Perhaps __init__, unless you can simply provide domain and codomain upon creation of F, without any further parameters. - _apply_functor_to_morphism: How does F map a morphism? - _apply_functor: How does F map a parent (such as Q)? This can of course invoke a method of Q that returns whatever the result should be. - merge and pushout are probably needed, and a rank needs to be assigned. - If your functor relies on parameters (such as variable names, in the case of a MultiPolynomialFunctor), you may also need to implement __eq__ etc (by the way: Why isn't it implemented by _richcmp_?) - If something special is supposed to happen when composing your functor with other particular functors (which for example I used in InfinitePolynomialFunctor), you may implement __mul__. A canonical name of Construction X would be "ConstructionXFunctor". So, I guess PuiseuxSeriesFunctor seems fine. If you are unhappe with how the functor is printed, you can of course override _repr_. Best regards, Simon -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.