[sage-devel] Embedded number fields

2013-11-02 Thread Vincent Delecroix
Hi,

I am working with number fields that I consider as subfields of RR. I
want (relatively fast) exact computations and at the same time being
able to compare elements for the order induced by RR (see for example
#13123 going in that direction). These fields are naturally embedded
in AA but it seems impossible to do the conversion

{{{
sage: K2. = NumberField(x^2 - 2, embedding=1.4142)
sage: AA(sqrt2)
Traceback (most recent call last):
...
TypeError: Illegal initializer for algebraic number
sage: QQbar(sqrt2)
Traceback (most recent call last):
...
TypeError: Illegal initializer for algebraic number
}}}

Did I do something wrong ?

In the future, I am not sure how to implement things as a number field
might be embedded in RR but also in p-adics. What do you think about a
dedicated class RealNumberField that for sure would inherit from
NumberField ? A dedicated class makes sense since you do not ask the
same question to a real number (floor, is_positive, etc) and a p-adic
one (valuation, etc).

Best,
Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-devel] documentation with "SetPartitionsAk(k)"

2013-11-02 Thread Pedro Cruz
Dear Sage 5.12 developers,

when using 

 sage -docbuild pt/megua html 

we are getting the right documentation of our module but in the middle (and 
we believe is after this line):

from sage.all import *

we are getting documentation from  functions like: "SetPartitionsAk(k)" ou "
SetPartitionsPRk(*k*)" and many more similar but we are not using/calling 
them.

This effect can be seen here:

https://dl.dropboxusercontent.com/u/10518224/megua/ur.html

Please, check for SetPartitionsAk in the middle of the document.

What could be wrong or what should I do?

Thank you.

Pedro Cruz



-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-devel] Re: documentation with "SetPartitionsAk(k)"

2013-11-02 Thread Volker Braun
You should never "from sage.all import *". For starters, that is already 
imported in the doctest framework. The doctest framework might have 
redefined something for doctesting purposes.



On Saturday, November 2, 2013 5:51:47 PM UTC, Pedro Cruz wrote:
>
> Dear Sage 5.12 developers,
>
> when using 
>
>  sage -docbuild pt/megua html 
>
> we are getting the right documentation of our module but in the middle 
> (and we believe is after this line):
>
> from sage.all import *
>
> we are getting documentation from  functions like: "SetPartitionsAk(k)" ou 
> "SetPartitionsPRk(*k*)" and many more similar but we are not 
> using/calling them.
>
> This effect can be seen here:
>
> https://dl.dropboxusercontent.com/u/10518224/megua/ur.html
>
> Please, check for SetPartitionsAk in the middle of the document.
>
> What could be wrong or what should I do?
>
> Thank you.
>
> Pedro Cruz
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-devel] Re: Embedded number fields

2013-11-02 Thread Nils Bruin
On Saturday, November 2, 2013 10:34:10 AM UTC-7, vdelecroix wrote:
>
> I am working with number fields that I consider as subfields of RR.


RR doesn't coerce into AA (it really doesn't!), so specifying an embedding 
of your numberfield in RR is not going to help in finding a coercion into 
AA. You can embed straight into AA of course:

 QX.=QQ[]
f=x^2-2
rt=(a for a in f.roots(AA,multiplicities=False) if a>0).next()
K.=NumberField(f,embedding=rt)

and after that sage should be able to figure out most things about how K 
relates to AA.



-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.