Hi John, On 25 Nov., 12:45, John Cremona <john.crem...@gmail.com> wrote: > I think I am out of my depth already, but I just wanted to make sure > that you knew of the composite_fields() method for number fields. In > Luis's example, you can do all of L1.composite_fields(K), > L2.composite_fields(K), K.composite_fields(L1), > K.composite_fields(L2), in each case it reurns a list of one element > which is K itself; but L1.composite_fields(L2) crashes. That may be > for the same reason as the problem Luis encountered.
I don't think so: sage: K.<r4> = NumberField(x^4-2) sage: L1.<r2_1> = NumberField(x^2-2, embedding = r4**2) sage: L2.<r2_2> = NumberField(x^2-2, embedding = -r4**2) sage: from sage.categories.pushout import pushout,construction_tower sage: pushout(L1,L2) --------------------------------------------------------------------------- CoercionException Traceback (most recent call last) ... CoercionException: ('Ambiguous Base Extension', Number Field in r2_1 with defining polynomial x^2 - 2, Number Field in r2_2 with defining polynomial x^2 - 2) And as long as there is such error, r2_1+r2_2 won't work. > What I have difficulty with is the relation between (a) explicit code > with actual objects, such as the code for composite_fields(), and (b) > the very general merging-functors sort of code. Is it the case that > both are needed, and that (a) uses (b)? It seems to me that (b) is in the very centre of Sage's coercion model, in particular when we consider the pushout: The arguing is solely with functors, without any rings involved. Hence, if the "abstract nonsense" (thus (b)) is not right then arithmetic between elements of L1 and L2 won't work. And I don't see how the method composite_fields() could be used in the coercion framework, since this is about objects (not functors). However, looking at the code of composite_fields, I think that one would do very similar things in the merge() method of AlgebraicExtensionFunctor. Trying it now. Cheers, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org