1. 07 Aug, 2020 1 commit
  2. 05 Aug, 2020 1 commit
  3. 02 Aug, 2020 1 commit
  4. 01 Aug, 2020 1 commit
    • Release Manager's avatar
      Trac #30228: Declare Sections with Name only · acf02633
      Release Manager authored
      At this stage we have the following difference between sections and
      tensor fields:
      
      {{{
      sage: M = Manifold(2, 'M', start_index=1)
      ....: X.<x,y> = M.chart()
      ....: E = M.vector_bundle(2, 'E')
      ....: e = E.local_frame('e')
      ....: v = M.vector_field('v')
      ....: s = E.section('s')
      Traceback (most recent call last)
      ...
      IndexError: string index out of range
      }}}
      
      This simply comes from the fact that the method `section` does not like
      pure strings as input, in contrast to `vector_field` or `tensor`.
      
      URL: https://trac.sagemath.org/30228
      Reported by: gh-mjungmath
      Ticket author(s): Michael Jung
      Reviewer(s): Travis Scrimshaw
      acf02633
  5. 30 Jul, 2020 9 commits
    • Release Manager's avatar
      Trac #30191: failed conversion yields unconclusive error message · 2279b17f
      Release Manager authored
      At this stage, the conversion
      {{{
      sage: M = Manifold(2, 'M')
      sage: M.diff_form_module(1)(1)
      ------------------------------------------------------------------------
      ---
      AttributeError                            Traceback (most recent call
      last)
      ...
      AttributeError: 'NoneType' object has no attribute '_domain'
      }}}
      fails with an `AttributeError`.
      
      This should rather yield a `NotImplementedError` or `TypeError` with the
      message that there is no conversion available.
      
      URL: https://trac.sagemath.org/30191
      Reported by: gh-mjungmath
      Ticket author(s): Michael Jung
      Reviewer(s): Travis Scrimshaw
      2279b17f
    • Release Manager's avatar
      Trac #30185: Upgrade pillow to 7.2.0 · 2f083dc4
      Release Manager authored
      (from #30103)
      
      On this ticket:
       - Upgrade https://pypi.org/project/Pillow/ to 7.2.0 (latest as of
      2020-07-11; supports Python >= 3.5)
      
      URL: https://trac.sagemath.org/30185
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): John Palmieri
      2f083dc4
    • Release Manager's avatar
      Trac #30173: ECL 20.4.24: More trouble with makeinfo · d0505272
      Release Manager authored
      https://groups.google.com/d/msg/sage-devel/2zjlIEsKETU/PkM3_eh1CAAJ
      
      URL: https://trac.sagemath.org/30173
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Dima Pasechnik
      d0505272
    • Release Manager's avatar
      Trac #30108: Not equal comparison for mixed forms · 8a273696
      Release Manager authored
      At this stage, the not equal comparison fails:
      {{{
      sage: M = Manifold(4, 'M')
      sage: X.<x,y,z,t> = M.chart()
      sage: Form0 = M.mixed_form(comp=([0,0,0,0,0]))
      sage: Form1 = M.mixed_form(comp=([1,0,0,0,0]))
      sage: Form0 != Form1
      False
      }}}
      
      (reported at https://ask.sagemath.org/question/52409/why-doesnt-or-work-
      for-mixed-forms/)
      
      I already spotted the error: originally, `richcmp` is checked separately
      on each component and returns `False` if the check fails for at least
      one element. But for the inequality, it is enough when the check
      succeeds for at least one element because then both mixed forms are
      already unequal.
      
      This bug gets fixed in this ticket. Furthermore, an equality check
      between mixed forms and differential forms will be possible.
      
      URL: https://trac.sagemath.org/30108
      Reported by: gh-mjungmath
      Ticket author(s): Michael Jung
      Reviewer(s): Eric Gourgoulhon
      8a273696
    • Release Manager's avatar
      Trac #30094: Basis-dependent isomorphism from FiniteRankFreeModule to an... · d14a2c57
      Release Manager authored
      Trac #30094: Basis-dependent isomorphism from FiniteRankFreeModule to an object in the category ModulesWithBasis
      
      (This ticket has been narrowed to the topic mainly discussed in the
      comments. The topic originally in title and ticket description has been
      moved to #30174)
      
      There are multiple incompatible protocols for dealing with bases of a
      free module in Sage (#19346).
      
      One such protocol is defined by the category `ModulesWithBasis`.
      `CombinatorialFreeModule` is one of the parent classes in this category.
      
      Another such protocol is defined by the parent class
      `FiniteRankFreeModule`, which is in the category `Modules`.
      A `FiniteRankFreeModule` can be equipped with a finite list of bases
      (each represented by an instance of `FreeModuleBasis`), none of which
      are considered distinguished. `FiniteRankFreeModule`s are unique
      parents; the operation of equipping a `FiniteRankFreeModule`  does not
      change the identity of the parent.
      
      We define a method `FiniteRankFreeModule. isomorphism_with_fixed_basis`
      that establishes, given a basis, an isomorphism with a
      `CombinatorialFreeModule` (and thus a parent in the category
      `ModulesWithBasis`.
      
      URL: https://trac.sagemath.org/30094
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe, Michael Jung
      Reviewer(s): Michael Jung, Matthias Koeppe, Eric Gourgoulhon, Travis
      Scrimshaw
      d14a2c57
    • Release Manager's avatar
      Trac #30062: Rename MetricSpaces parent method metric to metric_function, add... · 653d0f4d
      Release Manager authored
      Trac #30062: Rename MetricSpaces parent method metric to metric_function, add EuclideanSpace to category of metric spaces
      
      {{{
      sage: from sage.categories.metric_spaces import MetricSpaces
      sage: QQ in MetricSpaces()
      True
      sage: RR in MetricSpaces()
      True
      sage: ZZ in MetricSpaces()
      True
      sage: AA in MetricSpaces()
      False
      sage: QuadraticField(5) in MetricSpaces()
      False
      sage: M = Matrix(QQ,[[2,1,0],[1,2,1],[0,1,2]])
      sage: V = VectorSpace(QQ,3,inner_product_matrix=M)
      sage: V in MetricSpaces()
      False
      sage: E = EuclideanSpace(3)
      sage: E in MetricSpaces()
      False
      }}}
      
      On this ticket, we add (from
      https://trac.sagemath.org/ticket/30061#comment:44) `EuclideanSpace`
      (implementing the distance function by means of the Cartesian chart) to
      the category.
      
      To do this, we rename the `MetricSpaces` parent method `metric` to
      `metric_function`.
      
      The other examples from above will be taken care of in #30092 (which
      adds inner product spaces) and #30219 (real embedded number fields).
      
      URL: https://trac.sagemath.org/30062
      Reported by: mkoeppe
      Ticket author(s): Eric Gourgoulhon, Matthias Koeppe
      Reviewer(s): Matthias Koeppe, Travis Scrimshaw
      653d0f4d
    • Release Manager's avatar
      Trac #30061: Speed up constructing high-dimensional Euclidean spaces · c1c4e1ce
      Release Manager authored
      The n-dimensional Euclidean space is available in Sage in many variants.
      
      This ticket brings the speed of the most basic operation (constructing
      the space) of `EuclideanSpace` (from sage-manifolds) closer to that of
      the other variants.
      
      '''Spaces without scalar product:'''
      
      {{{
      sage: VectorSpace(QQ, 5).category()
      Category of finite dimensional vector spaces with basis over (number
      fields and quotient fields and metric spaces)
      sage: %time VectorSpace(QQ, 5)
      CPU times: user 28 µs, sys: 9 µs, total: 37 µs
      Wall time: 40.1 µs
      Vector space of dimension 5 over Rational Field
      sage: %time VectorSpace(QQ, 80)
      CPU times: user 218 µs, sys: 1 µs, total: 219 µs
      Wall time: 223 µs
      Vector space of dimension 80 over Rational Field
      sage: %time VectorSpace(QQ, 1000)
      CPU times: user 208 µs, sys: 1 µs, total: 209 µs
      Wall time: 213 µs
      Vector space of dimension 1000 over Rational Field
      
      sage: for n in 5, 80, 1000, 4000, 10000, 100000: print("n =
      {}".format(n)); print("Construction: ", timeit("V = VectorSpace(QQ,
      {})".format(n),number=1,repeat=1)); u = [ x for x i
      ....: n range(n) ]; v = [ x + 1 for x in range(n) ]; V = VectorSpace(QQ,
      n); print("Distance:     ", timeit("norm(V(u) - V(v))"))
      n = 5
      Construction:  1 loop, best of 1: 56.1 ms per loop
      Distance:      625 loops, best of 3: 81.7 μs per loop
      n = 80
      Construction:  1 loop, best of 1: 159 μs per loop
      Distance:      625 loops, best of 3: 299 μs per loop
      n = 1000
      Construction:  1 loop, best of 1: 236 μs per loop
      Distance:      125 loops, best of 3: 3.18 ms per loop
      n = 4000
      Construction:  1 loop, best of 1: 147 μs per loop
      Distance:      25 loops, best of 3: 11.3 ms per loop
      n = 10000
      Construction:  1 loop, best of 1: 149 μs per loop
      Distance:      25 loops, best of 3: 28.7 ms per loop
      n = 100000
      Construction:  1 loop, best of 1: 162 μs per loop
      Distance:      5 loops, best of 3: 296 ms per loop
      }}}
      
      {{{
      sage: CombinatorialFreeModule(QQ, range(5)).category()
      Category of finite dimensional vector spaces with basis over Rational
      Field
      sage: %time CombinatorialFreeModule(QQ, range(5))
      CPU times: user 80 µs, sys: 0 ns, total: 80 µs
      Wall time: 86.1 µs
      Free module generated by {0, 1, 2, 3, 4} over Rational Field
      sage: %time CombinatorialFreeModule(QQ, range(80))
      CPU times: user 244 µs, sys: 10 µs, total: 254 µs
      Wall time: 259 µs
      Free module generated by {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
      14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
      32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
      50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
      68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79} over Rational Field
      sage: %time CombinatorialFreeModule(QQ, range(1000))
      CPU times: user 322 µs, sys: 26 µs, total: 348 µs
      Wall time: 354 µs
      }}}
      
      {{{
      sage: AffineSpace(RR, 5).category()
      Category of schemes over Real Field with 53 bits of precision
      
      sage: %time AffineSpace(RR, 5)
      CPU times: user 47 µs, sys: 1 µs, total: 48 µs
      Wall time: 51 µs
      Affine Space of dimension 5 over Real Field with 53 bits of precision
      sage: %time AffineSpace(RR, 80)
      CPU times: user 2 ms, sys: 39 µs, total: 2.04 ms
      Wall time: 2.04 ms
      Affine Space of dimension 80 over Real Field with 53 bits of precision
      sage: %time AffineSpace(RR, 1000)
      CPU times: user 62.8 ms, sys: 1.45 ms, total: 64.3 ms
      Wall time: 63.5 ms
      Affine Space of dimension 1000 over Real Field with 53 bits of precision
      }}}
      
      '''Spaces with scalar product:'''
      
      {{{
      sage: VectorSpace(QQ, 5,
      inner_product_matrix=matrix.identity(5)).category()
      Category of finite dimensional vector spaces with basis over (number
      fields and quotient fields and metric spaces)
      sage: %time VectorSpace(QQ, 5, inner_product_matrix=matrix.identity(5))
      CPU times: user 6.55 ms, sys: 666 µs, total: 7.22 ms
      Wall time: 6.88 ms
      Ambient quadratic space of dimension 5 over Rational Field
      Inner product matrix:
      [1 0 0 0 0]
      [0 1 0 0 0]
      [0 0 1 0 0]
      [0 0 0 1 0]
      [0 0 0 0 1]
      sage: %time VectorSpace(QQ, 80,
      inner_product_matrix=matrix.identity(80))
      CPU times: user 14.1 ms, sys: 439 µs, total: 14.6 ms
      Wall time: 14.4 ms
      Ambient quadratic space of dimension 80 over Rational Field
      Inner product matrix:
      sage: %time VectorSpace(QQ, 1000,
      inner_product_matrix=matrix.identity(1000))
      CPU times: user 1.44 s, sys: 34.4 ms, total: 1.47 s
      Wall time: 1.48 s
      Ambient quadratic space of dimension 1000 over Rational Field
      Inner product matrix: ...
      
      sage: for n in 5, 80, 1000, 4000: print("n = {}".format(n));
      print("Construction: ", timeit("V = VectorSpace(QQ, {},
      inner_product_matrix=matrix.identity({}))".format(n,
      n),number=1,repeat=1)); u = [ x for x in range(n) ]; v = [ x + 1 for x
      in range(n) ]; V = VectorSpace(QQ, n,
      inner_product_matrix=matrix.identity(n)); print("Distance:     ",
      timeit("t = V(u)-V(v); sqrt(t.inner_product(t))"))
      n = 5
      Construction:  1 loop, best of 1: 61.9 ms per loop
      Distance:      625 loops, best of 3: 49.4 μs per loop
      n = 80
      Construction:  1 loop, best of 1: 9.75 ms per loop
      Distance:      625 loops, best of 3: 243 μs per loop
      n = 1000
      Construction:  1 loop, best of 1: 1.51 s per loop
      Distance:      25 loops, best of 3: 14.4 ms per loop
      n = 4000
      Construction:  1 loop, best of 1: 23.8 s per loop
      Distance:      5 loops, best of 3: 225 ms per loop
      }}}
      NB: It is not in the category `MetricSpaces`, and thus the element
      methods `dist` and `abs` (?!) are missing... The methods `__abs__`,
      `norm`, and `dot_product` are unrelated to the inner product matrix;
      only `inner_product` uses `inner_product_matrix`.
      
      {{{
      sage: EuclideanSpace(5).category()
      Category of smooth manifolds over Real Field with 53 bits of precision
      
      sage: %time EuclideanSpace(5)
      CPU times: user 177 ms, sys: 10.4 ms, total: 187 ms
      Wall time: 196 ms
      5-dimensional Euclidean space E^5
      sage: %time EuclideanSpace(80)
      CPU times: user 32.8 s, sys: 758 ms, total: 33.6 s
      Wall time: 31.5 s
      80-dimensional Euclidean space E^80
      sage: %time EuclideanSpace(1000)
      (timeout)
      }}}
      
      ''With this ticket (and its dependencies #30065, #30074):''
      {{{
      sage: %time EuclideanSpace(5)
      CPU times: user 4.87 ms, sys: 372 µs, total: 5.24 ms
      Wall time: 4.93 ms
      5-dimensional Euclidean space E^5
      sage: %time EuclideanSpace(80)
      CPU times: user 106 ms, sys: 4.52 ms, total: 110 ms
      Wall time: 92 ms
      80-dimensional Euclidean space E^80
      sage: %time EuclideanSpace(1000)
      CPU times: user 1.04 s, sys: 33.5 ms, total: 1.07 s
      Wall time: 986 ms
      }}}
      ''Some caching is happening too. The second time:''
      {{{
      sage: %time EuclideanSpace(1000)
      CPU times: user 207 ms, sys: 5.63 ms, total: 213 ms
      Wall time: 212 ms
      1000-dimensional Euclidean space E^1000
      }}}
      
      '''Scalar product without a space:'''
      {{{
      sage: %time DiagonalQuadraticForm(QQ, [1]*5)
      CPU times: user 60 µs, sys: 1e+03 ns, total: 61 µs
      Wall time: 62.9 µs
      Quadratic form in 5 variables over Rational Field with coefficients:
      [ 1 0 0 0 0 ]
      [ * 1 0 0 0 ]
      [ * * 1 0 0 ]
      [ * * * 1 0 ]
      [ * * * * 1 ]
      sage: %time DiagonalQuadraticForm(QQ, [1]*80)
      CPU times: user 1.35 ms, sys: 31 µs, total: 1.39 ms
      Wall time: 1.44 ms
      Quadratic form in 80 variables over Rational Field with coefficients:
      sage: %time DiagonalQuadraticForm(QQ, [1]*1000)
      CPU times: user 144 ms, sys: 2.85 ms, total: 147 ms
      Wall time: 147 ms
      Quadratic form in 1000 variables over Rational Field with coefficients:
      }}}
      
      URL: https://trac.sagemath.org/30061
      Reported by: mkoeppe
      Ticket author(s): Eric Gourgoulhon
      Reviewer(s): Matthias Koeppe
      c1c4e1ce
    • Release Manager's avatar
      Trac #30039: Implement weighted version of 2Dsweep and DiFUB · 2e58bf7d
      Release Manager authored
      This ticket aims to implement weighted version of `2Dsweep` and `DiFUB`
      
      URL: https://trac.sagemath.org/30039
      Reported by: gh-vipul79321
      Ticket author(s): Vipul Gupta
      Reviewer(s): David Coudert
      2e58bf7d
    • Release Manager's avatar
      Trac #29944: MR45: Do not pretend to build Python 2 docker images · ca983afc
      Release Manager authored
      Julian Rüth ([https://gitlab.com/saraedum @saraedum]) opened a merge
      request at sagemath/sage!45:
      ----
      {{{
      #!markdown
      we are not actually building these anymore so we should not try to build
      everything twice.
      }}}
      
      URL: https://trac.sagemath.org/29944
      Reported by: galois
      Ticket author(s): Julian Rüth
      Reviewer(s): Samuel Lelièvre
      ca983afc
  6. 29 Jul, 2020 4 commits
  7. 28 Jul, 2020 23 commits
    • Release Manager's avatar
      Trac #29506: Backend for Hyperplane Arrangements · f94ac663
      Release Manager authored
      Currently, Hyperplane arrangements only use the default backends for
      related polyhedral objects.
      
      We should make it possible to use backends. For example:
      
      {{{
      sage: K.<q> = CyclotomicField(9)
      sage: L.<r9> = NumberField((q+q^(-1)).minpoly(),embedding = AA(q+q^-1))
      sage: norms = [[1,1/3*(-2*r9^2-r9+1),0],[1,-r9^2-r9,0],
                     [1,-r9^2+1,0],[1,-r9^2,0],[1,r9^2-4,-r9^2+3]]
      sage: H.<x,y,z> = HyperplaneArrangements(L)
      sage: A = H(backend='normaliz')
      sage: for v in norms:
      ....:      a,b,c = v
      ....:     A = A.add_hyperplane(a*x + b*y + c*z)
      sage: R = A.regions()               # optional - pynormaliz
      sage: R[0].backend()                # optional - pynormaliz
      'normaliz'
      }}}
      
      URL: https://trac.sagemath.org/29506
      Reported by: jipilab
      Ticket author(s): Jean-Philippe Labbé
      Reviewer(s): Travis Scrimshaw
      f94ac663
    • Release Manager's avatar
      Trac #30114: add missing colons in padics documentation · 0f1e9125
      Release Manager authored
      This adds missing `::` for code blocks in documentation.
      
      URL: https://trac.sagemath.org/30114
      Reported by: gh-mwageringel
      Ticket author(s): Markus Wageringel
      Reviewer(s): Travis Scrimshaw
      0f1e9125
    • Release Manager's avatar
      Trac #30074: Speedups for symbolic assumptions · 9b2e764e
      Release Manager authored
      As a follow-up from #30065,
      we cache `GenericDeclaration`, maintain the current assumptions as an
      `OrderedDict` instead of a list, and rework `GenericDeclaration.assume`
      so it reuses maxima contexts.
      
      The examples from #30065 become near-instantaneous.
      
      The example from #30061, previously 32.8 s, becomes much faster:
      {{{
      sage: %time EuclideanSpace(80)
      CPU times: user 1.76 s, sys: 194 ms, total: 1.95 s
      Wall time: 1.63 s
      80-dimensional Euclidean space E^80
      }}}
      
      Also `./sage -btp src/sage/symbolic/ src/sage/manifolds/
      src/sage/calculus/` shows modest improvements.
      
      URL: https://trac.sagemath.org/30074
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Travis Scrimshaw, Markus Wageringel, Nils Bruin
      9b2e764e
    • Release Manager's avatar
      Trac #29777: xgcd for polynomials over padic rings · 9c5b1850
      Release Manager authored
      Currently, padic rings do not support xgcd. In this ticket we add code
      to implement the (currently mathematically incorrect) padic gcd for
      padic rings via `_xgcd_univariate_polynomial`, with a warning stating
      that xgcd could be incorrect.
      
      URL: https://trac.sagemath.org/29777
      Reported by: gh-EnderWannabe
      Ticket author(s): Alex Galarraga
      Reviewer(s): Ben Hutz
      9c5b1850
    • Release Manager's avatar
      Trac #29694: conflict between lazy attribute and abstract method tester · a1c3b486
      Release Manager authored
      This ticket fixes a test suite failure that occurs when a lazy attribute
      raises a `NotImplementedError`.
      
      {{{
      sage: class NotAbstract(SageObject):
      ....:     @lazy_attribute
      ....:     def bla(self):
      ....:         raise NotImplementedError("not implemented")
      sage: NotAbstract()._test_not_implemented_methods()
      ...
      AssertionError: Not implemented method: bla
      }}}
      
      The method `_test_not_implemented_methods` should only fail when an
      `AbstractMethod` is not implemented.
      
      URL: https://trac.sagemath.org/29694
      Reported by: gh-mwageringel
      Ticket author(s): Markus Wageringel
      Reviewer(s): Kwankyu Lee
      a1c3b486
    • Release Manager's avatar
      Trac #29194: Three.js-based Animations · b274faf8
      Release Manager authored
      Moving conversation from #29192, where I mentioned that I've been
      working on adding support for three.js-based interactive 3D animated
      plots to Sage.
      
      The current state of the work can be found at:
      
          https://gitlab.com/jcamp0x2a/sage/-/tree/threejs-animate
      
      ...and some examples of the plots generated so far and how the animation
      functionality is invoked:
      
          https://jcamp0x2a.github.io/threejs-animation-example/
      
      Tasks remaining before I'd be comfortable making a merge request:
      
      - Persist animation state across viewings. (maybe)
      
      - Better handling of variable name collisions. If both plot G1 and G2
      use an animation variable `x`, rather than overwriting one of them when
      summing G1 + G2, rename one of them instead. `x`, `x′`, `x″`, etc.
      
      - Pause the render loop when no variable is being animated. (energy /
      battery life)
      
      - Partition scene objects into keyframe groups whose visibility can be
      toggled on/off in one assignment every frame vs. iterating over every
      scene object every frame.
      
      - Come up with several animated plots to embed in the documentation
      showing off a wide variety of plots being animated: simple shapes,
      parametric curves/surfaces, implicit surfaces, surfaces of revolution,
      scatter plots, vector fields, etc.
      
      - Tests!
      
      Possible future work:
      
      - Break animation javascript code off into a separate file that's only
      included when the plot contains animation. (smaller file size, less
      bandwidth, more modular)
      
      - Interpolate/blend/morph between keyframes in order to improve the
      appearance of the animations, and allow it to be disabled. Some ideas
      include:
        - Fade keyframes in and out (via object opacity).
        - Identify corresponding objects between frames and interpolate their
      transforms and/or geometries.
        - Image-based blending: render the two keyframes you're between (for N
      variables, the min/max corners of the N-box) then blend them while
      rendering to a textured screen-size quad.
      
      - Performance improvements due to the # of objects animation may add to
      the scene:
        - Use Buffer Geometry instead of Geometry.
        - Merge identical objects and use instanced rendering.
        - Merge geometries that share a material and use range-restricted
      draws.
      
      URL: https://trac.sagemath.org/29194
      Reported by: gh-jcamp0x2a
      Ticket author(s): Joshua Campbell
      Reviewer(s): Paul Masson
      b274faf8
    • Release Manager's avatar
      Trac #28959: Upgrade zn_poly to v0.9.2 · cc7fa7d3
      Release Manager authored
      Minor fixes and incorporates downstream patches to the build system.
      
      Upstream tarball:
      https://gitlab.com/sagemath/zn_poly/-/archive/0.9.2/zn_poly-0.9.2.tar.gz
      
      URL: https://trac.sagemath.org/28959
      Reported by: embray
      Ticket author(s): Erik Bray
      Reviewer(s): Dima Pasechnik
      cc7fa7d3
    • Release Manager's avatar
      Trac #30215: VectorSpaces: Add a parent method dimension · 61f77810
      Release Manager authored
      ... as an alias for `rank` (which is provided by free modules).
      
      Currently it is provided by some but not all implementations of vector
      spaces:
      {{{
      sage: C = CombinatorialFreeModule(QQ, ['x', 'y'])
      sage: C.rank()
      2
      sage: C.dimension()
      2
      
      sage: F = FiniteRankFreeModule(QQ, 2)
      sage: F.rank()
      2
      sage: F.dimension()
      AttributeError: 'FiniteRankFreeModule_with_category' object has no
      attribute 'dimension'
      }}}
      
      (from #30204)
      
      URL: https://trac.sagemath.org/30215
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Eric Gourgoulhon
      61f77810
    • Release Manager's avatar
      Trac #30204: Prepare Polyhedra parent factory to handle more general ambient spaces · 4492d289
      Release Manager authored
      This adds a new way to set up a Polyhedra parent.
      {{{
              sage: V = VectorSpace(QQ, 3)
              sage: Polyhedra(V) is Polyhedra(QQ, 3)
              True
      }}}
      
      Part of #30198.
      
      URL: https://trac.sagemath.org/30204
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Jonathan Kliem
      4492d289
    • Release Manager's avatar
      Trac #30195: tox.ini: Add centos-6, docker-nobootstrap, manylinux-* · 95d311d3
      Release Manager authored
      The `docker-nobootstrap` option uses `bootstrap -D`; thus, autotools are
      not required on the host for the build.
      
      This enables building with `centos-6` and the `manylinux` images based
      on `centos-6` (https://github.com/pypa/manylinux).
      
      Examples:
      {{{
      tox -e docker-manylinux-2014-standard
      tox -e docker-manylinux-2014-standard-python3.9
      tox -e docker-manylinux-2010-standard-i686-python3.8
      }}}
      
      URL: https://trac.sagemath.org/30195
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Jonathan Kliem
      95d311d3
    • Release Manager's avatar
      Trac #30180: Category Modules should provide a parent method module_morphism... · 7be09f6c
      Release Manager authored
      Trac #30180: Category Modules should provide a parent method module_morphism compatible with ModulesWithBasis.module_morphism
      
      Because there is no distinguished basis, it would only support the
      option `function` of `ModulesWithBasis.module_morphism`:
      
      {{{
              def module_morphism(self, on_basis=None, matrix=None,
      function=None,
                                  diagonal=None, triangular=None,
      unitriangular=False,
                                  **keywords):
                  r"""
                  Construct a module morphism from ``self`` to ``codomain``.
      
                  Let ``self`` be a module `X` with a basis indexed by `I`.
                  This constructs a morphism `f: X \to Y` by linearity from
                  a map `I \to Y` which is to be its restriction to the
                  basis `(x_i)_{i \in I}` of `X`. Some variants are possible
                  too.
      
                  INPUT:
      
                  - ``self`` -- a parent `X` in ``ModulesWithBasis(R)`` with
                    basis `x=(x_i)_{i\in I}`.
      
                  Exactly one of the four following options must be
                  specified in order to define the morphism:
      
                  - ``on_basis`` -- a function `f` from `I` to `Y`
                  - ``diagonal`` -- a function `d` from `I` to `R`
      *KEEP*      - ``function`` -- a function `f` from `X` to `Y`
                  - ``matrix``   -- a matrix of size `\dim Y \times \dim X`
                    (if the keyword ``side`` is set to ``'left'``) or
                    `\dim Y \times \dim X` (if this keyword is ``'right'``)
      
                  Further options include:
      
      *KEEP*      - ``codomain`` -- the codomain `Y` of the morphism (default:
                    ``f.codomain()`` if it's defined; otherwise it must be
      specified)
      
      *KEEP*      - ``category`` -- a category or ``None`` (default: `None``)
      
                  - ``zero`` -- the zero of the codomain (default:
      ``codomain.zero()``);
                    can be used (with care) to define affine maps.
                    Only meaningful with ``on_basis``.
      
                  - ``position`` -- a non-negative integer specifying which
                    positional argument is used as the input of the function
      `f`
                    (default: 0); this is currently only used with
      ``on_basis``.
      
                  - ``triangular`` --  (default: ``None``) ``"upper"`` or
                    ``"lower"`` or ``None``:
      
                    * ``"upper"`` - if the
                      :meth:`~ModulesWithBasis.ElementMethods.leading_support`
                      of the image of the basis vector `x_i` is `i`, or
      
                    * ``"lower"`` - if the
      :meth:`~ModulesWithBasis.ElementMethods.trailing_support`
                      of the image of the basis vector `x_i` is `i`.
      
                  - ``unitriangular`` -- (default: ``False``) a boolean.
                    Only meaningful for a triangular morphism.
                    As a shorthand, one may use ``unitriangular="lower"``
                    for ``triangular="lower", unitriangular=True``.
      
                  - ``side`` -- "left" or "right" (default: "left")
                    Only meaningful for a morphism built from a matrix.
      
      }}}
      
      URL: https://trac.sagemath.org/30180
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Eric Gourgoulhon
      7be09f6c
    • Release Manager's avatar
      Trac #30179: ModulesWithBasis.linear_combination should be a method of Modules · abd54ac8
      Release Manager authored
      This method does not need a basis.
      
      Moving it to `Modules` will make it available in `FiniteRankFreeModule`.
      
      {{{
              def linear_combination(self, iter_of_elements_coeff,
      factor_on_left=True):
                  r"""
                  Return the linear combination `\lambda_1 v_1 + \cdots +
                  \lambda_k v_k` (resp.  the linear combination `v_1 \lambda_1
      +
                  \cdots + v_k \lambda_k`) where ``iter_of_elements_coeff``
      iterates
                  through the sequence `((\lambda_1, v_1), ..., (\lambda_k,
      v_k))`.
      
                  INPUT:
      
                  - ``iter_of_elements_coeff`` -- iterator of pairs
                    ``(element, coeff)`` with ``element`` in ``self`` and
                    ``coeff`` in ``self.base_ring()``
      
                  - ``factor_on_left`` -- (optional) if ``True``, the
      coefficients
                    are multiplied from the left; if ``False``, the
      coefficients
                    are multiplied from the right
      
                  EXAMPLES::
      
                      sage: m = matrix([[0,1],[1,1]])
                      sage: J.<a,b,c> = JordanAlgebra(m)
                      sage: J.linear_combination(((a+b, 1), (-2*b + c, -1)))
                      1 + (3, -1)
                  """
                  if factor_on_left:
                      return self.sum(coeff * element
                                      for element, coeff in
      iter_of_elements_coeff)
                  else:
                      return self.sum(element * coeff
                                      for element, coeff in
      iter_of_elements_coeff)
      }}}
      
      URL: https://trac.sagemath.org/30179
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Travis Scrimshaw
      abd54ac8
    • Release Manager's avatar
      Trac #30170: Make morphisms of metric spaces metric maps · d8b44dd7
      Release Manager authored
      The morphisms in the category of metric spaces are the metric maps (maps
      with Lipschitz constant 1).
      
      We add a Parent method `_test...` to the Homset that verifies it.
      
      Follow-up: #30193: Axioms for functionals
      
      URL: https://trac.sagemath.org/30170
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Travis Scrimshaw
      d8b44dd7
    • Release Manager's avatar
      Trac #30166: Cartesian products of metric, topological spaces · 77b83759
      Release Manager authored
      Currently, taking cartesian products forgets about the category of
      metric spaces. Example:
      {{{
      sage: UHP = HyperbolicPlane().UHP()
      sage: UHP
      Hyperbolic plane in the Upper Half Plane Model
      sage: UHP.categories()
      [Category of hyperbolic models of Hyperbolic plane,
       Category of realizations of Hyperbolic plane,
       Category of realizations of sets,
       Category of metric spaces,
       Category of topological spaces,
       Category of sets,
       Category of sets with partial maps,
       Category of objects]
      
      sage: UHP2 = UHP.cartesian_product(UHP)
      sage: UHP2.categories()
      [Category of Cartesian products of sets,
       Category of sets,
       Category of sets with partial maps,
       Category of objects]
      }}}
      
      In this ticket, we handle Cartesian products of:
       - (complete) metric spaces
       - (compact, connected) topological spaces
      
      URL: https://trac.sagemath.org/30166
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Travis Scrimshaw
      77b83759
    • Release Manager's avatar
      Trac #30162: Make doctests accept Python 3.8.x respellings of some error messages · ddee5484
      Release Manager authored
      Inspired by
      https://salsa.debian.org/science-
      team/sagemath/-/blob/master/debian/patches/u0-version-python-3.8.patch
      we do
      {{{
      git grep -l ^\ \*[A-Za-z]\*Error.\*can\'t | xargs sed -i.bak s/Error:\
      \\\(.*\\\)an\'t/Error:\ \\1an...t/
      }}}
      
      URL: https://trac.sagemath.org/30162
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe
      Reviewer(s): Antonio Rojas
      ddee5484
    • Release Manager's avatar
      Trac #30161: Zero Matrix has Inverse over Finite Field · 37c62d2f
      Release Manager authored
      The bug is outlined in this post:
      https://ask.sagemath.org/question/52487/zero-matrix-has-an-inverse-over-
      finite-field/
      
      In short, the following lines of code should throw an error, but they do
      not.
      
      {{{
      M = Matrix([0], ring=GF(4))
      M.inverse()
      }}}
      
      Instead they return the matrix [1].
      
      URL: https://trac.sagemath.org/30161
      Reported by: gh-prismika
      Ticket author(s): Martin Albrecht
      Reviewer(s): Samuel Lelièvre
      37c62d2f
    • Release Manager's avatar
      Trac #30157: Cygwin: system sqlite3 modifies DLL search order · d35315a1
      Release Manager authored
      Under normal operation Windows searches for DLLs in the following order:
      
      1. In the same directory as the main executable.
      2. In various standard system directories.
      3. Search `$PATH`.
      
      On Cygwin, most DLLs are stored under /usr/bin, which is inserted early
      on the `$PATH`, but when in the Sage environment `$SAGE_LOCAL/bin`
      supersedes it.
      
      However, I discovered that the Cygwin port of sqlite3 contains the
      following nasty patch, for reasons I can't be sure of:
      
      {{{
      #!diff
      @@ -47710,13 +48357,52 @@ SQLITE_API int sqlite3_os_init(void){
         assert( winSysInfo.dwAllocationGranularity>0 );
         assert( winSysInfo.dwPageSize>0 );
      
      +#ifdef _WIN32
      +  module = osGetModuleHandleW(L"CYGWIN1.DLL");
      +  if( !module ){
      +    module = osGetModuleHandleW(L"MSYS-2.0.DLL");
      +  }
      +  if( !module ){
      +    module = osGetModuleHandleW(L"MSYS-1.0.DLL");
      +  }
      +  if( module ){
      +    for( i=81; i<ArraySize(aSyscall); ++i ){
      +        aSyscall[i].pCurrent = (SYSCALL) osGetProcAddressA(module,
      +            aSyscall[i].zName);
      +    }
      +  }
      +#endif
      +
      +#if SQLITE_OS_UNIX
      +  sqlite3_os_unix_init();
      +#endif
      +
         sqlite3_vfs_register(&winVfs, 1);
      
      +#if !defined(SQLITE_OMIT_LOAD_EXTENSION)
      +  if( cygwin_conv_path ){
      +    WCHAR buf[MAX_PATH];
      +    cygwin_conv_path(CCP_POSIX_TO_WIN_W, "/usr/bin",
      +        buf, MAX_PATH*sizeof(WCHAR));
      +    osSetDllDirectoryW(buf);
      +#ifdef _WIN32
      +  }else if( cygwin_conv_to_full_win32_path ){
      +    WCHAR buf[MAX_PATH];
      +    char *buf1 = (char *)buf;
      +    int i = MAX_PATH;
      +    cygwin_conv_to_full_win32_path("/usr/bin", buf1);
      +    while(--i>=0) buf[i] = buf1[i];
      +    osSetDllDirectoryW(buf);
      +#endif
      +  }
      +#endif
      +
       #if defined(SQLITE_WIN32_HAS_WIDE)
         sqlite3_vfs_register(&winLongPathVfs, 0);
       #endif
      }}}
      
      The function [https://docs.microsoft.com/en-us/windows/win32/api/winbase
      /nf-winbase-setdlldirectoryw SetDllDirectoryW] is a system function
      which works a little like `LD_LIBRARY_PATH` or `LD_PRELOAD` allowing an
      application to insert a non-standard directory into the DLL search path.
      
      Why sqlite3 is doing this I don't know.  It has something to do with
      loading extensions apparently, but there's no reason it should assume I
      always want to load extensions from `/usr/bin` (e.g. what if I'm using a
      custom build of sqlite3 installed in `/usr/local/bin`.
      
      It does this also when the library is first initialized, as opposed to
      just doing it before loading an extension and then unsetting it.  Thus
      this change to DLL loading behavior affects the rest of the application
      for the lifetime of the application.  It does get undone if
      `sqlite3_shutdown()` is called but this never happens normally.
      
      How does this affect Sage?  It's not even obvious that Sage uses
      sqlite3, but in fact IPython does to store its history, so a sqlite3
      database is connected to when starting up the Sage/IPython REPL.  This
      in turn impacts DLL search order for all libraries that haven't been
      loaded yet, and can cause Cygwin's system versions of those libraries to
      be privileged over any copies in Sage.
      
      I think this might actually explain some related bugs I've seen in the
      past, but I'm not sure.
      
      URL: https://trac.sagemath.org/30157
      Reported by: embray
      Ticket author(s): Erik Bray
      Reviewer(s): Matthias Koeppe
      d35315a1
    • Release Manager's avatar
      Trac #30155: Remove broken experimental package scons · e561663d
      Release Manager authored
      It is unused and not compatible with python3. It was made experimental
      in #28687.
      
      https://github.com/mkoeppe/sage/runs/876312062
      {{{
        [scons-1.2.0]   ****************************************************
        [scons-1.2.0]   Package 'scons' is currently not installed
        [scons-1.2.0]   No legacy uninstaller found for 'scons'; nothing to do
        [scons-1.2.0]     File "setup.py", line 336
        [scons-1.2.0]       mode = ((os.stat(file)[stat.ST_MODE]) | 0555) &
      07777
        [scons-1.2.0]                                                  ^
        [scons-1.2.0]   SyntaxError: invalid token
        [scons-1.2.0]   Error installing scons
      }}}
      
      URL: https://trac.sagemath.org/30155
      Reported by: mkoeppe
      Ticket author(s): Matthias Koeppe, John Palmieri
      Reviewer(s): Dima Pasechnik
      e561663d
    • Release Manager's avatar
      Trac #30149: Cygwin: problem with DLL search order when using system Python · a87c4b3c
      Release Manager authored
      I noticed a problem when trying to run the tests for the latest Sage,
      that the wrong version of `libR.dll` was being loaded, because I have R
      installed via Sage, but I also have the R package for Cygwin installed.
      
      My path starts with:
      
      {{{
      /home/embray/src/sagemath/sage/local/lib/R/lib:/home/embray/src/sagemath
      /sage/local/lib:/home/embray/src/sagemath/sage/build/bin:/home/embray/sr
      c/sagemath/sage/src/bin:/home/embray/src/sagemath/sage/local/bin:/usr/lo
      cal/bin:/usr/bin
      }}}
      
      so when importing `rpy2` it should link with the `libR.dll` that's in
      `$SAGE_LOCAL/lib/R/lib`.  Normally this has been the case.
      
      But when using the system Python this is not so.  This is because
      according to the standard [https://docs.microsoft.com/en-us/previous-
      versions/7d83bc18(v=vs.140)?redirectedfrom=MSDN DLL search path] the
      first place it looks is:
      
      > The directory where the executable module for the current process is
      located.
      
      Well, when running the system Python that's `/usr/bin` where
      `python3.7m.exe` lives.  However, that's also where the system's
      `libR.dll` lives.
      
      This is just an example, but it's a broader problem: For any DLL linked
      to by a compiled Python module, it will always privilege the one in
      `/usr/bin` over a copy provided by Sage.
      
      What we might have to do is, at least on Cygwin, when creating the venv
      it should actually copy the Python executable instead of just symlinking
      to it.  I believe venv has an option for this.
      
      URL: https://trac.sagemath.org/30149
      Reported by: embray
      Ticket author(s): Erik Bray
      Reviewer(s): Matthias Koeppe
      a87c4b3c
    • Release Manager's avatar
      Trac #30138: 1 internet doctest failing in oeis.py (cross_references) · f6e88bcc
      Release Manager authored
      with 9.2.beta5
      
      {{{
      sage -t --optional=sage,internet src/sage/databases/oeis.py
      }}}
      
      gives
      
      {{{
      **********************************************************************
      File "src/sage/databases/oeis.py", line 93, in sage.databases.oeis
      Failed example:
          p.cross_references(fetch=True)                # optional -- internet
      Expected:
          0: A000798: Number of different quasi-orders (or topologies, or
      transitive digraphs) with n labeled elements.
          1: A001035: Number of partially ordered sets ("posets") with n
      labeled elements (or labeled acyclic transitive digraphs).
          2: A001930: Number of topologies, or transitive digraphs with n
      unlabeled nodes.
          3: A006057: Number of topologies on n labeled points satisfying
      axioms T_0-T_4.
          4: A079263: Number of constrained mixed models with n factors.
          5: A079265: Number of antisymmetric transitive binary relations on n
      unlabeled points.
          6: A263859: Triangle read by rows: T(n,k) (n>=1, k>=0) is the number
      of posets with n elements and rank k (or depth k+1).
          7: A316978: Number of factorizations of n into factors > 1 with no
      equivalent primes.
          8: A319559: Number of non-isomorphic T_0 set systems of weight n.
          9: A326939: Number of T_0 sets of subsets of {1..n} that cover all n
      vertices.
          10: A326943: Number of T_0 sets of subsets of {1..n} that cover all
      n vertices and are closed under intersection.
          ...
      Got:
           0: A000798: Number of different quasi-orders (or topologies, or
      transitive digraphs) with n labeled elements.
           1: A001035: Number of partially ordered sets ("posets") with n
      labeled elements (or labeled acyclic transitive digraphs).
           2: A001930: Number of topologies, or transitive digraphs with n
      unlabeled nodes.
           3: A006057: Number of topologies on n labeled points satisfying
      axioms T_0-T_4.
           4: A079263: Number of constrained mixed models with n factors.
           5: A079265: Number of antisymmetric transitive binary relations on
      n unlabeled points.
           6: A263859: Triangle read by rows: T(n,k) (n>=1, k>=0) is the
      number of posets with n elements and rank k (or depth k+1).
           7: A000608: Number of connected partially ordered sets with n
      unlabeled elements.
           8: A316978: Number of factorizations of n into factors > 1 with no
      equivalent primes.
           9: A319559: Number of non-isomorphic T_0 set systems of weight n.
          10: A326939: Number of T_0 sets of subsets of {1..n} that cover all
      n vertices.
          11: A326943: Number of T_0 sets of subsets of {1..n} that cover all
      n vertices and are closed under intersection.
          12: A326944: Number of T_0 sets of subsets of {1..n} that cover all
      n vertices, contain {}, and are closed under intersection.
          13: A326947: BII-numbers of T_0 set-systems.
      **********************************************************************
      1 item had failures:
         1 of  26 in sage.databases.oeis
          5 webbrowser tests not run
          0 tests not run because we ran out of time
          [287 tests, 1 failure, 42.09 s]
      }}}
      
      URL: https://trac.sagemath.org/30138
      Reported by: slabbe
      Ticket author(s): Sébastien Labbé
      Reviewer(s): Frédéric Chapoton
      f6e88bcc
    • Release Manager's avatar
      Trac #30135: Use /bin/sh where possible for sage-* scripts · 97893277
      Release Manager authored
      Several scripts in src/bin execute with bash unnecessarily, for example:
      
      {{{
      $ cat src/bin/sage-python
      #!/usr/bin/env bash
      sage -python "$@"
      }}}
      
      That can be trivially changed to `/bin/sh` to speed up execution on
      systems where `/bin/sh` is a faster (non-bash) shell. Many other scripts
      in `src/bin` are similarly easy, as we have somehow avoided the bash
      test syntax in most places.
      
      URL: https://trac.sagemath.org/30135
      Reported by: mjo
      Ticket author(s): Michael Orlitzky
      Reviewer(s): Dima Pasechnik, Matthias Koeppe
      97893277
    • Release Manager's avatar
      Trac #30134: various fixes suggested by lgtm · 3f560fc5
      Release Manager authored
      mostly for variables that are not used before being re-defined
      
      URL: https://trac.sagemath.org/30134
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Travis Scrimshaw
      3f560fc5
    • Release Manager's avatar
      Trac #30132: Copy resolvelinks() function from ./src/bin/sage-env to ./sage · bbbd7a55
      Release Manager authored
      The `resolvelinks()` function in sage-env was recently updated, but a
      copy/pasted version is still present in the top-level sage script.
      
      Opening this now so I don't forget to update the version in `./sage`.
      
      URL: https://trac.sagemath.org/30132
      Reported by: mjo
      Ticket author(s): Michael Orlitzky
      Reviewer(s): Markus Wageringel
      bbbd7a55