#11490: Add a thematic tutorial on coercion and categories
---------------------------------------------------------+------------------
Reporter: SimonKing | Owner:
mvngu
Type: enhancement | Status:
needs_review
Priority: major | Milestone:
sage-5.7
Component: documentation | Resolution:
Keywords: categories coercion thematic tutorial | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Simon King | Merged in:
Dependencies: #14084 | Stopgaps:
---------------------------------------------------------+------------------
Comment (by SimonKing):
Replying to [comment:9 vdelecroix]:
> * you may write "and" or "respectively" instead of "resp." (line 34)
OK.
> * at lines 195-198 there is a kind of magic to test the pickling. You
shoud add few words to explain what's happening.
Well, in the lines in front of it, I write
{{{
However, for
making the example work in the Sage's doctesting framework, we need to
declare our class as an attribute of the ``__main__`` module.
}}}
I thought this is an explanation? Technically, the doctest framework finds
that the classes are defined in the module `__main__`, but apparently (for
a reason that is not clear to me) it can not find it in
`__main__`---although this perfectly works in an interactive session.
Similar case is around line 1433 and 1572.
> * I do not like the `class MyFrac(MyFrac)` at lines 462, 812, 882 (but
do not have better option)
The didactic idea is that it is more easy to understand what is happening,
when only small changes are made. Hence, I certainly would not like to
repeatedly give a full definition of `MyFrac`, each time changing or
adding a small detail, because the reader would then be more likely to
lose track.
> * I would like to know why test at line 494 fails while I was able to
add some elements at line 294
At this point, we ''can'' add elements (visible in line 294), but
`P.zero_element()` does not work yet, because this tries to return `P(0)`,
but conversion is not available at this point.
Shall I add the explanation at line 494, or better at line 539, when I
made the summation work?
> * line 678: write "P1 == P2" instead of "P1==P2" (ie add whitespaces on
both sides of "==")
OK.
> * I do not like your example at line 687 because of
> {{{
> sage: P1 = QQ['v,w']; P2 = ZZ['w,v']
> sage: v1 = P1('v'); w1 = P1('w')
> sage: v2 = P2('v'); w2 = P2('w')
> sage: (v1 + w2).parent() is P1
> True
> sage: (v2 + w1).parent() is P1
> True
> }}}
> In other words, P1 is prefered to P2 ! Why is the reason ?
There is a coercion from P2 to P1, but not from P1 to P2 (note the
different base rings).
> I expected that are natural coercions in both directions then the parent
of elements `a+b` is determined by the parent of `a`.
That's correct, but there is no bi-directional coercion here.
OK, I'll post an update a bit later.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11490#comment:10>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.