[sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-14 Thread Sébastien Labbé


On Monday, July 13, 2015 at 7:15:40 PM UTC+2, Simon King wrote:


 So, I'd prefer to display elements of QQbar as floating point numbers 
 (what default precision?), always rounded DOWN to the last digit that is 
 displayed, and followed by ... (not ?) unless the displayed value is 
 exact. So, what is displayed is an initial part of the potentially 
 infinite sequence of digits. 

 
+1

-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Jori Mäntysalo

On Mon, 13 Jul 2015, mmarco wrote:


Related to that, i think the current 17? digits are way too much for a
visually nice representation. I would prefear to see 1.4142...
than 1.414213562373095?  inside an expression.


OK for me. But I would like to have a setting for default length; I have 
done some computations where differences arise, for example, about tenth 
digit.


Not a big deal, thought.

--
Jori Mäntysalo


[sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Simon King
Hi!

On 2015-07-13, Nathann Cohen nathann.co...@gmail.com wrote:
 sage: sqrt(2) # a symbolic ring element
 sqrt(2)
 sage: QQbar(sqrt(2)) # an algebraic value
 1.414213562373095?

 It is true that this final '?' sounds more like a '...', as if some additional
 digits were hidden in a value stored as a float/double. Yet it is exact.

 How could we replace it? Ideally, that would be a 'sqrt(2)' but can we always
 provide such a representation cheaply? Could we display it as 'sqrt(2)' at 
 least
 when it is free to do so?

The elements of QQbar are the solutions of algebraic equations. As you
probably know, the solutions of algebraic equations of degree  4 can, in
general, not be expressed that nicely. But it seems like an appealing
idea to show a nice expression for algebraic numbers of degree up to 4.

 If we cannot get rid totally of this numerical representation, what would you
 think of replacing this '?' by a 'alg', which would be (slightly) more
 informative, e.g.:

1.4142134... looks exact to me: ... seems to suggest that Sage knows all
(potentially infinitely many) digits but can't show them all, whereas ? seems
to suggest that the last shown digit is questionable (i.e., subject to rounding
errors), i.e., ? seems to suggest that Sage doesn't know the exact value.

So, I'd prefer to display elements of QQbar as floating point numbers
(what default precision?), always rounded DOWN to the last digit that is
displayed, and followed by ... (not ?) unless the displayed value is
exact. So, what is displayed is an initial part of the potentially
infinite sequence of digits.

Best regards,
Simon


-- 
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/d/optout.


[sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread mmarco
I agree with Simon, although finding a nice expression like sqrt(2)+3^(1/3) 
can be very costly deppending on how the algebraic number was constructed. 
Anyways we could have such an expression for the cases where it is evident 
from the number construction.

Related to that, i think the current 17? digits are way too much for a 
visually nice representation. I would prefear to see 1.4142... than 
1.414213562373095?  
inside an expression.

El lunes, 13 de julio de 2015, 19:15:40 (UTC+2), Simon King escribió:

 Hi! 

 On 2015-07-13, Nathann Cohen nathan...@gmail.com javascript: wrote: 
  sage: sqrt(2) # a symbolic ring element 
  sqrt(2) 
  sage: QQbar(sqrt(2)) # an algebraic value 
  1.414213562373095? 
  
  It is true that this final '?' sounds more like a '...', as if some 
 additional 
  digits were hidden in a value stored as a float/double. Yet it is exact. 
  
  How could we replace it? Ideally, that would be a 'sqrt(2)' but can we 
 always 
  provide such a representation cheaply? Could we display it as 'sqrt(2)' 
 at least 
  when it is free to do so? 

 The elements of QQbar are the solutions of algebraic equations. As you 
 probably know, the solutions of algebraic equations of degree  4 can, in 
 general, not be expressed that nicely. But it seems like an appealing 
 idea to show a nice expression for algebraic numbers of degree up to 4. 

  If we cannot get rid totally of this numerical representation, what 
 would you 
  think of replacing this '?' by a 'alg', which would be (slightly) more 
  informative, e.g.: 

 1.4142134... looks exact to me: ... seems to suggest that Sage knows all 
 (potentially infinitely many) digits but can't show them all, whereas ? 
 seems 
 to suggest that the last shown digit is questionable (i.e., subject to 
 rounding 
 errors), i.e., ? seems to suggest that Sage doesn't know the exact 
 value. 

 So, I'd prefer to display elements of QQbar as floating point numbers 
 (what default precision?), always rounded DOWN to the last digit that is 
 displayed, and followed by ... (not ?) unless the displayed value is 
 exact. So, what is displayed is an initial part of the potentially 
 infinite sequence of digits. 

 Best regards, 
 Simon 




-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Nathann Cohen
 I agree with Simon, although finding a nice expression like sqrt(2)+3^(1/3)
 can be very costly deppending on how the algebraic number was constructed.

Yepyep. As Simon said we cannot always express algebraic numbers in
such a nice way, though. Well, if you want to build such an object
*in Sage* then you must describe your value somehow, and it is also
stored internally somewhere.. And I wonder how, and whether we can
base the representation on this internal version of the value :-)

 Anyways we could have such an expression for the cases where it is evident
 from the number construction.

+1

 Related to that, i think the current 17? digits are way too much for a
 visually nice representation. I would prefear to see 1.4142... than
 1.414213562373095?  inside an expression.

+1. It would also lessen the odds of having people believe that it is
stored as a float (with possibly many, but finitely many, digits)

Nathann

-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread John Cremona
Jonas -- the implementation of QQbar elements is precisely via real
intervals and a polynomial satisfied by the number (not always the min poly
unless that is forced, since that can be expensive).

This I think that the only issue is in how real interval field elements are
represented.  No-one (or almost) has ever liked the current form ending in
a ? which does of course have a logic behind it but is *very* hard to
explain (and to remember).

The sqrt() - style representation is only really practical for number of
degree 2 -- in principle one could do more general radical expressions, and
sqrt(2)+sqrt(3) looks rather nicer than

sage: QQbar(2).sqrt()+QQbar(3).sqrt()
3.146264369941973?

but that is (a) expensive and (b) only applies to rather special algebraic
numbers.

John

On 13 July 2015 at 18:49, William Stein wst...@gmail.com wrote:

 On Mon, Jul 13, 2015 at 10:15 AM, Simon King simon.k...@uni-jena.de
 wrote:
  Hi!
 
  On 2015-07-13, Nathann Cohen nathann.co...@gmail.com wrote:
  sage: sqrt(2) # a symbolic ring element
  sqrt(2)
  sage: QQbar(sqrt(2)) # an algebraic value
  1.414213562373095?
 
  It is true that this final '?' sounds more like a '...', as if some
 additional
  digits were hidden in a value stored as a float/double. Yet it is exact.
 
  How could we replace it? Ideally, that would be a 'sqrt(2)' but can we
 always
  provide such a representation cheaply? Could we display it as 'sqrt(2)'
 at least
  when it is free to do so?
 
  The elements of QQbar are the solutions of algebraic equations. As you
  probably know, the solutions of algebraic equations of degree  4 can, in
  general, not be expressed that nicely. But it seems like an appealing
  idea to show a nice expression for algebraic numbers of degree up to 4.
 
  If we cannot get rid totally of this numerical representation, what
 would you
  think of replacing this '?' by a 'alg', which would be (slightly) more
  informative, e.g.:
 
  1.4142134... looks exact to me: ... seems to suggest that Sage knows
 all
  (potentially infinitely many) digits but can't show them all, whereas
 ? seems
  to suggest that the last shown digit is questionable (i.e., subject to
 rounding
  errors), i.e., ? seems to suggest that Sage doesn't know the exact
 value.

 Yes.  Also, with interval arithmetic, that is precisely what it means:

 sage: RealIntervalField(53)(sqrt(2))
 1.414213562373095?
 sage: QQbar(sqrt(2))
 1.414213562373095?

 It's certainly not good that the above two print in the same way.
 The (mysterious [1]) person who made those design choices -- Carl
 Witty -- isn't contributing anymore, or I'd ask his opinion.


 [1] http://stackoverflow.com/users/684532/carl-witty

 
  So, I'd prefer to display elements of QQbar as floating point numbers
  (what default precision?), always rounded DOWN to the last digit that is
  displayed, and followed by ... (not ?) unless the displayed value is
  exact. So, what is displayed is an initial part of the potentially
  infinite sequence of digits.
 
  Best regards,
  Simon
 
 
  --
  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/d/optout.



 --
 William (http://wstein.org)

 --
 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/d/optout.


-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Dima Pasechnik


On Monday, 13 July 2015 18:49:48 UTC+1, William wrote:

 On Mon, Jul 13, 2015 at 10:15 AM, Simon King simon...@uni-jena.de 
 javascript: wrote: 
  Hi! 
  
  On 2015-07-13, Nathann Cohen nathan...@gmail.com javascript: wrote: 
  sage: sqrt(2) # a symbolic ring element 
  sqrt(2) 
  sage: QQbar(sqrt(2)) # an algebraic value 
  1.414213562373095? 
  
  It is true that this final '?' sounds more like a '...', as if some 
 additional 
  digits were hidden in a value stored as a float/double. Yet it is 
 exact. 
  
  How could we replace it? Ideally, that would be a 'sqrt(2)' but can we 
 always 
  provide such a representation cheaply? Could we display it as 'sqrt(2)' 
 at least 
  when it is free to do so? 
  
  The elements of QQbar are the solutions of algebraic equations. As you 
  probably know, the solutions of algebraic equations of degree  4 can, 
 in 
  general, not be expressed that nicely. But it seems like an appealing 
  idea to show a nice expression for algebraic numbers of degree up to 4. 
  
  If we cannot get rid totally of this numerical representation, what 
 would you 
  think of replacing this '?' by a 'alg', which would be (slightly) more 
  informative, e.g.: 
  
  1.4142134... looks exact to me: ... seems to suggest that Sage knows 
 all 
  (potentially infinitely many) digits but can't show them all, whereas 
 ? seems 
  to suggest that the last shown digit is questionable (i.e., subject to 
 rounding 
  errors), i.e., ? seems to suggest that Sage doesn't know the exact 
 value. 

 Yes.  Also, with interval arithmetic, that is precisely what it means: 

 sage: RealIntervalField(53)(sqrt(2)) 
 1.414213562373095? 
 sage: QQbar(sqrt(2)) 
 1.414213562373095? 

 It's certainly not good that the above two print in the same way. 
 The (mysterious [1]) person who made those design choices -- Carl 
 Witty -- isn't contributing anymore, or I'd ask his opinion. 


As we now allow unicode, we can probably find a better character than '?'.
Say ⇘, or ↴, or even ¿.

 



 [1] http://stackoverflow.com/users/684532/carl-witty 

  
  So, I'd prefer to display elements of QQbar as floating point numbers 
  (what default precision?), always rounded DOWN to the last digit that is 
  displayed, and followed by ... (not ?) unless the displayed value is 
  exact. So, what is displayed is an initial part of the potentially 
  infinite sequence of digits. 
  
  Best regards, 
  Simon 
  
  
  -- 
  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+...@googlegroups.com javascript:. 
  To post to this group, send email to sage-...@googlegroups.com 
 javascript:. 
  Visit this group at http://groups.google.com/group/sage-devel. 
  For more options, visit https://groups.google.com/d/optout. 



 -- 
 William (http://wstein.org) 


-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Volker Braun
¿¡Qué estás diciendo!?


On Monday, July 13, 2015 at 9:14:51 PM UTC+2, Dima Pasechnik wrote:



 On Monday, 13 July 2015 18:49:48 UTC+1, William wrote:

 On Mon, Jul 13, 2015 at 10:15 AM, Simon King simon...@uni-jena.de 
 wrote: 
  Hi! 
  
  On 2015-07-13, Nathann Cohen nathan...@gmail.com wrote: 
  sage: sqrt(2) # a symbolic ring element 
  sqrt(2) 
  sage: QQbar(sqrt(2)) # an algebraic value 
  1.414213562373095? 
  
  It is true that this final '?' sounds more like a '...', as if some 
 additional 
  digits were hidden in a value stored as a float/double. Yet it is 
 exact. 
  
  How could we replace it? Ideally, that would be a 'sqrt(2)' but can we 
 always 
  provide such a representation cheaply? Could we display it as 
 'sqrt(2)' at least 
  when it is free to do so? 
  
  The elements of QQbar are the solutions of algebraic equations. As you 
  probably know, the solutions of algebraic equations of degree  4 can, 
 in 
  general, not be expressed that nicely. But it seems like an appealing 
  idea to show a nice expression for algebraic numbers of degree up to 4. 
  
  If we cannot get rid totally of this numerical representation, what 
 would you 
  think of replacing this '?' by a 'alg', which would be (slightly) more 
  informative, e.g.: 
  
  1.4142134... looks exact to me: ... seems to suggest that Sage knows 
 all 
  (potentially infinitely many) digits but can't show them all, whereas 
 ? seems 
  to suggest that the last shown digit is questionable (i.e., subject to 
 rounding 
  errors), i.e., ? seems to suggest that Sage doesn't know the exact 
 value. 

 Yes.  Also, with interval arithmetic, that is precisely what it means: 

 sage: RealIntervalField(53)(sqrt(2)) 
 1.414213562373095? 
 sage: QQbar(sqrt(2)) 
 1.414213562373095? 

 It's certainly not good that the above two print in the same way. 
 The (mysterious [1]) person who made those design choices -- Carl 
 Witty -- isn't contributing anymore, or I'd ask his opinion. 


 As we now allow unicode, we can probably find a better character than '?'.
 Say ⇘, or ↴, or even ¿.

  



 [1] http://stackoverflow.com/users/684532/carl-witty 

  
  So, I'd prefer to display elements of QQbar as floating point numbers 
  (what default precision?), always rounded DOWN to the last digit that 
 is 
  displayed, and followed by ... (not ?) unless the displayed value 
 is 
  exact. So, what is displayed is an initial part of the potentially 
  infinite sequence of digits. 
  
  Best regards, 
  Simon 
  
  
  -- 
  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+...@googlegroups.com. 
  To post to this group, send email to sage-...@googlegroups.com. 
  Visit this group at http://groups.google.com/group/sage-devel. 
  For more options, visit https://groups.google.com/d/optout. 



 -- 
 William (http://wstein.org) 



-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Vincent Delecroix

On 13/07/15 19:15, Simon King wrote:

Hi!

On 2015-07-13, Nathann Cohen nathann.co...@gmail.com wrote:

 sage: sqrt(2) # a symbolic ring element
 sqrt(2)
 sage: QQbar(sqrt(2)) # an algebraic value
 1.414213562373095?

It is true that this final '?' sounds more like a '...', as if some additional
digits were hidden in a value stored as a float/double. Yet it is exact.

How could we replace it? Ideally, that would be a 'sqrt(2)' but can we always
provide such a representation cheaply? Could we display it as 'sqrt(2)' at least
when it is free to do so?


The elements of QQbar are the solutions of algebraic equations. As you
probably know, the solutions of algebraic equations of degree  4 can, in
general, not be expressed that nicely. But it seems like an appealing
idea to show a nice expression for algebraic numbers of degree up to 4.


If we cannot get rid totally of this numerical representation, what would you
think of replacing this '?' by a 'alg', which would be (slightly) more
informative, e.g.:


1.4142134... looks exact to me: ... seems to suggest that Sage knows all
(potentially infinitely many) digits but can't show them all, whereas ? seems
to suggest that the last shown digit is questionable (i.e., subject to rounding
errors), i.e., ? seems to suggest that Sage doesn't know the exact value.


+1

It is consistent with

sage: words.FibonacciWord([0,1])
word: 0100101001001010010100100101001001010010...

sage: continued_fraction(pi)
[3; 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2, ...]

sage: IntegerRange(0,+Infinity,2)
{0, 2, ...}

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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Jonas Jermann

On 13.07.2015 19:33, Nathann Cohen wrote:

I agree with Simon, although finding a nice expression like sqrt(2)+3^(1/3)
can be very costly deppending on how the algebraic number was constructed.


Yepyep. As Simon said we cannot always express algebraic numbers in
such a nice way, though. Well, if you want to build such an object
*in Sage* then you must describe your value somehow, and it is also
stored internally somewhere.. And I wonder how, and whether we can
base the representation on this internal version of the value :-)


Anyways we could have such an expression for the cases where it is evident
from the number construction.


-1

I definitely prefer a uniform output.
If you want a symbolic representation then convert the element to
one from SR (symbolic ring). This is basically what you are asking with
where it is evident anyway...

Of course you could add a function which tries to do exactly that
but in my opinion the default output should have a uniform look
for a given parent. That way you also realize (better) over what
parent you are working with currently.

Sidenote: Another useful representation is the minimal polynomial + 
exact bounds (maybe interval field element?) for a root location.


I implemented a proof of concept of such a field once where all elements
were displayed as their minimal polynomial + bounds for the root 
location. Arithmetic operations like addition or multiplication can
be defined for the root polynomial. What is harder are the root location 
bounds (+ irreducible parts of the polynomial) which have to

be recalculated I suppose.


Best
Jonas

--
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread William Stein
On Mon, Jul 13, 2015 at 10:15 AM, Simon King simon.k...@uni-jena.de wrote:
 Hi!

 On 2015-07-13, Nathann Cohen nathann.co...@gmail.com wrote:
 sage: sqrt(2) # a symbolic ring element
 sqrt(2)
 sage: QQbar(sqrt(2)) # an algebraic value
 1.414213562373095?

 It is true that this final '?' sounds more like a '...', as if some 
 additional
 digits were hidden in a value stored as a float/double. Yet it is exact.

 How could we replace it? Ideally, that would be a 'sqrt(2)' but can we always
 provide such a representation cheaply? Could we display it as 'sqrt(2)' at 
 least
 when it is free to do so?

 The elements of QQbar are the solutions of algebraic equations. As you
 probably know, the solutions of algebraic equations of degree  4 can, in
 general, not be expressed that nicely. But it seems like an appealing
 idea to show a nice expression for algebraic numbers of degree up to 4.

 If we cannot get rid totally of this numerical representation, what would you
 think of replacing this '?' by a 'alg', which would be (slightly) more
 informative, e.g.:

 1.4142134... looks exact to me: ... seems to suggest that Sage knows all
 (potentially infinitely many) digits but can't show them all, whereas ? 
 seems
 to suggest that the last shown digit is questionable (i.e., subject to 
 rounding
 errors), i.e., ? seems to suggest that Sage doesn't know the exact value.

Yes.  Also, with interval arithmetic, that is precisely what it means:

sage: RealIntervalField(53)(sqrt(2))
1.414213562373095?
sage: QQbar(sqrt(2))
1.414213562373095?

It's certainly not good that the above two print in the same way.
The (mysterious [1]) person who made those design choices -- Carl
Witty -- isn't contributing anymore, or I'd ask his opinion.


[1] http://stackoverflow.com/users/684532/carl-witty


 So, I'd prefer to display elements of QQbar as floating point numbers
 (what default precision?), always rounded DOWN to the last digit that is
 displayed, and followed by ... (not ?) unless the displayed value is
 exact. So, what is displayed is an initial part of the potentially
 infinite sequence of digits.

 Best regards,
 Simon


 --
 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/d/optout.



-- 
William (http://wstein.org)

-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Jeroen Demeyer

On 2015-07-13 21:55, Bill Hart wrote:

The elements of QQbar are the solutions of algebraic equations. As you
probably know, the solutions of algebraic equations of degree  4
can, in general, not be expressed that nicely.

This is slightly incorrect. The general quintic can be solved in terms
of Jacobi theta functions, the general sextic in terms of Kampe de
Feriet functions, amongst others.

In general Mellin integrals, Fuchsian functions and theta functions can
be used to solve general equations of degree n.


...which proves the original poster's point about not be expressed that 
nicely.


--
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Bill Hart


On Monday, 13 July 2015 22:07:46 UTC+2, Jeroen Demeyer wrote:

 On 2015-07-13 21:55, Bill Hart wrote: 
  The elements of QQbar are the solutions of algebraic equations. As 
 you 
  probably know, the solutions of algebraic equations of degree  4 
  can, in general, not be expressed that nicely. 
  
  This is slightly incorrect. The general quintic can be solved in terms 
  of Jacobi theta functions, the general sextic in terms of Kampe de 
  Feriet functions, amongst others. 
  
  In general Mellin integrals, Fuchsian functions and theta functions can 
  be used to solve general equations of degree n. 

 ...which proves the original poster's point about not be expressed that 
 nicely. 


The formulas for the quintic in terms of Jacobi functions, for example, 
don't look that much more frightening than those for the quartic in terms 
of radicals. I don't see any explosion in complexity. 

Perhaps it is a matter of taste.

-- 
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/d/optout.


[sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Bill Hart


On Monday, 13 July 2015 19:15:40 UTC+2, Simon King wrote:

 Hi! 

 On 2015-07-13, Nathann Cohen nathan...@gmail.com javascript: wrote: 
  sage: sqrt(2) # a symbolic ring element 
  sqrt(2) 
  sage: QQbar(sqrt(2)) # an algebraic value 
  1.414213562373095? 
  
  It is true that this final '?' sounds more like a '...', as if some 
 additional 
  digits were hidden in a value stored as a float/double. Yet it is exact. 
  
  How could we replace it? Ideally, that would be a 'sqrt(2)' but can we 
 always 
  provide such a representation cheaply? Could we display it as 'sqrt(2)' 
 at least 
  when it is free to do so? 

 The elements of QQbar are the solutions of algebraic equations. As you 
 probably know, the solutions of algebraic equations of degree  4 can, in 
 general, not be expressed that nicely.


This is slightly incorrect. The general quintic can be solved in terms of 
Jacobi theta functions, the general sextic in terms of Kampe de Feriet 
functions, amongst others. 

In general Mellin integrals, Fuchsian functions and theta functions can be 
used to solve general equations of degree n. 

Bill.

-- 
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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Vincent Delecroix

On 13/07/15 19:48, Jonas Jermann wrote:

On 13.07.2015 19:33, Nathann Cohen wrote:

I agree with Simon, although finding a nice expression like
sqrt(2)+3^(1/3)
can be very costly deppending on how the algebraic number was
constructed.


Yepyep. As Simon said we cannot always express algebraic numbers in
such a nice way, though. Well, if you want to build such an object
*in Sage* then you must describe your value somehow, and it is also
stored internally somewhere.. And I wonder how, and whether we can
base the representation on this internal version of the value :-)


Anyways we could have such an expression for the cases where it is
evident
from the number construction.


-1

I definitely prefer a uniform output.


Me too. I would really much prefer uniform output and uniform storage... 
If somebody input sum(QQbar(i).sqrt() for i in range(100)) do we really 
want to output


1 + sqrt(2) + sqrt(3) + etc

I guess not. And we do not want to slow down the computation of numbers 
in QQbar because one can potentially have a nicer output form.


 If you want a symbolic representation then convert the element to
 one from SR (symbolic ring). This is basically what you are asking with
 where it is evident anyway...


Of course you could add a function which tries to do exactly that
but in my opinion the default output should have a uniform look
for a given parent. That way you also realize (better) over what
parent you are working with currently.


That is a different matter and we already have #17516 for that.

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/d/optout.


Re: [sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Dima Pasechnik


On Monday, 13 July 2015 20:30:34 UTC+1, Volker Braun wrote:

 ¿¡Qué estás diciendo!?


So that  '¿' indicates the beginning of the questionable part!

-- 
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/d/optout.


[sage-devel] Re: Algebraic numbers: the '?' could be more informative (e.g.: 1.4142?)

2015-07-13 Thread Simon King
Hi Bill,

On 2015-07-13, Bill Hart goodwillh...@googlemail.com wrote:
 On Monday, 13 July 2015 19:15:40 UTC+2, Simon King wrote:
 On 2015-07-13, Nathann Cohen nathan...@gmail.com javascript: wrote: 
  sage: sqrt(2) # a symbolic ring element 
  sqrt(2) 
  sage: QQbar(sqrt(2)) # an algebraic value 
  1.414213562373095? 
  
  It is true that this final '?' sounds more like a '...', as if some 
 additional 
  digits were hidden in a value stored as a float/double. Yet it is exact. 
  
  How could we replace it? Ideally, that would be a 'sqrt(2)' but can we 
 always 
  provide such a representation cheaply? Could we display it as 'sqrt(2)' 
 at least 
  when it is free to do so? 

 The elements of QQbar are the solutions of algebraic equations. As you 
 probably know, the solutions of algebraic equations of degree  4 can, in 
 general, not be expressed that nicely.


 This is slightly incorrect.

For an appropriate notion of such a representation resp. that nicely, my
statement is correct :-)

Indeed, I replied to a message that was about representation of elements
of QQbar in terms of square (generally n-th) roots.

Best regards,
Simon

-- 
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/d/optout.