On 19 December 2012 23:16, Charles Bouillaguet
<charles.bouillag...@gmail.com> wrote:
> On Dec 19, 2012, at 12:44 PM, John Cremona wrote:
>
>
> ---
> Charles Bouillaguet
> http://www.lifl.fr/~bouillaguet/
>
>
>
>> I suggest adding to the documentation of A.coordinates() that it works
>> also if the given element is in the ambient space, with an example of
>> that.  In concrete terms you need the element to be an F-linear
>> combination of the generators where F is the fraction field of the
>> base ring R, and not just an R-linear combination.
>>
>> This functionality is useful (I have used it in some number field
>> functions) and I would not want it removed.
>
> Well, you could always access it through:
>
> R.ambient_vector_space().coordinates( x )

That is a good point.  THere may be a few places elsewhere in the Sage
library where this change would have to be made (not too  many, I
hope), and in those places one could argue that the code would be
clearer anyway, after this change.

>
> One problem I can see is "what to do when the ambient vector space is not 
> defined?" (this happens when the ring is not a PID, because then its fraction 
> field is not defined). Examples include:
>
> sage: R.<x,y> = QQ[]
> sage: I = (x*y) * R
> sage: Q = R.quotient( I )
> sage: M = Q^3
> sage: M.ambient_vector_space() # BOOM
>

OK, so in such a case there would still be no problem asking for the
coordinates of an element of M itself.  Which in such a simple example
is almost a tautology: the most common use case (that I can think of)
is when you have a free submodule N of such an M, and an element of M
which happens to lie in N, and you want its coordinates w.r.t. N.  (I
use this all the time for vector spaces, but the principle is the
same).

> This is now : http://trac.sagemath.org/sage_trac/ticket/13853

Noted.  One further point: why is ArithmeticError the right exception
to raise?  I would have expected ValueError.

John

> ---
> Charles Bouillaguet
> http://www.lifl.fr/~bouillaguet/
>
>
>> John
>>
>>
>>> ---
>>> Charles Bouillaguet
>>> http://www.lifl.fr/~bouillaguet/
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "sage-devel" group.
>>> To post to this group, send email to sage-devel@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> sage-devel+unsubscr...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To post to this group, send email to sage-devel@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> sage-devel+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To post to this group, send email to sage-devel@googlegroups.com.
> To unsubscribe from this group, send email to 
> sage-devel+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to