#19552: images and preimages for projective subscheme
-------------------------------------+-------------------------------------
       Reporter:  bhutz              |        Owner:  bhutz
           Type:  enhancement        |       Status:  needs_work
       Priority:  minor              |    Milestone:  sage-6.10
      Component:  algebraic          |   Resolution:
  geometry                           |    Merged in:
       Keywords:  subscheme          |    Reviewers:  Vincent Delecroix
  iteration                          |  Work issues:
        Authors:  Ben Hutz           |       Commit:
Report Upstream:  N/A                |  45697b745f19b2387ed28afd7e787b84a4a238cb
         Branch:                     |     Stopgaps:
  u/bhutz/ticket/19552               |
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by vdelecroix):

 * status:  needs_review => needs_work


Comment:

 - In your first commit, you completely removed the file
 `schemes/generic/morphism.py`. Why is so?

 - test the error that are raised. And to fit with Python standards that
 was discussed on sage-devel, the error message should be lower case with
 no ponctuation at the end like the following
 {{{
 sage: [][1]
 Traceback (most recent call last):
 ...
 IndexError: list index out of range
 }}}

 - change `if (isinstance(N,(list,tuple)) == False)` to `if not
 isinstance(N, (list,tuple))`. Similarly, change `if normalize == True`
 with `if normalize`.

 - In
 {{{
 +        except TypeError:
 +            raise TypeError("Orbit bounds must be integers")
 }}}
    or
 {{{
 +        except TypeError:
 +            raise TypeError("Iterate number must be an integer")
 }}}
    there is no need to catch a `TypeError` to raise a `TypeError`.

 - Why are you using a copy of `self` in `orbit`?

 - `a proejctive subscheme` -> `projective`. Moreover the output is
 '''not''' a projective subscheme but a list!

 - What is this line in the documentation of `orbit`
 {{{
 Perform the checks on subscheme initialization if ``check=True``
 }}}

 - The mention to `self` in the documentation should be avoided as much as
 possible. You can replace by `this scheme`.

 - You can simplify a bit the following in `nth_iterate`
 {{{
 +        if n == 0:
 +            return(self)
 +        else:
 +            Q = f(self)
 +            for i in range(2,n+1):
 +                Q = f(Q)
 +            return(Q)
 }}}
   with
 {{{
 Q = self
 for i in range(n):
     Q = f(Q)
 return Q
 }}}

 - to make a list of zeros use `[0] * n` instead of `[0 for _ in
 range(n)]`.

 - In `preimage` you wrote `return the subscheme` why is this unique? why
 it does exist? The following looks fishy
 {{{
 sage: PS.<x,y,z> = ProjectiveSpace(ZZ, 2)
 sage: H = End(PS)
 sage: f = H([x^2, x^2, x^2])
 sage: X = PS.subscheme([x-y])
 sage: X.preimage(f)
 Closed subscheme of Projective Space of dimension 2 over Integer Ring
 defined by:
   0
 sage: f(X.preimage(f))
 Closed subscheme of Projective Space of dimension 2 over Integer Ring
 defined by:
   y - z,
   x - z
 }}}

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