#15392: Implement minimal model algorithm
--------------------------------------+----------------------------
       Reporter:  bhutz               |        Owner:  bhutz
           Type:  enhancement         |       Status:  needs_review
       Priority:  major               |    Milestone:  sage-5.13
      Component:  algebraic geometry  |   Resolution:
       Keywords:  sage-days55         |    Merged in:
        Authors:  bhutz               |    Reviewers:
Report Upstream:  N/A                 |  Work issues:
         Branch:                      |       Commit:
   Dependencies:                      |     Stopgaps:
--------------------------------------+----------------------------

Comment (by nbruin):

 I'm just parking some test code here for my own use:
 {{{
 import urllib

 Qx.<x>=QQ[]
 def interpolate(c,n):
    M=matrix([[c[i]^k for k in range(n+1)]+[-c[i+1]*c[i]^k for k in
 range(n+1)] for i in range(len(c)-1)])
    v=list(M.right_kernel().basis()[0])
    return Qx(v[:n+1])/Qx(v[n+1:])

 V=[eval(c) for c in
 urllib.urlopen("http://www.cecm.sfu.ca/~nbruin/intorbits/deg2.txt";)]

 P1.<X,Y>=ProjectiveSpace(QQ,1)
 def proj_map(f):
     phi=f(X/Y)
     return End(P1)([phi.numerator(),phi.denominator()])

 [proj_map(interpolate(c,2)((x+1)/(x-1))).is_minimal_model() for c in
 V[:50]]
 }}}
 I'm noticing it's awfully slow! I think I tried a similar thing with the
 magma version and that was quite quick. Initial impression is that this is
 just a sage problem:
 {{{
    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       110    0.033    0.000    0.073    0.001 minimal_model.py:41(bCheck)
 1847/1843    0.026    0.000    0.031    0.000
 polynomial_ring.py:299(_element_constructor_)
     26/22    0.022    0.001    0.062    0.003 minimal_model.py:122(blift)
       264    0.015    0.000    0.020    0.000 {method 'subs' of
 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'
 objects}
      2097    0.011    0.000    0.015    0.000 {method 'sub' of
 '_sre.SRE_Pattern' objects}
       943    0.010    0.000    0.033    0.000
 polynomial_ring_constructor.py:60(PolynomialRing)
         3    0.008    0.003    0.169    0.056 minimal_model.py:302(Min)
     19104    0.006    0.000    0.006    0.000 {isinstance}
      2157    0.004    0.000    0.005    0.000 re.py:226(_compile)
 }}}
 so it looks like just constructing the polynomials is an expensive
 proposition already. `bCheck` does take quite a bit of time by itself too,
 so there may be some algorithmic issues too. Perhaps we don't care about
 performance at this point?

 (Ah, I see: there are lots of polynomial rings constructed *inside*
 functions. That shouldn't happen)

 Some possible packaging problems:
  - I think the file name `sage/schemes/projective/minimal_model.py` will
 cause problems later on: there are all kinds of projective schemes that
 have their own concept of minimality, so I think it should be
 `endP1_minimal_model` or something more appetizing.
  - `phi.is_minimal_model` reads a little strange: `phi` is supposed to be
 an endomorphism on a `P1` (with coordinate choice, i.e., with `0,1,infty`
 marked), not a model of one. Would is_PGL_minimal be better (or perhaps
 is_minimal)?

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

Reply via email to