Dear Sage developers,

consider the following example:

R.<a,b> = GF(5)[]
Q = R.fraction_field()
S.<X,Y> = Q[]
f = 2*R.gen(0)*X*Y^2
w1 = f.coefficient({X:1, Y:2})
w2 = f[1,2]
w3 = f.coefficients()[0]

I would expect w1, w2 and w3 all to be the same thing. However, the 
coercions R(w2) and R(w3) work fine, while R(w1) raises an error.
Trying to trace what's wrong, I see that the parent of w1 is S, rather than 
Q. While that is what the doc of .coefficient tells, is there any *sane* 
reason why the parent of a coefficient isn't the field (or ring) of 
coefficients? It seems to me that extracting the coefficient via f[1,2] is 
not documented, so I'm a little hesitant to use this as a work around for 
the strange behavior of f.coefficient({X:1, Y:2}).

Talking of documentation: the tab completion offers for f and R the method 
.base_extend. While I have no idea what that should mean for f (and 
f.base_extend? tells nothing), I do have an idea what it could be for R. 
Well, the whole entry of R.base_extend? is the truly useless info

   EXAMPLES:

      sage: QQ.base_extend(GF(7))
      Traceback (most recent call last):
      ...
      TypeError: no base extension defined
      sage: ZZ.base_extend(GF(7))
      Finite Field of size 7

without telling what the method is supposed to be. Trying 
R.base_extend(GF(25,"dummy")) raises an error, so it doesn't seem to be a 
base ring extension. Also, for some time I believed that it is not possible 
to change the term order of a polynomial ring, until I learned (from a 
recent answer in this forum) that, despite its misleading name, 
.change_ring does that. I believe that a major weakness of the sage 
documentation is that there are no ``see also''s at the end of a doc entry. 
For instance, R.term_order? should point to R.change_ring. 

-- Peter Mueller

P.S.:  I'm sad to say that while I'm using Sage quite a bit, the lousy 
documentation and numerous inconsistencies (like permutation group actions, 
with left notation for right action!!!) prevents me and many colleagues 
from using Sage in teaching.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to