On Jan 27, 2009, at 12:54 AM, William Stein wrote:

>
> On Tue, Jan 27, 2009 at 12:45 AM, alia hamieh  
> <[email protected]> wrote:
>> I'm trying to deal with following problem:
>>
>> G=DirichletGroup(75)
>> chi = list(G)[8]
>> I need to compute with expressions such as: chi(2)*sqrt(11)
>> the problem is that we cannot do this multiplication because we have
>> "incompatible" operands, the first belongs to the cyclotomic field  
>> of order
>> 20 and the other one belongs to a symbolic ring.
>> Is there a way to fix this problem?
>>
>> alia
>
> You can do the following.  It's awkward but it works:
>
> sage: G = DirichletGroup(75)
> sage: chi = list(G)[8]
> sage: K = G.base_ring()
> sage: R.<x> = PolynomialRing(K)
> sage: L.<alpha> = K.extension(x^2 - 11)
> sage: chi(2) * alpha
> zeta20^4*alpha
>
> Here alpha = sqrt(11).
>
> Someday Robert Bradshaw is likely to make your original
> chi(2)*sqrt(11) work.  We'll see.

This would require sqrt(11) to be a number field element rather than  
a symbolic expression. For many things I think that would be a good  
idea, but it has some drawbacks, like when trying to compute sum(sqrt 
(p) for p in primes(1000))

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to