1. 30 Dec, 2018 1 commit
  2. 27 Dec, 2018 2 commits
    • Volker Braun's avatar
      Updated SageMath version to 8.6.beta0 · 26398577
      Volker Braun authored
      26398577
    • Release Manager's avatar
      Trac #26735: gcc fails to build with isl>=0.20 · 46d9e13c
      Release Manager authored
      {{{gcc}}} fails to compile on systems with {{{isl>=0.20}}}:
      
      {{{
      g++ -std=gnu++98 -fno-PIE -c   -g -DIN_GCC     -fno-exceptions -fno-rtti
      -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
      -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual
      -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
      -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../src/gcc -I../../src/gcc/.
      -I../../src/gcc/../include -I../../src/gcc/../libcpp/include
      -I/home/sage/sage-8.4/local/include -I/home/sage/sage-8.4/local/include
      -I/home/sage/sage-8.4/local/include  -I../../src/gcc/../libdecnumber
      -I../../src/gcc/../libdecnumber/bid -I../libdecnumber
      -I../../src/gcc/../libbacktrace   -o graphite-isl-ast-to-gimple.o -MT
      graphite-isl-ast-to-gimple.o -MMD -MP -MF ./.deps/graphite-isl-ast-to-
      gimple.TPo ../../src/gcc/graphite-isl-ast-to-gimple.c
      ../../src/gcc/graphite-isl-ast-to-gimple.c: In function 'void
      ivs_params_clear(ivs_params&)':
      ../../src/gcc/graphite-isl-ast-to-gimple.c:98:7: error: 'isl_id_free'
      was not declared in this scope
             isl_id_free (it->first);
             ^~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:98:7: note: suggested
      alternative: 'isl_aff_free'
             isl_id_free (it->first);
             ^~~~~~~~~~~
             isl_aff_free
      ../../src/gcc/graphite-isl-ast-to-gimple.c: In member function
      'tree_node*
      translate_isl_ast_to_gimple::gcc_expression_from_isl_ast_expr_id(tree,
      isl_ast_expr*, ivs_params&)':
      ../../src/gcc/graphite-isl-ast-to-gimple.c:293:3: error: 'isl_id_free'
      was not declared in this scope
         isl_id_free (tmp_isl_id);
         ^~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:293:3: note: suggested
      alternative: 'isl_aff_free'
         isl_id_free (tmp_isl_id);
         ^~~~~~~~~~~
         isl_aff_free
      ../../src/gcc/graphite-isl-ast-to-gimple.c: In member function 'loop*
      translate_isl_ast_to_gimple::graphite_create_new_loop(edge,
      isl_ast_node*, loop_p, tree, tree, tree, ivs_params&)':
      ../../src/gcc/graphite-isl-ast-to-gimple.c:629:5: error: 'isl_id_free'
      was not declared in this scope
           isl_id_free (res->first);
           ^~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:629:5: note: suggested
      alternative: 'isl_aff_free'
           isl_id_free (res->first);
           ^~~~~~~~~~~
           isl_aff_free
      ../../src/gcc/graphite-isl-ast-to-gimple.c: In member function
      'edge_def*
      translate_isl_ast_to_gimple::translate_isl_ast_for_loop(loop_p,
      isl_ast_node*, edge, tree, tree, tree, ivs_params&)':
      ../../src/gcc/graphite-isl-ast-to-gimple.c:669:53: error:
      'isl_id_get_user' was not declared in this scope
             ast_build_info *for_info = (ast_build_info *) isl_id_get_user
      (id);
                                                           ^~~~~~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:669:53: note: suggested
      alternative: 'isl_arg_user'
             ast_build_info *for_info = (ast_build_info *) isl_id_get_user
      (id);
                                                           ^~~~~~~~~~~~~~~
                                                           isl_arg_user
      ../../src/gcc/graphite-isl-ast-to-gimple.c:672:7: error: 'isl_id_free'
      was not declared in this scope
             isl_id_free (id);
             ^~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:672:7: note: suggested
      alternative: 'isl_aff_free'
             isl_id_free (id);
             ^~~~~~~~~~~
             isl_aff_free
      ../../src/gcc/graphite-isl-ast-to-gimple.c: In member function
      'edge_def*
      translate_isl_ast_to_gimple::translate_isl_ast_node_user(isl_ast_node*,
      edge, ivs_params&)':
      ../../src/gcc/graphite-isl-ast-to-gimple.c:876:31: error:
      'isl_id_get_user' was not declared in this scope
         poly_bb_p pbb = (poly_bb_p) isl_id_get_user (name_id);
                                     ^~~~~~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:876:31: note: suggested
      alternative: 'isl_arg_user'
         poly_bb_p pbb = (poly_bb_p) isl_id_get_user (name_id);
                                     ^~~~~~~~~~~~~~~
                                     isl_arg_user
      ../../src/gcc/graphite-isl-ast-to-gimple.c:882:3: error: 'isl_id_free'
      was not declared in this scope
         isl_id_free (name_id);
         ^~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:882:3: note: suggested
      alternative: 'isl_aff_free'
         isl_id_free (name_id);
         ^~~~~~~~~~~
         isl_aff_free
      ../../src/gcc/graphite-isl-ast-to-gimple.c: In function 'isl_id*
      ast_build_before_for(isl_ast_build*, void*)':
      ../../src/gcc/graphite-isl-ast-to-gimple.c:2886:19: error:
      'isl_space_dim' was not declared in this scope
         int dimension = isl_space_dim (schedule_space, isl_dim_out);
                         ^~~~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:2886:19: note: suggested
      alternative: 'isl_aff_dim'
         int dimension = isl_space_dim (schedule_space, isl_dim_out);
                         ^~~~~~~~~~~~~
                         isl_aff_dim
      ../../src/gcc/graphite-isl-ast-to-gimple.c:2890:3: error:
      'isl_space_free' was not declared in this scope
         isl_space_free (schedule_space);
         ^~~~~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:2890:3: note: suggested
      alternative: 'isl_aff_free'
         isl_space_free (schedule_space);
         ^~~~~~~~~~~~~~
         isl_aff_free
      ../../src/gcc/graphite-isl-ast-to-gimple.c:2891:16: error:
      'isl_id_alloc' was not declared in this scope
         isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "",
      for_info);
                      ^~~~~~~~~~~~
      ../../src/gcc/graphite-isl-ast-to-gimple.c:2891:16: note: suggested
      alternative: 'isl_mat_alloc'
         isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "",
      for_info);
                      ^~~~~~~~~~~~
                      isl_mat_alloc
      make[5]: *** [Makefile:1099: graphite-isl-ast-to-gimple.o] Error 1
      }}}
      
      This is fixed upstream in
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86724
      , but is not yet in any release of {{{gcc}}}.
      
      URL: https://trac.sagemath.org/26735
      Reported by: Konrad127123
      Ticket author(s): Konrad K. Dabrowski
      Reviewer(s): Volker Braun
      46d9e13c
  3. 25 Dec, 2018 8 commits
    • Release Manager's avatar
      Trac #26271: Slight improvement to "rational is not an integer" exception message · 84ee8aab
      Release Manager authored
      This is a change I had in my Python 3 branch that at some point I think
      I found helpful for debugging something; I can't even remember what.
      But it still seemed like a worthwhile change.
      
      URL: https://trac.sagemath.org/26271
      Reported by: embray
      Ticket author(s): Erik Bray
      Reviewer(s): Jeroen Demeyer, Marc Mezzarobba
      84ee8aab
    • Release Manager's avatar
      Trac #26941: improve method _build_flow_graph · 25d9b380
      Release Manager authored
      We use method `is_directed_acyclic` to find cycles instead of computing
      shortest paths. This should have been done long ago as it's faster this
      way.
      
      Before:
      {{{
      sage: D = digraphs.TransitiveTournament(10)
      sage: D.add_edges((i+1, i) for i in range(9))
      sage: flow = {e: 1 for e in D.edge_iterator(labels=0)}
      sage: %time F = D._build_flow_graph(flow, False)
      CPU times: user 1.45 ms, sys: 320 µs, total: 1.77 ms
      Wall time: 1.55 ms
      }}}
      
      After:
      {{{
      sage: D = digraphs.TransitiveTournament(10)
      sage: D.add_edges((i+1, i) for i in range(9))
      sage: flow = {e: 1 for e in D.edge_iterator(labels=0)}
      sage: %time F = D._build_flow_graph(flow, False)
      CPU times: user 958 µs, sys: 244 µs, total: 1.2 ms
      Wall time: 1.02 ms
      }}}
      
      URL: https://trac.sagemath.org/26941
      Reported by: dcoudert
      Ticket author(s): David Coudert
      Reviewer(s): Travis Scrimshaw
      25d9b380
    • Release Manager's avatar
      Trac #26935: AbstractLanguage should work with uncomparable alphabet · 698da99c
      Release Manager authored
      This code tries to compare various elements of the `alphabet` which
      might break in Python 3 or after #22029 is applied:
      {{{
              if (alphabet.cardinality() == Infinity or
                  (alphabet.cardinality() < 36 and
                   all(alphabet.unrank(i) > alphabet.unrank(j)
                       for i in range(min(36, alphabet.cardinality()))
                       for j in range(i)))):
      }}}
      
      URL: https://trac.sagemath.org/26935
      Reported by: jdemeyer
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Travis Scrimshaw
      698da99c
    • Release Manager's avatar
      Trac #26879: Deprecate _element_constructor_ being an unbound method · acbfb526
      Release Manager authored
      The `_element_constructor` machinery in `Parent` has support both for
      `P._element_constructor_` being a bound and an unbound method. However,
      after #26878, the only case that occurs is bound methods. So we
      deprecate support for unbound methods.
      
      Practically speaking, this means deprecating `DefaultConvertMap` (only
      when used directly, not when subclassed) which is the class implementing
      conversion using an unbound `_element_constructor_` and deprecating the
      `_element_init_pass_parent=True` case in `IdentityMorphism`.
      
      URL: https://trac.sagemath.org/26879
      Reported by: jdemeyer
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Travis Scrimshaw
      acbfb526
    • Release Manager's avatar
      Trac #26872: Implement abs and sqrt for UniversalCyclotomicField elements · 97455096
      Release Manager authored
      Inspired by this report by Ask Sage user Assombrance:
      
      - [[https://ask.sagemath.org/question/44623|Ask Sage question 44623:
      Norm in UniversalCyclotomicField]]
      
      For abs, we need to implement `__abs__` for elements of the universal
      cyclotomic field; it could be computed as the square root of `z *
      z.conjugate()`
      or of `z.real()**2 + z.imag()**2`, or by using `to_cyclotomic_field`, or
      by
      changing ring to `QQbar`.
      
      URL: https://trac.sagemath.org/26872
      Reported by: slelievre
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Travis Scrimshaw
      97455096
    • Release Manager's avatar
      Trac #26750: Use GroupHomset_libgap for permutation groups, as well · 30f1d2b8
      Release Manager authored
      At the moment the construction of group homomorphisms between groups
      implemented under the classes `ParentLibGAP` and
      `PermutationGroup_generic` (and vice versa) is not possible in sage
      using the method `hom`. For example, it isn't possible to construct the
      natural projection from symplectic groups onto the corresponding
      projective group although this is possible using GAP:
      
      {{{
      sage: Sp43 = Sp(4,3)
      sage: PSp43 = PSp(4,3)
      sage: natProj = Sp43.hom(PSp43.gens())
      Traceback (most recent call last):
      ...
      TypeError: unable to convert [(3,4)(6,7)(9,10)(12,13)(17,20)(18,21)(19,2
      2)(23,32)(24,33)(25,34)(26,38)(27,39)(28,40)(29,35)(30,36)(31,37), (1,5,
      14,17,27,22,19,36,3)(2,6,32)(4,7,23,20,37,13,16,26,40)(8,24,29,30,39,10,
      33,11,34)(9,15,35)(12,25,38)(21,28,31)] to an element of Set of
      Morphisms from Symplectic Group of degree 4 over Finite Field of size 3
      to The projective symplectic linear group of degree 4 over Finite Field
      of size 3 in Category of finite groups
      }}}
      
      The reason for this is that the constructor of the class
      `GroupHomset_libgap` explicitly checks both groups to be instances of
      `ParentLibGAP`. So an easy way to have `hom` work in such cases, as
      well, would be to allow `PermutationGroup_generic` additionally.
      
      An alternative option is to shift `PermutationGroup_generic` into the
      `ParentLibGAP` framework. But this would cause a lot of work to have all
      doctests pass through. The main problem here is that the element class
      of PermutationGroup_generic still has `parent` as second (optional)
      argument (in opposite to `ParentLibGAP`).
      
      Therefore, this ticket will follow the first option!
      
      URL: https://trac.sagemath.org/26750
      Reported by: soehms
      Ticket author(s): Sebastian Oehms
      Reviewer(s): Simon Brandhorst
      30f1d2b8
    • Release Manager's avatar
      Trac #24811: Limits of asymptotic expansions · ec9089da
      Release Manager authored
      Introduce a method `AsymptoticExpansion.limit`.
      
      URL: https://trac.sagemath.org/24811
      Reported by: cheuberg
      Ticket author(s): Clemens Heuberger
      Reviewer(s): Marc Mezzarobba
      ec9089da
    • Release Manager's avatar
      Trac #22346: FormalSum should work with non-comparable values · a179363e
      Release Manager authored
      `FormalSum` sorts its entries, which is not guaranteed to work,
      especially on Python 3.
      
      {{{
      sage: from sage.structure.richcmp import *
      sage: @richcmp_method
      ....: class NoCmp(object):
      ....:     def __richcmp__(self, other, op):
      ....:         if op not in (op_EQ, op_NE):
      ....:             raise RuntimeError
      sage: nc = NoCmp()
      sage: FormalSum([(1,nc), (1,1)])
      ------------------------------------------------------------------------
      ---
      RuntimeError                              Traceback (most recent call
      last)
      <ipython-input-23-33e7842a248f> in <module>()
      ----> 1 FormalSum([(Integer(1),nc), (Integer(1),Integer(1))])
      
      /usr/local/src/sage-config/local/lib/python2.7/site-
      packages/sage/structure/formal_sum.pyc in __init__(self, x, parent,
      check, reduce)
          132         assert isinstance(parent,
      parent.category().parent_class)
          133         if reduce:  # first reduce
      --> 134             self.reduce()
          135         if check:   # then check
          136             k = parent.base_ring()
      
      /usr/local/src/sage-config/local/lib/python2.7/site-
      packages/sage/structure/formal_sum.pyc in reduce(self)
          302             self._data = v
          303             return
      --> 304         v.sort()
          305         w = []
          306         last = v[0][0]
      
      /usr/local/src/sage-config/local/lib/python2.7/site-
      packages/sage/rings/integer.pyx in
      sage.rings.integer.Integer.__richcmp__
      (build/cythonized/sage/rings/integer.c:7887)()
          961             c = mpz_cmp_d((<Integer>left).value, d)
          962         else:
      --> 963             return coercion_model.richcmp(left, right, op)
          964
          965         return rich_to_bool_sgn(op, c)
      
      /usr/local/src/sage-config/local/lib/python2.7/site-
      packages/sage/structure/coerce.pyx in
      sage.structure.coerce.CoercionModel_cache_maps.richcmp
      (build/cythonized/sage/structure/coerce.c:20648)()
         1957         # we would end up trying the same coercion again.
         1958         if not y_is_Element and Py_TYPE(y).tp_richcompare:
      -> 1959             res = Py_TYPE(y).tp_richcompare(y, x, revop(op))
         1960             if res is not NotImplemented:
         1961                 return res
      
      /usr/local/src/sage-config/local/lib/python2.7/site-
      packages/sage/structure/richcmp.pyx in
      sage.structure.richcmp.slot_tp_richcompare
      (build/cythonized/sage/structure/richcmp.c:1768)()
          271     Function to put in the ``tp_richcompare`` slot.
          272     """
      --> 273     return self.__richcmp__(other, op)
          274
          275
      
      <ipython-input-19-9d5470810a1a> in __richcmp__(self, other, op)
            3     def __richcmp__(self, other, op):
            4         if op not in (op_EQ, op_NE):
      ----> 5             raise RuntimeError
            6
      
      RuntimeError:
      }}}
      
      To fix this, we do not sort the terms in `reduce()`. Instead, we keep
      the existing ordering.
      
      This requires adding a few straightforward `__hash__` functions in
      `modular`.
      
      URL: https://trac.sagemath.org/22346
      Reported by: jdemeyer
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Marc Mezzarobba
      a179363e
  4. 23 Dec, 2018 29 commits