#19083: AsymptoticRing: exp & log, cleanup, some improvements, documentation
-------------------------------------+-------------------------------------
       Reporter:  dkrenn             |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.10
      Component:  asymptotic         |   Resolution:
  expansions                         |    Merged in:
       Keywords:                     |    Reviewers:  Daniel Krenn, Clemens
        Authors:  Benjamin Hackl,    |  Heuberger
  Daniel Krenn                       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  e8ad893715b0dfc8a3907a05382b0c1cba57b818
  u/dkrenn/asy/prototype             |     Stopgaps:
   Dependencies:  #19073             |
-------------------------------------+-------------------------------------
Changes (by dkrenn):

 * commit:  2c60570eb1755791db1a82aa3e3ab70ddbb505c0 =>
     e8ad893715b0dfc8a3907a05382b0c1cba57b818


Comment:

 Replying to [comment:60 cheuberg]:
 > 1. `misc.split_str_by_op`:
 >       - parameter `op`: is special treatment of `^^` worthwhile when `op
 ='^'` or is that a special case for `*`?

 The motivation comes, of course, from `*` and `**`. Since `^^` is not one
 of Python's operators, it should not be interpreted as twice `^`. Thus, I
 think this should be as it is.

 >       - parameter `strip_parentheses` not tested
 >       - document and test `op is None`. This is used in
 `growth_group.Variable.__init__`

 Added.

 > 2. `misc.repr_op`: what about `-` and `/`? Why don't they also induce
 parentheses?
 > {{{
 > sage: from sage.rings.asymptotic.misc import repr_op
 > sage: repr_op('a-b', '^', 'c')
 > 'a-b^c'
 > sage: repr_op('a+b', '^', 'c')
 > '(a+b)^c'
 > }}}

 Now included as well.

 > 4. `growth_group.log`:
 >       - see comments on `growth_group.is_lt_one`.

 Done.

 >       - error "results in a sum" is not tested.

 Added.

 > 5. `growth_group.log_factor`:
 >       - why `from growth_group import GenericGrowthGroup`?

 Removed.

 >       - see comments on `growth_group.is_lt_one`

 Done.

 > 6. `GenericGrowthElement.__ne__`: is the "Note" box actually needed?

 Not really; deleted.

 > 7. `GenericGrowthElement._rpow_element_`:
 >       - when is the output `None`?

 Removed output `None`.

 >       - I do not understand "it lives (in contrast to rpow) in its own
 group".

 Rewritten.

 > 8. `GenericGrowthGroup._create_element_via_parent_`: I do not understand
 the explanation.

 Rewritten.

 > Is "via" a good part of the name of the method?

 Renamed to `_create_element_in_extension_`.

 > 9. `GenericGrowthGroup.gens`:
 >       - why "monomial" growth group in the generic group?
 >       - why `MonomialGrowthElement`?

 Cut and paste problem; changed.

 > 10. `MonomialGrowthElement.__pow__`: Is the following intentional:
 > {{{
 > sage: P = GrowthGroup('x^ZZ')
 > sage: x = P.gen()
 > sage: a = x^7; a
 > x^7
 > sage: a^(1/7)
 > x
 > sage: (a^(1/7)).parent()
 > Growth Group x^QQ
 > }}}
 >     I understand that `((1/7)*7).parent()` is `QQ`, but in that case,
 the user explicitly left the integers. It is not clear to me whether this
 is also the case here.

 `(a^7)^(1/7)` is calculated as `a^(7*(1/7))`, thus the same phenomenon as
 with `((1/7)*7).parent()` appears.

 > 11. `MonomialGrowthElement._log_factor_`:
 >       - The parameter `base` is ignored in the second `if`:
 > {{{
 > sage: G = GrowthGroup('exp(x)^ZZ*x^ZZ')
 > sage: e1 = G('exp(x)'); e1
 > exp(x)
 > sage: log(e1, base=2)
 > x

 Corrected.

 > }}}
 >       - In some cases, computation fails although it would be feasible:
 > {{{
 > sage: G = GrowthGroup('(e^x)^ZZ*x^ZZ')
 > sage: e1 = G('e^x'); e1
 > e^x
 > sage: var('e')
 > sage: log(e1^2, base=e^2)
 > Traceback (most recent call last):
 > ...
 > ArithmeticError: Cannot build log((e^x)^2) since log(e^x) is not in
 Growth Group (e^x)^ZZ * x^ZZ.
 > }}}

 This is now #19420.

 > 12. `MonomialGrowthElement._rpow_element_`:
 >       - I do not understand "it lives (in contrast to rpow()) in its own
 group."

 Changed.

 >       - Parameter `base` is not tested (with an actual result).

 Doctest added.

 >       - The documentation does not explain why `2^x` is illegal here (it
 seems that this method operates only if the result can be a monomial
 growth group element, not necessarily in the same growth group as `self`).

 Example explained.

 > 13. `ExponentialGrowthElement._repr_`: what is the motivation behind
 checking for `-/^`? This leads to the following (perhaps stupid) example:
 > {{{
 > sage: from sage.rings.asymptotic.growth_group import
 ExponentialGrowthGroup
 > sage: G = ExponentialGrowthGroup(ZZ['x'], 'y'); G
 > Growth Group ZZ[x]^y
 > sage: G('(1-x)^y')
 > (-x + 1)^y
 > sage: G('(1+x)^y')
 > x + 1^y
 > }}}

 Seems to be code from before `repr_op` and then just inserting it. Now
 rewritten.

 > 14. `GrowthGroupFactory`: the documentation sounds like
 `ignore_variables=('e',)` would only be set when no keywords are given.
 However, this applies even if only `ignore_variables` is not set.

 Rewritten.

 ----
 Last 10 new commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=0ca6efda638f8a5819577629d3c360fcfd4a2f3c
 0ca6efd]||{{{Trac #19094/#19083 comment 60, 11: correct wrong log and give
 log in errors a base}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=71802dac512847136a46cf7a0f261e4240d44589
 71802da]||{{{Trac #19094/#19083 comment 60, 8: rename to
 _create_element_in_extension_}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=e2285e7012435f27c5ed0d2dfab34db255912244
 e2285e7]||{{{Trac #19094/#19083 comment 60, 8: rewrite description of
 _create_element_in_extension_}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=4cb775fbe20b1e44f5db2bef973f1763c80c6e35
 4cb775f]||{{{Trac #19094/#19083 comment 60, 12: add doctest in
 _rpow_element to test parameter base}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=51f796c2470150834d6949e408e257469f18afbd
 51f796c]||{{{Trac #19094/#19083 comment 60, 12: document _rpow_element
 2^x}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=2f110dbcba55c31032663e2b66a3d118abed3226
 2f110db]||{{{Trac #19094/#19083 comment 60, 13: simplify
 ExponentialGrowthElement._repr_}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=4c49d029e7a7998190c8d0c7409ebec79ece56af
 4c49d02]||{{{Trac #19094/#19083 comment 60, 14: rewrite keyword arguments
 documentation of GrowthGroupFactory}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=d2cc73a4aa79c5d27b888502026b44f90e751755
 d2cc73a]||{{{add forgotten "EXAMPLES::" line}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=498dbad4ca50f6b4f6b87e2cd8d85543253c2f09
 498dbad]||{{{Trac #19094/#19083 comment 60, 15: add a doctest to
 GenericProduct._create_element_via_parent_}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=e8ad893715b0dfc8a3907a05382b0c1cba57b818
 e8ad893]||{{{Trac #19094/#19083 comment 60, 16: delte misplaced statement
 in docstring}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/19083#comment:69>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to