1. 09 Oct, 2017 1 commit
  2. 03 Oct, 2017 1 commit
  3. 30 Sep, 2017 11 commits
    • Release Manager's avatar
      Trac #23928: crash in LaurentSeries.__call__ when PARI implementation is used · d048fff8
      Release Manager authored
      The following code:
      {{{#!python
      R.<x> = PowerSeriesRing(QQ, implementation='pari')
      f = LaurentSeries(R, x).add_bigoh(7)
      print(f(x))
      }}}
      crashes on sage version 8.0 with the exception:
      {{{
      Traceback (most recent call last):
        File "./mfe.sage.py", line 9, in <module>
          print(f(x))
        File "sage/rings/laurent_series_ring_element.pyx", line 1426, in
      sage.rings.laurent_series_ring_element.LaurentSeries.__call__ (/build/sa
      gemath/src/sage-8.0/src/src/build/cythonized/sage/rings/laurent_series_r
      ing_element.c:16230)
        File "sage/rings/power_series_pari.pyx", line 420, in
      sage.rings.power_series_pari.PowerSeries_pari.__call__ (/build/sagemath/
      src/sage-8.0/src/src/build/cythonized/sage/rings/power_series_pari.c:703
      8)
      AttributeError: 'tuple' object has no attribute 'parent'
      }}}
      
      Line 1426 of `sage/rings/laurent_series_ring_element.pyx` contains the
      following call:
      {{{#!python
              return self.__u(x)*(x[0]**self.__n)
      }}}
      
      In the failing case, the variable `x` is a 1-tuple containing a ring
      element. However, the called method `PowerSeries_pari.__call__` in
      `sage/rings/power_series_pari.pyx` expects a ring element instead of a
      tuple.
      
      The proposed patch decomposes the tuple before passing it to the
      underlying power series implementation.
      
      URL: https://trac.sagemath.org/23928
      Reported by: lorenz
      Ticket author(s): Lorenz Panny
      Reviewer(s): Peter Bruin
      d048fff8
    • Release Manager's avatar
      Trac #23660: Better isomorphisms between function fields and fraction fields · 47024053
      Release Manager authored
      Add a method `function_field` to fraction fields of univariate
      polynomial rings over fields which returns the isomorphic function
      field. Also, the involved morphisms should know that they are injective
      and surjective.
      
      URL: https://trac.sagemath.org/23660
      Reported by: saraedum
      Ticket author(s): Julian Rüth
      Reviewer(s): Jean-Pierre Flori
      47024053
    • Release Manager's avatar
      Trac #23942: Fix category for subcrystals · 74af71aa
      Release Manager authored
      This should not raise an error as the category is the correct input:
      {{{
      sage: B = crystals.infinity.Tableaux(['A',2])
      sage: S = B.subcrystal(max_depth=3, category=HighestWeightCrystals())
      ...
      TypeError: 'HighestWeightCrystals_with_category' object is not iterable
      }}}
      ----
      This should not raise an error either as it should take the appropriate
      join category:
      {{{
      sage: K = crystals.KirillovReshetikhin(['A',3,1], 2,3)
      sage: S = K.subcrystal(index_set=[1,3],
      category=HighestWeightCrystals())
      ...
      ValueError: Subcategory of `Category of finite crystals` required; got
      `Category of highest weight crystals`
      }}}
      Contrast that with this:
      {{{
      sage: B = crystals.infinity.Tableaux(['A',2])
      sage: S = B.subcrystal(index_set=[1], category=HighestWeightCrystals())
      sage: S.category()
      Category of highest weight crystals
      }}}
      ----
      The category is not passed to the parent `subcrystal` call:
      {{{
      sage: x = B.module_generator()
      sage: S = x.subcrystal(max_depth=3, category=HighestWeightCrystals())
      sage: S.category()
      Category of finite crystals
      }}}
      
      URL: https://trac.sagemath.org/23942
      Reported by: tscrim
      Ticket author(s): Travis Scrimshaw
      Reviewer(s): Frédéric Chapoton
      74af71aa
    • Release Manager's avatar
      Trac #23935: Kac module crystals repr does not work for first tableau being empty · 20a19438
      Release Manager authored
      {{{
      sage: Ktriv = crystals.KacModule(['A',[1,1]], [], [])
      sage: Ktriv.module_generator()
      }}}
      results in an `UnboundLocalError` because `Tableau` was imported later
      in the function `to_dual_tableau`.
      
      URL: https://trac.sagemath.org/23935
      Reported by: tscrim
      Ticket author(s): Travis Scrimshaw
      Reviewer(s): Martin Rubey
      20a19438
    • Release Manager's avatar
      Trac #23927: discrete log takes a huge amount of time in some cases · fa48f0b0
      Release Manager authored
      for some inputs, the discrete log can take a huge amount of time,
      whereas for other similar inputs it takes negligible time. Here is a
      first example that takes negligible time (with Sage 8.0):
      {{{
      sage: time mod(17,10^15+37).log(3)
      CPU times: user 48 ms, sys: 0 ns, total: 48 ms
      Wall time: 53.3 ms
      502952226729022
      }}}
      Now consider this other computation modulo a very near prime:
      {{{
      sage: time mod(17,10^15+56719).log(3)
      CPU times: user 1min 3s, sys: 1.42 s, total: 1min 5s
      Wall time: 1min 6s
      420536002305675
      }}}
      If we directly call the Pari/GP discrete log function, it is much
      faster:
      {{{
      sage: time gp.znlog(17,mod(3,10^15+56719))
      CPU times: user 16 ms, sys: 4 ms, total: 20 ms
      Wall time: 130 ms
      420536002305675
      }}}
      Why don't we call the Pari/GP function?
      
      URL: https://trac.sagemath.org/23927
      Reported by: zimmerma
      Ticket author(s): Maarten Derickx
      Reviewer(s): Paul Zimmermann
      fa48f0b0
    • Release Manager's avatar
      Trac #23921: Expression.__pow__ should try to coerce in both directions · ab005198
      Release Manager authored
      When computing `symbolic_expression ** something_else`, the result could
      also live in a common parent of the respective parents, and not
      necessarily in `SR`. Example, we want:
      
      {{{
      sage: A.<n> = AsymptoticRing('SR^n * n^SR', SR)
      sage: SR(2)^n
      2^n
      }}}
      
      Currently, this code yields
      
      {{{
      sage: SR(2)^n
      Traceback (most recent call last):
      ...
      TypeError: no canonical coercion from Asymptotic Ring <SR^n * n^SR> over
      Symbolic Ring to Symbolic Ring
      }}}
      
      URL: https://trac.sagemath.org/23921
      Reported by: behackl
      Ticket author(s): Benjamin Hackl, Daniel Krenn
      Reviewer(s): Jeroen Demeyer
      ab005198
    • Release Manager's avatar
      Trac #23920: py3: richcmp for ideals of multivariate polynomials · 9a93c295
      Release Manager authored
      split off from #23787
      
      refactoring of the comparison of ideals in multivariate polynomials
      
      * to get rid of cmp
      * consistent comparison by containment
      * when a total order is needed, compare instead by gens
      
      URL: https://trac.sagemath.org/23920
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Travis Scrimshaw
      9a93c295
    • Release Manager's avatar
      Trac #23914: Various minor changes to _element_constructor · e5031aeb
      Release Manager authored
      This collects several very minor changes regarding
      `_element_constructor` usage.
      
      URL: https://trac.sagemath.org/23914
      Reported by: jdemeyer
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Vincent Delecroix, Travis Scrimshaw
      e5031aeb
    • Release Manager's avatar
      Trac #23913: Doctest failures with GMP · 780dbfbd
      Release Manager authored
      With GMP is used instead of MPIR, there are two doctest failures because
      of error checking that GMP does but MPIR does not:
      {{{
      **********************************************************************
      File "src/sage/rings/integer.pyx", line 6099, in
      sage.rings.integer.Integer._shift_helper
      Failed example:
          1 << (2^60)
      Expected:
          Traceback (most recent call last):
          ...
          MemoryError: failed to allocate ... bytes
      Got:
          gmp: overflow in mpz type
          Traceback (most recent call last):
            File "/home/jdemeyer/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 515, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/jdemeyer/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 885, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.rings.integer.Integer._shift_helper[8]>", line
      1, in <module>
              Integer(1) << (Integer(2)**Integer(60))
            File "sage/rings/integer.pyx", line 6177, in
      sage.rings.integer.Integer.__lshift__
      (build/cythonized/sage/rings/integer.c:39270)
              return (<Integer>x)._shift_helper(y, 1)
            File "sage/rings/integer.pyx", line 6138, in
      sage.rings.integer.Integer._shift_helper
      (build/cythonized/sage/rings/integer.c:39014)
              sig_on()
          RuntimeError: Aborted
      **********************************************************************
      }}}
      and
      {{{
      sage -t --warn-long 61.3 src/sage/ext/memory.pyx
      **********************************************************************
      File "src/sage/ext/memory.pyx", line 9, in sage.ext.memory
      Failed example:
          2^(2^63-2)
      Expected:
          Traceback (most recent call last):
          ...
          MemoryError: failed to allocate 1152921504606847008 bytes
      Got:
          gmp: overflow in mpz type
          Traceback (most recent call last):
            File "/home/jdemeyer/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 515, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/jdemeyer/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 885, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.ext.memory[0]>", line 1, in <module>
              Integer(2)**(Integer(2)**Integer(63)-Integer(2))
            File "sage/rings/integer.pyx", line 2067, in
      sage.rings.integer.Integer.__pow__
      (build/cythonized/sage/rings/integer.c:14173)
              sig_on()
          RuntimeError: Aborted
      **********************************************************************
      }}}
      Upstream GMP provides no way to hook this error: https://gmplib.org
      /list-archives/gmp-discuss/2017-September/006144.html
      
      URL: https://trac.sagemath.org/23913
      Reported by: jdemeyer
      Ticket author(s): Maarten Derickx
      Reviewer(s): Jeroen Demeyer
      780dbfbd
    • Release Manager's avatar
      Trac #23877: allow bypassing checks in setpartition · 278120e5
      Release Manager authored
      This patch makes the `check` argument of `SetPartition` useful:
      {{{
      sage: SetPartition([[2,3],[1]], check=False)
      {{1}, {2, 3}}
      sage: SetPartition([[2,3],[1,2]], check=False)
      {{1, 2}, {2, 3}}
      
      sage: l = [D.to_noncrossing_partition() for D in DyckWords(8)]
      sage: timeit("[SetPartition(p, check=False) for p in l]", number=1,
      repeat=1)
      1 loops, best of 1: 959 ms per loop
      sage: timeit("[SetPartition(p, check=True) for p in l]", number=1,
      repeat=1)
      1 loops, best of 1: 2.15 s per loop
      }}}
      
      URL: https://trac.sagemath.org/23877
      Reported by: mantepse
      Ticket author(s): Martin Rubey
      Reviewer(s): Travis Scrimshaw
      278120e5
    • Release Manager's avatar
      Trac #23782: fricas output and sage conversion bug · 64dcac95
      Release Manager authored
      In 'SageMath version 8.1.beta0, Release Date: 2017-07-29' I have the
      following behaviour, (at least with FriCAS 1.2.5)
      {{{
      def elementary(k, j):
          """
          sage: f = fricas.guessRat([elementary(5,j) for j in range(15)])[0];
      f
          10      9      8      7       6      5       4      3       2
          3n   - 25n  + 50n  + 62n  - 229n  - 25n  + 320n  - 12n  - 144n
          ---------------------------------------------------------------
                                       11520
      
          sage: print fricas.get(f._name)
            10      9      8      7       6      5       4      3       2
          3n   - 25n  + 50n  + 62n  - 229n  - 25n  + 320n  - 12n  - 144n
          ---------------------------------------------------------------
                                       11520
      
          sage: f.sage()
          NotImplementedError: The translation of the FriCAS Expression "(3*n^
      10+-25*n^9+50*n^8+62*n^7+-229*n^6+-25*n^5+320*n^4+-12*n^3+-144*n^2)/1152
      0 to sage is not yet implemented.
          """
          return stirling_number1(j+1, j+1-k)
      }}}
      Note the bad indentation in the second line and the weird quotation mark
      in the third.
      
      Fixing #22525 would probably fix this, too.
      
      URL: https://trac.sagemath.org/23782
      Reported by: mantepse
      Ticket author(s): Martin Rubey
      Reviewer(s): Ralf Stephan
      64dcac95
  4. 29 Sep, 2017 13 commits
  5. 28 Sep, 2017 2 commits
  6. 27 Sep, 2017 1 commit
  7. 26 Sep, 2017 7 commits
  8. 25 Sep, 2017 4 commits