Improve conversion of complex numbers to PARI
compute reduction correctly in EllipticCurve_number_field.is_isogenous()
CC->PARI: convert purely imaginary numbers to t_COMPLEX with real part exactly 0
trac #15895: Bug in Graph.subdivide_edge
CC->PARI conversion: fix doctest failures
added explicit loading of guaga and few missing code.* things
trac #15895 review patch
Trac #15908: guava must be explicitly loaded

guava must be explicitly loaded before the corresponding GAP functions
are invoked.
The patch fixes this. There are still two test failures (see #14979) in
the guava-related `codes/linear_code.py`, but this is not obvious and
should be left to #14979.

URL: http://trac.sagemath.org/15908
Reported by: dimpase
Ticket author(s): Dmitrii Pasechnik
Reviewer(s): Volker Braun
Trac #15895: Bug in Graph.subdivide_edge

As reported by Georgi Guninski:

{{{
sage: F=graphs.PathGraph(3);
sage: S='S';F.add_vertex(S);
sage: F.add_edges([(S,0)]);
sage: F2=Graph(F);
sage: F2.subdivide_edges(list(F2.edges(labels=False)),2);
sage: F2.degree()
[2, 2, 1, 0, 2, 0, 2, 0, 2, 5]
}}}

after relabel:
{{{
sage: F=graphs.PathGraph(3);
sage: S='S';
sage: F.add_vertex(S);
sage: F.add_edges([(S,0)]);
sage: F2=Graph(F);
sage: F2.relabel();
sage: F2.subdivide_edges(list(F2.edges(labels=False)),2);
sage: F2.degree()
[2, 2, 1, 1, 2, 2, 2, 2, 2, 2]
}}}

This bug, as very often, happened because I am an idiot.

Nathann

URL: http://trac.sagemath.org/15895
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Frédéric Chapoton
Trac #15890: EllipticCurve_number_field.is_isogenous() raises error for non-minimal models

The following error is due to
`EllipticCurve_number_field.is_isogenous()` not changing to a local
minimal model before reducing.
{{{
sage: K.
=QuadraticField(229)
sage: c4=2173-235*(1-s)/2
sage: c6=-124369+15988*(1-s)/2
sage: c4c=2173-235*(1+s)/2
sage: c6c=-124369+15988*(1+s)/2
sage: E=EllipticCurve_from_c4c6(c4, c6)
sage: Ec=EllipticCurve_from_c4c6(c4c, c6c)
sage: E.conductor()
Fractional ideal (1)
sage: K.ideal(E.discriminant()).factor()
(Fractional ideal (3, 1/2*s + 1/2))^12  # not minimal at this prime
sage: E.is_isogenous(Ec)
...
ArithmeticError: Invariants [0, 0, 0, 0, 0] define a singular curve.
}}}

URL: http://trac.sagemath.org/15890
Reported by: pbruin
Ticket author(s): Peter Bruin
Reviewer(s): Sebastien Besnier
Trac #15888: CC -> PARI: return t_REAL for real numbers

When converting Sage complex numbers to PARI, we should return a PARI
`t_REAL` if the original number was actually real. This fixes a problem
with `ellwp()` in #15767. In PARI's floating point model, the number
`1e-19 + 0.0*I` has less precision than the real `1e-19`.

It is also consistent with the PARI philosophy of returning simplified
types (examples: `(1.1*I)^2` and `ellj(1.1*I)` in PARI gives real
numbers).

URL: http://trac.sagemath.org/15888
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Peter Bruin