Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19399 closed defect (fixed)

let category of growth group be determined by input

Reported by: dkrenn Owned by:
Priority: major Milestone: sage-6.10
Component: asymptotic expansions Keywords:
Cc: behackl, cheuberg Merged in:
Authors: Daniel Krenn Reviewers: Clemens Heuberger
Report Upstream: N/A Work issues:
Branch: 4626cc1 (Commits) Commit:
Dependencies: #19083 Stopgaps:

Description

At the moment, the category of a growth group is always the join of monoids and posets (except if explicitly specified). In many/typical cases this is a group (depends on the input). This aim of this ticket is to change this behavior.

Change History (21)

comment:1 Changed 4 years ago by dkrenn

  • Branch set to u/dkrenn/t/19399

comment:2 Changed 4 years ago by dkrenn

  • Commit set to 9293e442d18eaf107423830579cbf7a761ccd00d

Code is written, but there is a problem with the coercion framework... (I will fix this later...)


Last 10 new commits:

1583ffcTrac #19073: Reword and add doctest for _pushout_
8a32f1fcorrect PEP8-spacings in doctest
05862f4Merge branch 't/19073/asy/groups-coercion' into t/19094/asy/ring-exp-log
b160261forgotten changes of last merge
d0c0f15Merge branch 't/19094/asy/ring-exp-log' into t/19083/asy/prototype
a39204cchanges part 2 (of 2) after comments of cheuberg
6aa870dtypo in doc
40fa7f9new method to determine category
df32478correct _coerce_map_from_
9293e44add more output to a failing doctest

comment:3 Changed 4 years ago by dkrenn

  • Dependencies set to #19083

comment:4 Changed 4 years ago by git

  • Commit changed from 9293e442d18eaf107423830579cbf7a761ccd00d to 256ef2dcb14cb2feb7739ed5e234a67c985e3d32

Branch pushed to git repo; I updated commit sha1. New commits:

2be05a1let underlying_class deal with non-parent input
9f20c58use underlying_class instead of type
abd5619restructure conversion of elements in ExponentialGrowthGroup to deal with 1 correctly
1703ce8rewrite element constructor of growth groups to deal with different base rings
27e30cfsimplify one test in the element constructor
256ef2dmark a doctest as not tested and refer to follow up ticket #19411

comment:5 Changed 4 years ago by git

  • Commit changed from 256ef2dcb14cb2feb7739ed5e234a67c985e3d32 to 8840f1e106ddc4332316fc1a79ca667e16f14a54

Branch pushed to git repo; I updated commit sha1. New commits:

1eb79b2cleanup (delete forgotten lines)
5c48072use category of commutative groups
8840f1emark doctests as indirect

comment:6 Changed 4 years ago by dkrenn

  • Authors set to Daniel Krenn
  • Status changed from new to needs_review

comment:7 Changed 4 years ago by cheuberg

  • Branch changed from u/dkrenn/t/19399 to u/cheuberg/t/19399

comment:8 follow-ups: Changed 4 years ago by cheuberg

  • Commit changed from 8840f1e106ddc4332316fc1a79ca667e16f14a54 to 7338a050ea9f7c901bcf293afb6e2a033bf608e6
  • Reviewers set to Clemens Heuberger
  • Status changed from needs_review to needs_info

I added a rather stupid doctest: x^W where W = Words([0, 1]). The resulting growth group turns out to be a monoid; however, W itself is not a monoid. (As a side note, even finite words are not declared to be a monoid). I am not sure whether we should check that.

Apart from that: Shouldn't we check for commutativity of the base and return Monoids().Commutative() instead?

The rest seems to be fine; I do not understand why there was a failure on a patchbot.


New commits:

7338a05Trac #19399: Add doctest

comment:9 in reply to: ↑ 8 ; follow-up: Changed 4 years ago by cheuberg

  • Status changed from needs_info to needs_work

Replying to cheuberg:

I do not understand why there was a failure on a patchbot.

Sorry, I can now reproduce the failure:

sage -t --long src/sage/rings/asymptotic/growth_group.py
**********************************************************************
File "src/sage/rings/asymptotic/growth_group.py", line 3649, in sage.rings.asymptotic.growth_group.GrowthGroupFactory
Failed example:
    TestSuite(GrowthGroup('x^ZZ')).run(verbose=True)  # long time
Expected:
    running ._test_an_element() . . . pass
    running ._test_associativity() . . . pass
    running ._test_cardinality() . . . pass
    running ._test_category() . . . pass
    running ._test_elements() . . .
      Running the test suite of self.an_element()
      running ._test_category() . . . pass
      running ._test_eq() . . . pass
      running ._test_not_implemented_methods() . . . pass
      running ._test_pickling() . . . pass
      pass
    running ._test_elements_eq_reflexive() . . . pass
    running ._test_elements_eq_symmetric() . . . pass
    running ._test_elements_eq_transitive() . . . pass
    running ._test_elements_neq() . . . pass
    running ._test_eq() . . . pass
    running ._test_not_implemented_methods() . . . pass
    running ._test_one() . . . pass
    running ._test_pickling() . . . pass
    running ._test_prod() . . . pass
    running ._test_some_elements() . . . pass
Got:
    running ._test_an_element() . . . pass
    running ._test_associativity() . . . pass
    running ._test_cardinality() . . . pass
    running ._test_category() . . . pass
    running ._test_elements() . . .
      Running the test suite of self.an_element()
      running ._test_category() . . . pass
      running ._test_eq() . . . pass
      running ._test_not_implemented_methods() . . . pass
      running ._test_pickling() . . . pass
      pass
    running ._test_elements_eq_reflexive() . . . pass
    running ._test_elements_eq_symmetric() . . . pass
    running ._test_elements_eq_transitive() . . . pass
    running ._test_elements_neq() . . . pass
    running ._test_eq() . . . pass
    running ._test_inverse() . . . pass
    running ._test_not_implemented_methods() . . . pass
    running ._test_one() . . . pass
    running ._test_pickling() . . . pass
    running ._test_prod() . . . pass
    running ._test_some_elements() . . . pass
**********************************************************************
File "src/sage/rings/asymptotic/growth_group.py", line 3674, in sage.rings.asymptotic.growth_group.GrowthGroupFactory
Failed example:
    TestSuite(GrowthGroup('QQ^y')).run(verbose=True)  # long time
Expected:
    running ._test_an_element() . . . pass
    running ._test_associativity() . . . pass
    running ._test_cardinality() . . . pass
    running ._test_category() . . . pass
    running ._test_elements() . . .
      Running the test suite of self.an_element()
      running ._test_category() . . . pass
      running ._test_eq() . . . pass
      running ._test_not_implemented_methods() . . . pass
      running ._test_pickling() . . . pass
      pass
    running ._test_elements_eq_reflexive() . . . pass
    running ._test_elements_eq_symmetric() . . . pass
    running ._test_elements_eq_transitive() . . . pass
    running ._test_elements_neq() . . . pass
    running ._test_eq() . . . pass
    running ._test_not_implemented_methods() . . . pass
    running ._test_one() . . . pass
    running ._test_pickling() . . . pass
    running ._test_prod() . . . pass
    running ._test_some_elements() . . . pass
Got:
    running ._test_an_element() . . . pass
    running ._test_associativity() . . . pass
    running ._test_cardinality() . . . pass
    running ._test_category() . . . pass
    running ._test_elements() . . .
      Running the test suite of self.an_element()
      running ._test_category() . . . pass
      running ._test_eq() . . . pass
      running ._test_not_implemented_methods() . . . pass
      running ._test_pickling() . . . pass
      pass
    running ._test_elements_eq_reflexive() . . . pass
    running ._test_elements_eq_symmetric() . . . pass
    running ._test_elements_eq_transitive() . . . pass
    running ._test_elements_neq() . . . pass
    running ._test_eq() . . . pass
    running ._test_inverse() . . . fail
    Traceback (most recent call last):
      File "/local/sage/sage-6.9.rc0/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 283, in run
        test_method(tester = tester)
      File "/local/sage/sage-6.9.rc0/local/lib/python2.7/site-packages/sage/categories/groups.py", line 150, in _test_inverse
        tester.assertEquals(x * ~x, self.one())
      File "/local/sage/sage-6.9.rc0/local/lib/python2.7/site-packages/sage/rings/asymptotic/growth_group.py", line 3151, in __invert__
        return self.parent()._create_element_via_parent_(1 / self.base)
      File "sage/structure/element.pyx", line 1988, in sage.structure.element.RingElement.__div__ (/local/sage/sage-6.9.rc0/src/build/cythonized/sage/structure/element.c:18129)
        return coercion_model.bin_op(self, right, div)
      File "sage/structure/coerce.pyx", line 1018, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (/local/sage/sage-6.9.rc0/src/build/cythonized/sage/structure/coerce.c:8689)
        return PyObject_CallObject(op, xy)
      File "sage/structure/element.pyx", line 1987, in sage.structure.element.RingElement.__div__ (/local/sage/sage-6.9.rc0/src/build/cythonized/sage/structure/element.c:18104)
        return (<RingElement>self)._div_(<RingElement>right)
      File "sage/rings/rational.pyx", line 2147, in sage.rings.rational.Rational._div_ (/local/sage/sage-6.9.rc0/src/build/cythonized/sage/rings/rational.c:19787)
        raise ZeroDivisionError('rational division by zero')
    ZeroDivisionError: rational division by zero
    ------------------------------------------------------------
    running ._test_not_implemented_methods() . . . pass
    running ._test_one() . . . pass
    running ._test_pickling() . . . pass
    running ._test_prod() . . . pass
    running ._test_some_elements() . . . pass
    The following tests failed: _test_inverse
**********************************************************************
File "src/sage/rings/asymptotic/growth_group.py", line 3699, in sage.rings.asymptotic.growth_group.GrowthGroupFactory
Failed example:
    TestSuite(GrowthGroup('x^QQ * log(x)^ZZ')).run(verbose=True)  # long time
Expected:
    running ._test_an_element() . . . pass
    running ._test_associativity() . . . pass
    running ._test_cardinality() . . . pass
    running ._test_category() . . . pass
    running ._test_elements() . . .
      Running the test suite of self.an_element()
      running ._test_category() . . . pass
      running ._test_eq() . . . pass
      running ._test_not_implemented_methods() . . . pass
      running ._test_pickling() . . . pass
      pass
    running ._test_elements_eq_reflexive() . . . pass
    running ._test_elements_eq_symmetric() . . . pass
    running ._test_elements_eq_transitive() . . . pass
    running ._test_elements_neq() . . . pass
    running ._test_eq() . . . pass
    running ._test_not_implemented_methods() . . . pass
    running ._test_one() . . . pass
    running ._test_pickling() . . . pass
    running ._test_prod() . . . pass
    running ._test_some_elements() . . . pass
Got:
    running ._test_an_element() . . . pass
    running ._test_associativity() . . . pass
    running ._test_cardinality() . . . pass
    running ._test_category() . . . pass
    running ._test_elements() . . .
      Running the test suite of self.an_element()
      running ._test_category() . . . pass
      running ._test_eq() . . . pass
      running ._test_not_implemented_methods() . . . pass
      running ._test_pickling() . . . pass
      pass
    running ._test_elements_eq_reflexive() . . . pass
    running ._test_elements_eq_symmetric() . . . pass
    running ._test_elements_eq_transitive() . . . pass
    running ._test_elements_neq() . . . pass
    running ._test_eq() . . . pass
    running ._test_inverse() . . . pass
    running ._test_not_implemented_methods() . . . pass
    running ._test_one() . . . pass
    running ._test_pickling() . . . pass
    running ._test_prod() . . . pass
    running ._test_some_elements() . . . pass
**********************************************************************
1 item had failures:
   3 of  19 in sage.rings.asymptotic.growth_group.GrowthGroupFactory
    1 test skipped
    [615 tests, 3 failures, 9.96 s]

comment:10 Changed 4 years ago by dkrenn

  • Branch changed from u/cheuberg/t/19399 to u/dkrenn/t/19399

comment:11 Changed 4 years ago by git

  • Commit changed from 7338a050ea9f7c901bcf293afb6e2a033bf608e6 to 3dc986d64c61aca5c1ed3562ae9125012e811e57

Branch pushed to git repo; I updated commit sha1. New commits:

09eeb38implement some_elements of exponential growth group
3d3c96afix doctests: inverse is now tested
3dc986dfix doctest some_elements in cartesian product

comment:12 in reply to: ↑ 8 Changed 4 years ago by dkrenn

I've completly rewritten the determining of the categories. Needs review.

Replying to cheuberg:

I added a rather stupid doctest: x^W where W = Words([0, 1]). The resulting growth group turns out to be a monoid; however, W itself is not a monoid. (As a side note, even finite words are not declared to be a monoid). I am not sure whether we should check that.

Is now checked.

Apart from that: Shouldn't we check for commutativity of the base and return Monoids().Commutative() instead?

Is now checked as well.

comment:13 in reply to: ↑ 9 Changed 4 years ago by dkrenn

  • Status changed from needs_work to needs_review

Replying to cheuberg:

Replying to cheuberg:

I do not understand why there was a failure on a patchbot.

Sorry, I can now reproduce the failure: [...]

Fixed.

comment:14 Changed 4 years ago by cheuberg

  • Branch changed from u/dkrenn/t/19399 to u/cheuberg/t/19399

comment:15 follow-ups: Changed 4 years ago by cheuberg

  • Commit changed from 3dc986d64c61aca5c1ed3562ae9125012e811e57 to 997380baa67cc3d7fda5e9791c29d58f3ff15515
  • Status changed from needs_review to needs_work

I added one reviewer commits and have two more remarks.

  1. sage.rings.asymptotic.misc.transform_category: document parameter initial_category
  2. GenericGrowthElement.__classcall__: does it make sense to promote polynomials to Posets? How is the partial order defined on polynomials?

New commits:

997380bTrac #19399: Insert ReSt links

comment:16 Changed 4 years ago by dkrenn

  • Branch changed from u/cheuberg/t/19399 to u/dkrenn/t/19399

comment:17 in reply to: ↑ 15 Changed 4 years ago by dkrenn

  • Commit changed from 997380baa67cc3d7fda5e9791c29d58f3ff15515 to 4626cc13efc233cd0545b253815babbf3df5ecec

Replying to cheuberg:

I added one reviewer commits and have two more remarks.

Cross-reviewed.

  1. sage.rings.asymptotic.misc.transform_category: document parameter initial_category

Documented.

  1. GenericGrowthElement.__classcall__: does it make sense to promote polynomials to Posets? How is the partial order defined on polynomials?

The default order is degrevlex, see http://doc.sagemath.org/html/en/reference/polynomial_rings/sage/rings/polynomial/polynomial_ring_constructor.html#sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing

Thus, polynomial rings should be posets as well.


New commits:

4626cc1document initial_category

comment:18 Changed 4 years ago by dkrenn

  • Status changed from needs_work to needs_review

comment:19 Changed 4 years ago by cheuberg

  • Status changed from needs_review to positive_review

Merges cleanly with 6.10.beta1 (despite failure of trac's automerging); doctests pass; documentation builds.

comment:20 Changed 4 years ago by vbraun

  • Branch changed from u/dkrenn/t/19399 to 4626cc13efc233cd0545b253815babbf3df5ecec
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:21 in reply to: ↑ 15 Changed 4 years ago by cheuberg

  • Commit 4626cc13efc233cd0545b253815babbf3df5ecec deleted

Replying to cheuberg:

I added one reviewer commits and have two more remarks.

997380bTrac #19399: Insert ReSt links

This commit was lost and is not contained in the version of this ticket which finally got merged. As #19400 deals with documentation of asymptotic expansions anyway, the lost commit could be merged in that ticket instead of opening a new trivial ticket.

Note: See TracTickets for help on using tickets.