Trac #13872: Non-exceptional rigged configuration bijections

Implements the bijection between rigged configurations and tensor
products of Kirillov-Reshetikhin tableaux for the non-exceptional types.

URL: http://trac.sagemath.org/13872
Reported by: tscrim
Ticket author(s): Travis Scrimshaw
Reviewer(s): Anne Schilling
Trac #14186: coerce_binop errors with keyword arguments

On a coerced binary operator

{{{
@coerce_binop
__op__(x,y,**kwds)
}}

if y has to be coerced but x does not change its parent, the keyword
arguments are not correctly passed.

A real example

{{{
sage: R1=QQ['x,y']
sage: R2=QQ['x,y,z']
sage: f=R1(1)
sage: h=R2(1)
sage: h.gcd(f,algorithm='modular')
TypeError                                 Traceback (most recent call
last)
...
TypeError: algorithm algorithm not supported
}}}

URL: http://trac.sagemath.org/14186
Reported by: lftabera
Ticket author(s): Luis Felipe Tabera Alonso
Reviewer(s): Robert Bradshaw, Travis Scrimshaw
Trac #15108: base extend for hyperelliptic curves

{{{

sage: R.<x> = QQ[]
sage: H = HyperellipticCurve(x^5+x+1)
sage: E = EllipticCurve([0,0,0,1,1])
sage: E.change_ring(RR)
Elliptic Curve defined by y^2 = x^3 + 1.00000000000000*x +
1.00000000000000 over Real Field with 53 bits of precision
sage: E.base_extend(RR)
Elliptic Curve defined by y^2 = x^3 + 1.00000000000000*x +
1.00000000000000 over Real Field with 53 bits of precision
sage: H.change_ring(RR)
Hyperelliptic Curve over Real Field with 53 bits of precision defined by
y^2 = x^5 + x + 1.00000000000000
sage: H.base_extend(RR)
Closed subscheme of Projective Space of dimension 2 over Real Field with
53 bits of precision defined by:
  -x0^5 + x1^2*x2^3 - x0*x2^4 - x2^5
}}}

The last output should be a hyperelliptic curve object too.

URL: http://trac.sagemath.org/15108
Reported by: mstreng
Ticket author(s): Marco Streng
Reviewer(s): Jean-Pierre Flori
Trac #15284: Memory leak in the interface with Gurobi

As reported by Jernej, the {{{GRBenv ** env}}} structure is allocated
but not freed on {{{__dealloc___}}}. That's fixed here !

There was also a problem with the ``.copy()`` function of gurobi which
should have been cpdef. It wasn't, and doctests did not pass. I don't
get how we missed that `:-/`

Nathann

URL: http://trac.sagemath.org/15284
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Jernej Azarija
Trac #15367: Empty lists while creating parents

This is crazy:
{{{
sage: import gc
sage: A = at_least
sage: pre = gc.get_objects()
sage: K = Qp(7,2)
sage: post = gc.get_objects()
sage: len(post) - len(pre)
747
}}}
Much of that is empty lists:
{{{
sage: M = []
sage: for a in post:
....:     for b in pre:
....:         if a is b:
....:             break
....:     else:
....:         M.append(a)
sage: from collections import defaultdict
sage: types = defaultdict(int)
sage: for a in K.M:
....:     types[type(a)] += 1
sage: print '\n'.join([str(a) + ' ' + str(types[a]) for a in
types.keys() if types[a] > 1])
<type 'list'> 554
<type 'tuple'> 57
<class 'weakref.KeyedRef'> 28
<type 'weakref'> 22
<type 'dict'> 18
<type 'sage.structure.coerce_dict.MonoDictEraser'> 10
<type 'sage.structure.coerce_dict.MonoDict'> 10
<type 'cell'> 8
<type 'instancemethod'> 6
<type 'frame'> 6
<type 'sage.structure.coerce_dict.TripleDict'> 5
<type 'sage.structure.coerce_dict.TripleDictEraser'> 5
<type 'function'> 4
<type 'staticmethod'> 4
<class 'sage.structure.dynamic_class.DynamicMetaclass'> 4
<class 'sage.rings.homset.RingHomset_generic_with_category'> 2
<class '_ast.Name'> 2

sage: listlens = defaultdict(int)
sage: for a in M:
....:     if isinstance(a, list):
....:         listlens[len(a)] += 1
sage: sage: sorted(listlens.items())
[(0, 525), (1, 9), (2, 2), (3, 2), (23, 10), (53, 5), (116583, 1)]
}}}
I'm not sure where these 525 empty lists are created, but it seems a bit
excessive.

It's not just p-adic fields:
{{{
sage: pre = gc.get_objects()
sage: K = QuadraticField(-11)
sage: post = gc.get_objects()
sage: len(post) - len(pre)
1152
}}}

URL: http://trac.sagemath.org/15367
Reported by: roed
Ticket author(s): Nils Bruin
Reviewer(s): Simon King
minor typography
thematic tutorial revisions
resolved conflicts in lie.rst
Merge branch 'develop' into triangdoc
Trac #15329: Fix pushout of completed fields

The aim is to fix the following problem.
{{{
sage: from sage.categories.pushout import pushout
sage: pushout(Qp(7),RLF)
Traceback (most recent call last):
...
RuntimeError: maximum recursion depth exceeded while calling a Python
object
}}}

This boils down to change how `CompletionFunctor` (which is a type of
construction functors used both for `RLF` and `Qp(7)`) commutes with
other construction functors. Currently, it commutes with the fraction
field functor ''and'' with other completion functors. But in fact it is
simply not true that construction functors commute.

URL: http://trac.sagemath.org/15329
Reported by: SimonKing
Ticket author(s): Simon King
Reviewer(s): Marc Mezzarobba
Improved Karatsuba: cosmetic changes to docstrings and comments
Trac #15005: %edit does not work anymore

{{{
sage: %edit
IPython will make a temporary file named: /tmp/ipython_edit_QLsRWD.py
Editing...--------------------------------------------------------------
-------------
AttributeError                            Traceback (most recent call
last)
<ipython-input-1-107a4967e4b8> in <module>()
----> 1 get_ipython().magic(u'edit')

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2134         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2135         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2136         return self.run_line_magic(magic_name, magic_arg_s)
   2137
   2138     #-----------------------------------------------------------
--------------

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/interactiveshell.pyc in run_line_magic(self,
magic_name, line)
   2060                 args.append(sys._getframe(stack_depth).f_locals)
   2061             with self.builtin_trap:
-> 2062                 result = fn(*args)
   2063             return result
   2064

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/magics/code.pyc in edit(self, parameter_s,
last_call)

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    189     # but it's overkill for just that one bit of state.
    190     def magic_deco(arg):
--> 191         call = lambda f, *a, **k: f(*a, **k)
    192
    193         if callable(arg):

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/magics/code.py
c in edit(self, parameter_s, last_call)
    490             if ' ' in filename:
    491                 filename = "'%s'" % filename
--> 492             self.shell.hooks.editor(filename,lineno)
    493         except TryNext:
    494             warn('Could not open editor')

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/hooks.pyc in __call__(self, *args, **kw)
    136             #print "prio",prio,"cmd",cmd #dbg
    137             try:
--> 138                 return cmd(*args, **kw)
    139             except TryNext as exc:
    140                 last_exc = exc

/home/marc/co/sage/local/lib/python2.7/site-
packages/sage/misc/edit_module.pyc in edit_devel(self, filename,
linenum)
    302     """
    303     import IPython.core.hooks
--> 304     sageroot = sage.misc.sageinspect.SAGE_ROOT+'/'
    305     runpathpattern = '^'+sageroot+'local/lib/python[^/]*/site-
packages'
    306     develbranch = sageroot+'devel/sage'

AttributeError: 'module' object has no attribute 'SAGE_ROOT'
}}}

This is apparently due to an occurrence of SAGE_ROOT missed by #13432.

The branch linked to this ticket contains a simple patch to fix the
issue. I don't know how to test for it automatically (there are already
examples that trigger the bug in `sage.misc.edit_module`, but they are
all marked `# not tested`), so the patch doesn't add any new test.

Note that `%edit object` still fails in many cases (e.g., when `object`
is an instance of a Cython class). A workaround is to use `%edit -n 0`.
See also [https://github.com/ipython/ipython/issues/3920 IPython issue
3920].

URL: http://trac.sagemath.org/15005
Reported by: mmezzarobba
Ticket author(s): Marc Mezzarobba
Reviewer(s): Volker Braun
Trac #15010: Consistency between Rational.minpoly and NumberFieldElement.minpoly

Make the var parameter of `Rational.minpoly()` default to `'x'`, for
consistency with `NumberFieldElement.minpoly()`. (This is important
since `is_NumberField(QQ) == True`.)

I'm wondering if `minpoly()` shouldn't actually just be moved to
`FieldElement`. Thoughts?

URL: http://trac.sagemath.org/15010
Reported by: mmezzarobba
Ticket author(s): Marc Mezzarobba
Reviewer(s): Ben Hutz
Trac #15553: Broken links in the doc of graph/ and numerical/

When compiling the doc with --warn-links (pretty nice thing, by the
way), some broken links appeared in the doc of graphs/ and numerical/. I
fixed all I could `:-)`

Nathann

URL: http://trac.sagemath.org/15553
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Marc Mezzarobba
Trac #15097: improve documentation of is_prime

The documentation of {{{is_prime}}} says:
{{{
sage: n=17
sage: n.is_prime?
...
   * "proof" -- If False, use a strong pseudo-primality test. If True,
     use a provable primality test.  If unset, use the default
     arithmetic proof flag.
}}}
however no example or pointer is given to explain how to access or
change the "default arithmetic proof flag".

URL: http://trac.sagemath.org/15097
Reported by: zimmerma
Ticket author(s): Paul Zimmermann
Reviewer(s): Julian Rueth
15145: add instructions to construct all groups of order 15 or less as fp groups
#15145: review patch.
Merge branch 'public/combinat/14770/asmtrans' of ssh://trac.sagemath.org:2222/sage into public/combinat/14770/asmtrans

Conflicts:
	src/sage/combinat/alternating_sign_matrix.py
fix documentation
fix latex