Work in progress on CM and isogeny classes for EC/NF
Merge branch 'develop' into isogs-ecnf
#16764: CM detection over number fields
#16764 revert changes to isogeny_class.py which belong in #16743
Merge branch 'develop' into cm
#16764: adjustments after review
Merge branch 'develop' into cm
Reviewer patch for ticket 16764 with minor documentation fixes.
trac #15184: fix path insertion in docstring generation for cached functions.
Slight improvement of _sage_doc_ of cached functions
Use the :trac: directive
Implement the padic gamma function
Fix GF(2^16,'a').fetch_int(0r)

We compute logs in this case, which bombs out if the input is zero.
Rename flag->algorithm and convert to same parent
Trac #15184: CachedFunction file location seems problematic

There is a problem where cached function report problematic file
information. Consider
{{{
sage: M=IntegerModRing(7)
sage: edit(M.is_finite) #no problem
sage: edit(M.is_field)
IOError: [Errno 2] No such file or directory:
'/sage/rings/finite_rings/integer_mod_ring.py'
}}}
Indeed sage doesn't find the appropriate source file:
{{{
sage: from sage.misc.sageinspect import sage_getfile
sage: sage_getfile(M.is_finite)
'/usr/local/sage/5.10/local/lib/python2.7/site-
packages/sage/rings/finite_rings/integer_mod_ring.py'
sage: sage_getfile(M.is_field)
'/sage/rings/finite_rings/integer_mod_ring.py'
}}}
The code that makes this happen is `sage/misc/cachefunc.pyx`, line 621:
{{{#!python
            if sourcelines is not None:
                from sage.env import SAGE_SRC, SAGE_LIB
                filename = sage_getfile(f)
                # The following is a heuristics to get
                # the file name of the cached function
                # or method
                if filename.startswith(SAGE_SRC):
                    filename = filename[len(SAGE_SRC):]
                elif filename.startswith(SAGE_LIB):
                    filename = filename[len(SAGE_LIB):]
                file_info = "File: %s (starting at line
%d)\n"%(filename,sourcelines[1])
                doc = file_info+(f.func_doc or '')
}}}
As you can see, the code actively strips away the part that should
really still be there. This change was made on #13432. Would it be very
wrong to just do nothing with the filename here and simply report
whatever gets reported on the original file?

Proposed doctest:
{{{
sage: M=IntegerModRing(7)
sage: from sage.misc.sageinspect import sage_getfile
sage: os.path.exists(sage_getfile(M.is_finite))
True
sage: os.path.exists(sage_getfile(M.is_field)) #this presently fails
True

}}}

URL: http://trac.sagemath.org/15184
Reported by: nbruin
Ticket author(s): Nils Bruin
Reviewer(s): Simon King
Trac #16764: Add CM detection for elliptic curves over number fields

Elliptic curves over the rationals have mathods ``has_cm()`` and
``cm_discriminant()``.  We extend these to curves over number fields,
and add a function ``has_rational_cm()`` to indicate the the curve has
CM which is defined over its base field (i.e. the CM discriminant is a
square in that field), which is always False over QQ.

URL: http://trac.sagemath.org/16764
Reported by: cremona
Ticket author(s): John Cremona
Reviewer(s): Marco Streng, Chris Wuthrich
Trac #17024: Bring back the p-adic gamma function

#14880 implemented the p-adic gamma function and Dwork expanison, but it
seems that this was lost in the template rewrite #12555. Or maybe in the
fog of war of the git transition. In any case, here it is again.

URL: http://trac.sagemath.org/17024
Reported by: vbraun
Ticket author(s): Beth Malmskog, Adriana Salerno, Christelle Vincent,
Ursula Whitcher
Reviewer(s): Jeroen Demeyer
Trac #17027: K.fetch_int(0r) for K = GF(2^16, 'a') fails

It fails because we are computing logs to compute the answer.

URL: http://trac.sagemath.org/17027
Reported by: malb
Ticket author(s): Martin Albrecht
Reviewer(s): Volker Braun