Merge branch 'develop' into ticket/11785
Merge branch 'develop' into ticket/10136
Merge branch 'develop' into ticket/10849
Trac #11785: exp(I*pi*n).simplify_exp() doesn't simplify

At https://groups.google.com/d/topic/sage-support/Pkn1o1kAcyE/discussion
I noted that currently (4.7.1 and 4.7.2.alpha2), we have this:
{{{
sage: n = var('n')
sage: assume(n, 'integer')
sage: exp(I*n*pi).simplify_exp()
e^(I*pi*n)
}}}
I was really hoping for `cos(pi*n)`, or `(-1)^n`.

If you are serious about asking Maxima, it will simplify it, though:

{{{
sage: A = exp(I*pi*n)
sage: A.maxima_methods().rectform()
(-1)^n
}}}

We should somehow wrap rectform or make it easier to access. At a
minimum, we should add something to the documentation to mention this
possibility.

URL: http://trac.sagemath.org/11785
Reported by: ddrake
Ticket author(s): Michael Orlitzky
Reviewer(s): Ralf Stephan
Trac #10849: behaviour of gamma strangely sensitive

Whether you get the correct result or a spurious ValueError in
evaluating some gamma expressions depends upon things it shouldn't.

This comes from [http://groups.google.com/group/sage-
support/browse_thread/thread/3b7126c1a29db091# a sage-support thread]; I
looked and couldn't find it here, but possibly it's a duplicate.  (I
have bad luck with trac.)
See also [http://demo.sagenb.org/home/pub/66/ this worksheet].

Here's a relatively simple test case, in 4.6.1 and 4.6.2.rc0:

{{{
sage: x = var("x")
sage: f = exp(gamma(I*x-1/2).subs(x=I*x))
sage: g=f.operands()[0]
sage: g, type(g)
(gamma(-x - 1/2), <type 'sage.symbolic.expression.Expression'>)
sage: g(x=0)
------------------------------------------------------------------------
---
ValueError                                Traceback (most recent call
last)

/Applications/sage_devel/<ipython console> in <module>()

/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/expression.so in
sage.symbolic.expression.Expression.__call__
(sage/symbolic/expression.cpp:15657)()

/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/ring.so in
sage.symbolic.ring.SymbolicRing._call_element_
(sage/symbolic/ring.cpp:6537)()

/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/expression.so in
sage.symbolic.expression.Expression.substitute
(sage/symbolic/expression.cpp:15036)()

/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/pynac.so in
sage.symbolic.pynac.py_doublefactorial (sage/symbolic/pynac.cpp:9463)()

ValueError: argument must be >= -1
sage: g(x=0)
------------------------------------------------------------------------
---
ValueError                                Traceback (most recent call
last)
[ ... duplicate removed; this is merely to show it's not only the first
call which has problems ]
ValueError: argument must be >= -1
sage: gamma(-x-1/2)*g
gamma(-x - 1/2)^2
sage: g(x=0)
-2*sqrt(pi)
}}}

That is, merely performing the should-be-irrelevant "gamma(-x-1/2)*g" op
makes g(x=0) start working.  Instrumenting it shows that that
py_doublefactorial gets a -3 the first time instead of the 1 it does the
second time, but I couldn't quite follow the calling order to isolate
the error.

Apply [attachment:trac_10849-doctests-on_9880.patch]

URL: http://trac.sagemath.org/10849
Reported by: dsm
Ticket author(s): Burcin Erocal
Reviewer(s): Ralf Stephan
Trac #10136: `log(x).operator() == log` should return `True`

Reported by Francois Maltey on sage-devel:

{{{
> log(x).operator() == ln # is True, yes the alias ln is better than
> the log name
> log(x).operator() == log # is False (this feature looks like the
> binomial one)
> log(x).operator() == sage.function.log.function_log # is True
}}}

We should define a `__call__()` method in the `Function_log` class from
`sage/functions/log.py`, to handle the base argument. Then `ln()` and
`log()` can be the same function and `log(x).operator() == log` will
return `True`.

Apply [attachment:trac_10136-log_operator.patch]

URL: http://trac.sagemath.org/10136
Reported by: burcin
Ticket author(s): Burcin Erocal
Reviewer(s): Ralf Stephan
Trac #15807: Upgrade mpmath to version 0.18

Upstream tarball: [http://mpmath.googlecode.com/files/mpmath-0.18.tar.gz
mpmath-0.18.tar.gz]

URL: http://trac.sagemath.org/15807
Reported by: ohanar
Ticket author(s): R. Andrew Ohana
Reviewer(s): François Bissey
Trac #9634: binomial does not accept variable when only in the lower argument

{{{
sage: var('k')
k
sage: binomial(x,3)
1/6*(x - 2)*(x - 1)*x
sage: binomial(3,k)
------------------------------------------------------------------------
---
TypeError: Either m or x-m must be an integer
}}}

From kcrisman:
Is this a bug?  I would say yes, because
{{{
sage: binomial(x,k)
binomial(x, k)
}}}
works, but maybe we want to have it be a specific integer if the top
number is given?  Any input?

Apply [attachment:trac_9634-symbolic_binomial.take2.patch]

URL: http://trac.sagemath.org/9634
Reported by: Henryk.Trappmann
Ticket author(s): Burcin Erocal
Reviewer(s): Ralf Stephan
Trac #11005: Update Simon's GP scripts

[See #15608 for a list of open simon_two_descent tickets]

Denis Simon has new versions of his scripts (see
[http://www.math.unicaen.fr/~simon/]), these should be updated (see
`src/ext/pari/simon`).

URL: http://trac.sagemath.org/11005
Reported by: cremona
Ticket author(s): Peter Bruin
Reviewer(s): Jeroen Demeyer
Trac #15668: implement the fixed complex of automorphisms of simplicial complexes

This is a useful tool to have, I think.

URL: http://trac.sagemath.org/15668
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
Trac #15762: Make R and its extensions build on ARM

Make R and its extensions build on ARM with broken regexp in libc.

URL: http://trac.sagemath.org/15762
Reported by: dimpase
Ticket author(s): Dmitrii Pasechnik
Reviewer(s): Jean-Pierre Flori
Trac #15787: Files needed in SAGE_ATLAS_LIB

Following the conversation on sage-release [1]. It looks like the files
libptcblas and libptf77blas are not actually required by Atlas. And
debian does not contain them anyway.

Nathann

[1] https://groups.google.com/d/msg/sage-release/oxGODejce_0/yuJp4ZM-
9ksJ

URL: http://trac.sagemath.org/15787
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Ralf Stephan
Trac #15482: Say very loud that LP variables are non-negative by default

As the title says. It has been reported once again. We make this
assumption because ALL lp solvers that we use make the same, but it does
not mean everybody knows it `T_T`

Nathann

URL: http://trac.sagemath.org/15482
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Punarbasu Purkayastha, Karl-Dieter Crisman, Thierry Monteil
Trac #15345: Laurent polynomial rings don't preserve coercion

{{{
sage: R = LaurentPolynomialRing(ZZ, 'x')
sage: T = LaurentPolynomialRing(QQ, 'x')
sage: R.gen() + T.gen()
------------------------------------------------------------------------
---
TypeError                                 Traceback (most recent call
last)
<ipython-input-3-dac3b0b430b6> in <module>()
----> 1 R.gen() + T.gen()

/home/darij/sage-5.13.beta0/local/lib/python2.7/site-
packages/sage/structure/element.so in
sage.structure.element.RingElement.__add__
(sage/structure/element.c:13884)()

/home/darij/sage-5.13.beta0/local/lib/python2.7/site-
packages/sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:8169)()

TypeError: unsupported operand parent(s) for '+': 'Univariate Laurent
Polynomial Ring in x over Integer Ring' and 'Univariate Laurent
Polynomial Ring in x over Rational Field'
}}}
Compare with the more complicated:
{{{
sage: R = PolynomialRing(ZZ, 'x').fraction_field()
sage: T = PolynomialRing(QQ, 'x').fraction_field()
sage: R.gen() + T.gen()
2*x
}}}

URL: http://trac.sagemath.org/15345
Reported by: darij
Ticket author(s): Frédéric Chapoton, David Roe
Reviewer(s): Travis Scrimshaw