#6079: [with patch, needs work] modernize base inclusion morphism of relative
number fields
---------------------------+------------------------------------------------
Reporter: ncalexan | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.0.1
Component: number theory | Keywords: base inclusion morphism relative
number field
---------------------------+------------------------------------------------
Comment(by fwclarke):
== More remarks ==
The verbose stack trace is certainly very useful. I expect to make
frequent use of it. I suggest that corresponding code is added to
`pari_bnf`.
----
On my earlier remarks about "Isomorphism morphism": Having understood
better the way that `repr(f)` is constructed for a number field embedding
`f`, I realise that making `f` a `Morphism` rather than a `Map` ''is'' an
improvement; the terminology is much more appropriate.
The awkardness of "Isomorphism morphism" is caused by an
earlier decision to make the `_repr_type` of an embedding "Isomorphism".
This is distinctly out of line with the other values of `_repr_type` in
SAGE:[[BR]]
`Abelian variety`, `AbelianGroup`, `Affine`, `Affine Scheme`,
`Affine Space`, `Call`, `Coercion`, `Composite`, `Conversion via ...`,
`Generic`,
`Identity`, `Identity map`, `MatrixGroup`, `Native`, `Natural`,
`PermutationGroup`, `Projective Space`, `Projective`, `Quartic`,
`Relative number field`, `Ring`, `Ring Coercion`, `Scheme`, `Section`,
`Set-theoretic ring`, `Steal`.
I note also that embeddings, the maps produced by `subfield` and
`subfields`, automorphisms and
elements of `Hom(K, L)` or `End(K, K)` are all printed as "Ring
morphisms:
..." or "Ring endomorphisms ...". On the other hand, the maps given by
`K.absolute_field('a').structure()` are given, after your patch, as
"Isomorphism morphism:
..."
This certainly needs sorting out at some point (as do other aspects of
the naming of morphisms), but it's not a matter for this patch.
----
The most important aspect, in my opinion, of your
`NumberFieldBaseIntoExtensionMorphism` and
`NumberFieldExtensionOntoBaseMap` code is that it allows the following
usage:
{{{
sage: k.<a, b> = NumberField([x^2 + x + 1, x^3 - 2])
sage: B = k.base_field(); B
Number Field in b with defining polynomial x^3 - 2
sage: (b, parent(b))
(b, Number Field in a with defining polynomial x^2 + x + 1 over its base
field)
sage: z = B(b)
sage: z, parent(z)
(b, Number Field in b with defining polynomial x^3 - 2)
}}}
In 3.4.2 the `B(b)` conversion fails.
This feature is quite useful. For example
{{{
sage: (b.norm(), B(b).norm())
(4, 2)
}}}
But one has to be careful. If the field `k` above is constructed in a
different way, the element `b` has a different parent, and your code is
not needed for the conversions:
{{{
sage: B.<b> = NumberField(x^3 - 2)
sage: k.<a> = B.extension(x^2 + x + 1)
sage: parent(b)
Number Field in b with defining polynomial x^3 - 2
sage: b.norm()
2
sage: k(b).norm()
4
}}}
I think some, at least, of the doctests
should use the above conversion syntax, rather than expressions like
`K.coerce_map_from(K.base_field()).section()` which are, of course, what
is used to do conversions like `B(b)` above. There are two reasons for
this: (i) users should be made aware of this simple conversion syntax;
(ii) it ensures that any future change to the coercion mechanism which
would mess up this case gets detected.
I can't see any reason why one should want take a section of the partial
map from a field to its base field, but perhaps I'm missing something.
I agree that it would be rather tricky to fix the parent of sections given
the way the Section class is defined.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6079#comment:14>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---