15394: creation of Lattes map as endomorpishm of P1
#11327,#16779: improvements to isogeny class internals and docstrings
update to patch 2.7.1
fix dependencies
Apply pyparsing patch in binary mode
5838: test the issue
15394: documentation typo fixed
5838: fix previous doctest
Trac 5838: move and shorten the new doctest
trac 16779: small correction in doc
Trac #16772: trivial bug when building OA(4,12)

There is a missing `[:k]` in the code, and Sage returns a `OA(6,12)`
even when only `OA(4,12)` is requested. Well, it TRIES to return it, as
nothing is returned by this function without being checked first `:-P`

Before
{{{
sage: OA = designs.orthogonal_array(4,12)
...
AssertionError:
}}}

After
{{{
sage: OA = designs.orthogonal_array(4,12)
sage:
}}}

URL: http://trac.sagemath.org/16772
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Dima Pasechnik
Trac #16791: DiGraph.period: new method

New method to compute the period of a directed graph. A graph is
aperiodic if its period equals 1.

I took the implementation of NetworkX' function {{{is_aperiodic}}}
(wrapped in {{{DiGraph}}} since #16062), rewrote it into {{{DiGraph}}}
and replaced the final check {{{g == 1}}} by returning the period.

URL: http://trac.sagemath.org/16791
Reported by: cheuberg
Ticket author(s): Clemens Heuberger
Reviewer(s): Nathann Cohen
Trac #16800: PPL MILP solver: improve handling of equalities

The PPL MILP backend treats a constraint `A == B` as 2 constraints `A <=
B` and `A >= B`, which is much less efficient.

URL: http://trac.sagemath.org/16800
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Volker Braun
Trac #16134: modular forms for Hecke triangle groups

An implementation of modular forms for Hecke triangle groups.

See the README file for more details.

This is my first contribution to sage, so I'm not familiar yet with
all aspects/conventions. E.g. some function/class names should probably
be changed.

I used an unfinnished/stub implementation for the Hecke triangle group.
This is probably not a big issue since it is mostly used as a simple
container for data anyway.

I ran into some issues with sage components which forced me to
use "less elegant" solutions (that still "work" though).
Especially with the pushout construction of sage,
I think there are some problems with it.

URL: http://trac.sagemath.org/16134
Reported by: jj
Ticket author(s): Jonas Jermann
Reviewer(s): Martin Raum
Trac #16784: Allow ctrl-C to interrupt incomplete multiline Sage command

Since Sage 5.11.rc0, hitting ctrl-c after this
{{{
sage: print('hello'
....:
}}}
does not return to the Sage prompt, it just says
{{{
KeyboardInterrupt
....:
}}}
Hitting ctrl-c should instead return you to the prompt, as it used to
do.

My guess is that this comes from #14523.

URL: http://trac.sagemath.org/16784
Reported by: jhpalmieri
Ticket author(s): Volker Braun
Reviewer(s): John Palmieri
Trac #16798: fpLLL API misuse

Sage currently raises a runtime error whenever fpLLL returns a nonzero
return value. However, nonzero return values are expected under some
conditions (when the time or the number of loops is restricted).

URL: http://trac.sagemath.org/16798
Reported by: malb
Ticket author(s): Martin Albrecht
Reviewer(s): Martin Raum
Trac #16805: Putting some include paths in common

I'm proposing the following patch to remove duplication in the
src/module_list.py file.

URL: http://trac.sagemath.org/16805
Reported by: Snark
Ticket author(s): Julien Puydt
Reviewer(s): Volker Braun
Trac #5838: crash in Singular's polynomial gcd

Here's what I type to provoke the crash:
{{{
std = os.environ['SAGE_DATA'] + '/extcode/pickle_jar/pickle_jar.tar.bz2'
sage.structure.sage_object.unpickle_all(std)
sage.structure.sage_object.unpickle_all(std)
}}}
(this is the doctest of unpickle_all, plus an extra repetition of the
second line)

Here's the output:

{{{
sage: std = os.environ['SAGE_DATA'] +
'/extcode/pickle_jar/pickle_jar.tar.bz2'
sage: sage.structure.sage_object.unpickle_all(std)
/home/cwitty/sage-3.4.1.rc3/local/lib/python2.5/site-
packages/IPython/iplib.py:2073: DeprecationWarning: RQDF is deprecated;
use RealField(212) instead.
  exec code_obj in self.user_global_ns, self.user_ns
Successfully unpickled 483 objects.
Failed to unpickle 0 objects.
sage: sage.structure.sage_object.unpickle_all(std)
/home/cwitty/sage-3.4.1.rc3/local/bin/sage-sage: line 198: 22270 Aborted
sage-ipython "$@" -i
}}}

The first section of the backtrace is:

{{{
#0  0x00007fc7c14c2105 in raise () from /lib/libc.so.6
#1  0x00007fc7c14c3623 in abort () from /lib/libc.so.6
#2  0x00007fc7bcedd6d8 in global_NTL_error_callback ()
   from /home/cwitty/sage-3.4.1.rc3/local/lib/libcsage.so
#3  0x00007fc7bc9451ef in NTL::Error (
    s=0x7fc7bc97def1 "InvMod: inverse undefined") at tools.c:38
#4  0x00007fc7bc88ebd9 in NTL::InvMod (a=<value optimized out>, n=244)
    at ZZ.c:351
#5  0x00007fc7bc90545f in NTL::PlainRem (r=@0x7fffca29e230,
a=@0x7fffca29e230,
    b=@0x6) at ../include/NTL/lzz_p.h:278
#6  0x00007fc7bc9140bb in NTL::GCD (d=@0x7fffca29e360,
    u=<value optimized out>, v=@0x7fffca29e390) at lzz_pX1.c:558
#7  0x00007fc7a963206a in gcd_poly_p (f=@0x7fffca29e9e0,
g=@0x7fffca29e9d0)
    at /home/cwitty/sage-3.4.1.rc3/local/include/NTL/lzz_pX.h:696
#8  0x00007fc7a9633835 in gcd_poly (f=<value optimized out>,
g=@0x7fffca29ee50)
    at cf_gcd.cc:538
#9  0x00007fc7a963401e in gcd (f=@0x7fffca29ee60, g=@0x7fffca29ee50)
    at cf_gcd.cc:776
#10 0x00007fc7a9634601 in gcd_test_one (f=@0x7fffca29f3b0,
g=@0x7fffca29f3c0,
    swap=true) at cf_gcd.cc:76
#11 0x00007fc7a9631b70 in gcd_poly_p (f=@0x7fffca29f7b0,
g=@0x7fffca29f7a0)
    at cf_gcd.cc:353
#12 0x00007fc7a963373d in gcd_poly (f=<value optimized out>,
g=@0x7fffca29fbb0)
    at cf_gcd.cc:543
#13 0x00007fc7a9635d89 in chinrem_gcd (FF=<value optimized out>,
    GG=<value optimized out>) at cf_gcd.cc:1088
#14 0x00007fc7a96337e1 in gcd_poly (f=<value optimized out>,
g=@0x7fffca2a0560)
    at cf_gcd.cc:601
#15 0x00007fc7a963401e in gcd (f=@0x7fffca2a0550, g=@0x7fffca2a0560)
    at cf_gcd.cc:776
#16 0x00007fc7a94a69f8 in singclap_gcd (f=0x7fc7a930b198,
g=0x7fc7a930b058)
    at clapsing.cc:230
#17 0x00007fc7a992d2f9 in __pyx_pf_4sage_5rings_10polynomial_28multi_pol
ynomial_libsingular_23MPolynomial_libsingular_gcd
(__pyx_v_self=0x5e60830,
    __pyx_args=<value optimized out>, __pyx_kwds=<value optimized out>)
    at sage/rings/polynomial/multi_polynomial_libsingular.cpp:31063
#18 0x00000000004187e3 in PyObject_Call (func=0x58ad, arg=0x58ad,
kw=0x6)
    at Objects/abstract.c:1861
#19 0x00007fc7b3aaf02f in __pyx_pf_4sage_5rings_22fraction_field_element
_20FractionFieldElement_reduce (__pyx_v_self=0x5e5e2d0, unused=<value
optimized out>)
    at sage/rings/fraction_field_element.c:2288
#20 0x00000000004187e3 in PyObject_Call (func=0x58ad, arg=0x58ad,
kw=0x6)
    at Objects/abstract.c:1861
#21 0x00007fc7b3aa3b2b in __pyx_pf_4sage_5rings_22fraction_field_element
_20FractionFieldElement___init__ (__pyx_v_self=0x5e5e2d0,
    __pyx_args=<value optimized out>, __pyx_kwds=<value optimized out>)
    at sage/rings/fraction_field_element.c:1905
}}}

URL: http://trac.sagemath.org/5838
Reported by: cwitty
Ticket author(s): Ralf Stephan
Reviewer(s): Peter Bruin
Trac #11327: isogeny code uses deprecated(?) multi-variate gcd

New branch sorts out the use of uni- versus multi-variate polynomials
systematically, and makes a lot of minor improvements and
simplifications and improves many docstrings.  The specific errors
originally reported here (see below) and at #16779 are fixed.

In sage.schemes.elliptic_curves.ell_curve_isogeny (of sage 4.6.2) the
routine two_torsion_part() invokes a gcd on two polynomials.  When the
polynomials belong to a multivariate ring, an error occurs.  Perhaps
this is because the gcd routine in
sage.rings.polynomial.multi_polynomial_element has been commented out
(because it uses Singular?!).

Converting psi (and perhaps psi2) to univariate polynomials within
two_torsion_part() before taking the gcd seems to work, but there seems
to be other code in the module which uses a multivariate ring when a
univariate ring would suffice (e.g. in __init_from_kernel_polynomial).

I discovered this error when trying to create a dual isogeny (for an
elliptic curve over Q(t)).  The original isogeny was a cyclic 2-isogeny
and thus the dual should also be a cyclic 2-isogeny.  Without giving
more details on how I created the curve, let me simply report the error
message which results when I call isogeny.dual():

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_5.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cHNpID0gcG
hpLmR1YWwoKQ=="),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/private/var/folders/4V/4VAOdForFpanThca5kJ5xE+++TI/-Tmp-/tmp8DX
IBC/___code___.py", line 2, in <module>
    exec compile(u'psi = phi.dual()
  File "", line 1, in <module>

  File "/Applications/sage/local/lib/python2.6/site-
packages/sage/schemes/elliptic_curves/ell_curve_isogeny.py", line 3248,
in dual
    phi_hat = EllipticCurveIsogeny(E1, None, E2, d)
  File "/Applications/sage/local/lib/python2.6/site-
packages/sage/schemes/elliptic_curves/ell_curve_isogeny.py", line 914,
in __init__
    self.__init_from_kernel_polynomial(kernel, degree)
  File "/Applications/sage/local/lib/python2.6/site-
packages/sage/schemes/elliptic_curves/ell_curve_isogeny.py", line 2038,
in __init_from_kernel_polynomial
    psi_G = two_torsion_part(E, poly_ring, psi, degree);
  File "/Applications/sage/local/lib/python2.6/site-
packages/sage/schemes/elliptic_curves/ell_curve_isogeny.py", line 453,
in two_torsion_part
    psi_G = poly_ring(psi.gcd(psi_2))
  File "element.pyx", line 327, in
sage.structure.element.Element.__getattr__
(sage/structure/element.c:2715)
  File "parent.pyx", line 277, in
sage.structure.parent.getattr_from_other_class
(sage/structure/parent.c:2841)
  File "parent.pyx", line 177, in
sage.structure.parent.raise_attribute_error
(sage/structure/parent.c:2663)
AttributeError: 'MPolynomial_polydict' object has no attribute 'gcd'

URL: http://trac.sagemath.org/11327
Reported by: cjh
Ticket author(s): John Cremona
Reviewer(s): Chris Wuthrich
Trac #15394: Implement a Lattes map function

Given an elliptic curve and integer m, return the associated Lattes map
on P1. It would be nice to eventually add support for non-integer m, but
this would be a great first step.

URL: http://trac.sagemath.org/15394
Reported by: bhutz
Ticket author(s): Ben Hutz
Reviewer(s): Joao Faria