#18242: Added algorithm computing special resultants
-------------------------------------+-------------------------------------
       Reporter:  pernici            |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  major              |    Milestone:  sage-6.7
      Component:  number fields      |   Resolution:
       Keywords:  qqbar resultant    |    Merged in:
  exactify minpoly                   |    Reviewers:
        Authors:                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  e0626dcabde6434cedd0c8736df198065b7a01d6
  u/pernici/ticket/18242             |     Stopgaps:
   Dependencies:  #17886             |
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Hello,

 This ticket is still in state "new" but here are some remarks.

 I would make this ticket independent of #17886 and ignore completely the
 potential application to `QQbar` (considering it in another ticket). It
 would be more flexible that way.

 You implemented functions but I guess some of them would better be methods
 over polynomials (that is methods of
 `polynomial.polynomial_element.Polynomial`). For example, the
 `hadamard_product` or even the `composed_sum`. So move them. For
 `_hadamard_exp` it is only well defined in zero characteristic, so I am
 not sure what is the most appropriate; what do you think?

 Did you do some serious benchmark to see which methods is faster depending
 on `p1` and `p2`? I guess it might aslo depends on the sparseness of the
 polynomials, the size of the coefficients.

 1. `newton_sum`

  - I would rather add the power series ring object `R` as an argument.
 Building a ring is always costly.

  - In
 {{{
 p2 = R(QQ(1)/p1)
 }}}
   You would better do
 {{{
 p2 = ~R(p1)
 }}}
   you would avoid computing `1/p1` in the fraction field.

   - It would be faster to return `p3.truncate()` or `res.truncate()`
 instead of adding a truncation argument

   - the argument name `typ` is horrible. Be more explicit about what it
 is. "a related expression" is not an explanation of the output!

 2. In `hadamard_product` there is no need to build the list of
 coefficients. You can access the coefficients of a polynomial `p` through
 `p[i]`. So just do
 {{{
 def hadamard_product(p1, p2):
     R = p1.parent()
     return R([p1[i]*p2[i] for i in range(min(p1.degree(),
 p2.degree())+1)])
 }}}
    (I recall that this function must move as a method of univariate
 polynomials)

 3. `composed_product`

   - you duplicated the code for `BFSS`... moreover if the argument
 `algorithm` is neither `"resultant"` nor `"BFSS"` an error should be
 raised.

   - I guess that the resultant method works in any characteristic?

 Sided note: the Bostan-Flajolet-Salvy-Schost deals with any
 characteristic. So it would be interesting to have a more general
 implementation.

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/18242#comment:11>
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