#4726: Creating homomorphisms of relative number fields seems totally broken
---------------------------------+------------------------------------------
Reporter: was | Owner: davidloeffler
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.9
Component: number fields | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Francis Clarke
Authors: Robert Harron | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by fwclarke):
* status: needs_review => needs_work
* reviewer: => Francis Clarke
Comment:
This improves things significantly.
But I'm not too happy about `_from_im` having the default `check=False`.
For all other constructors of homomorphisms, the `check` paramater has
default `True`. The idea being that other methods can set it as `False`
in cases where checking has already been done; see #10843, which still
needs reviewing (once it's rebased).
The real problem is that the present code for `_from_im` is mathematically
incorrect. Once a rigourous version is defined, it is possible to write
`_from_im_without_base_hom` much more simply.
I attach a patch (to be applied after your latest patch) which implements
these changes. In addition it rewrites `default_base_hom`, the point being
that it is unnecessary to cache its output since caching is already done
by `embeddings`.
There are some problems too with the docstring for
`RelativeNumberFieldHomset.__call__`. In particular, it is not true that
"if the list specifies a morphism that maps the generators of the base
fields to themselves, then truncating that list will yield the same
morphism." For example,
{{{
sage: K.<a,b,c> = NumberField([x^2 - 2, x^2 - 3, x^2 - 5])
sage: K.hom([-a, b, -c])
Relative number field endomorphism of Number Field in a with defining
polynomial x^2 - 2 over its base field
Defn: a |--> -a
b |--> b
c |--> -c
sage: K.hom([-a])
Relative number field endomorphism of Number Field in a with defining
polynomial x^2 - 2 over its base field
Defn: a |--> -a
b |--> b
c |--> c
}}}
I also think that there needs to be a warning that a homomorphism for
which a partial list of generators is given may not be uniquely defined.
In
other words, the "essentially arbitrary" remarks in the docstrings for
`_from_im_without_base_hom` and `default_base_hom` need promoting to this
level. Moreover the resulting modification to the syntax of `hom` for
relative number fields needs to be directly available to users. At the
moment `K.hom?`, where `K` is a relative number field, yields the
docstring for the generic `sage.structure.parent_gens.ParentWithGens.hom`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4726#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.