[sage-devel] Re: Changes in Maxima behavior

2013-07-05 Thread rjf
Just as a followup.  It appears to me that ...

radcan() should not consult  the setting of domain, so far as I can tell, 
except
in the situation in which it produces a result and then runs it through 
simplifya
the main simplification program.

That program apparently un-does the simplification that radcan produces,
and so radcan notices the persistence of a radical that it can simplify, and
does so again. And again.  I'm not sure what to say about this being a bug.
Is it a user error to specify domain:complex?  Should radcan bind domain
to real  (note: when radcan was written, domain setting did not exist)
in which case the radcan program is secretly unsetting a user option? Maybe
that's the thing to do, Robert...


The occurrence of *alpha is some trace is related to using
a modular polynomial GCD algorithm. See the source code at rat3c.lisp,
where you see that this number is chosen as the modulus; a positive prime 
sort of near
the (positive :) square root of the largest fixnum in (some) lisp.

My guess is that it is computing a GCD of v^2+u^2-1 and its derivative
with respect to u or v to see if it is a perfect square, in which case
maybe it can be taken outside the square root.



On Tuesday, July 2, 2013 9:53:19 AM UTC-7, Robert Dodier wrote:

 On 2013-07-01, Joris Vankerschaver joris.van...@gmail.com javascript: 
 wrote: 

sage: u, v = var('u, v', domain='real') 
sage: sqrt(-1/(u^2+v^2-1)).simplify_radical()  # This will hang 

 This is a bug in Maxima: 

 (%i2) radcan (sqrt (-1 / (u^2 + v^2 - 1))), domain=complex; 

 It waits apparently forever here -- but it is actually looping over 
 *ALPHA (not sure why) which is a large prime number (8388593). 

 (%i3) :lisp (setq *alpha 17) 
 17 
 (%i3) radcan(sqrt(-1/(u^2+v^2-1))), domain=complex; 
 (%o3) 1/sqrt(-v^2-u^2+1) 

 I've reported this as bug # 2605. 

 best 

 Robert Dodier 



-- 
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: Changes in Maxima behavior

2013-07-03 Thread kcrisman


On Friday, June 28, 2013 11:14:55 AM UTC-4, rjf wrote:



 On Friday, June 28, 2013 5:09:49 AM UTC-7, Joris Vankerschaver wrote:

 Hi all, 
 

  

 Is there something I can do to avoid this?


  
  I tried this in Maxima 5.25.1 and 5.28.02

 You can avoid this problem by just using one of those versions of  Maxima 
 directly.

 I suspect, but do not know, that simplify_full is just a call to 
 fullratsimp() in Maxima.


Just as a point of information, it calls this as well as a number of other 
simplifications in Maxima. 

-- 
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: Changes in Maxima behavior

2013-07-02 Thread Robert Dodier
On 2013-07-01, Joris Vankerschaver joris.vankerscha...@gmail.com wrote:

   sage: u, v = var('u, v', domain='real')
   sage: sqrt(-1/(u^2+v^2-1)).simplify_radical()  # This will hang

This is a bug in Maxima:

(%i2) radcan (sqrt (-1 / (u^2 + v^2 - 1))), domain=complex;

It waits apparently forever here -- but it is actually looping over
*ALPHA (not sure why) which is a large prime number (8388593).

(%i3) :lisp (setq *alpha 17)
17
(%i3) radcan(sqrt(-1/(u^2+v^2-1))), domain=complex;
(%o3) 1/sqrt(-v^2-u^2+1)

I've reported this as bug # 2605.

best

Robert Dodier

-- 
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: Changes in Maxima behavior

2013-07-01 Thread Joris Vankerschaver
Hi all, 

Following RJF's suggestion, I played around with Maxima for a little while 
to see where the problem arises. As far as I can tell, this is again a 
problem with the fact that simplify_radical gets called in simplify_full 
(see #12737). The problem that I'm seeing used to be absent when 
simplify_radical still set the domain to 'real' before invoking radcan, but 
now that it no longer does that, the problem has become apparent, see below.

First of all, I simplified the example in the original post to 

  sage: u, v = var('u, v', domain='real')
  sage: sqrt(-1/(u^2+v^2-1)).simplify_radical()  # This will hang

The problem is with the fact that the domain of the symbolic variables is 
complex:

sage: maxima.interact()
maxima: forget()
[]
maxima: domain
complex
maxima: assume(x  0)
[x0]
maxima: assume(y  0)
[y0]
maxima: radcan(sqrt(-1/(x^2 + y^2 - 1)))

Setting the domain to 'real' fixes the problem: 

sage: maxima.interact()
maxima: domain: real
real
maxima: radcan(sqrt(-1/(x^2 + y^2 - 1)))
%i/sqrt(y^2+x^2-1)

The upshot seems to be that this is not really a bug, but again an annoying 
consequence of simplify_radical not really being a simplify_ method, and 
this should be fixed once #11912 and #12737 are approved. Therefore I won't 
open a new ticket, but I'll just add to the discussion of those patches.

All the best,
Joris


On Friday, June 28, 2013 1:09:49 PM UTC+1, Joris Vankerschaver wrote:

 Hi all, 

 I've been out of the Sage loop for a while, but upon upgrading to 5.10, I 
 found that Maxima seems to choke on the following innocuous code which used 
 to run fine. I'm posting this here, because this issue came up while I was 
 working on #10132, and also because it affects usability.

   sage: u, v = var('u,v')
   sage: assume(u, 'real')
   sage: assume(v, 'real')
   sage: assume(u^2 + v^2  1)
   sage: n = vector((u/sqrt(-u^2 - v^2 + 1), v/sqrt(-u^2 - v^2 + 1), 1))
   sage: norm = n.norm(); norm
   sqrt(abs(u/sqrt(-u^2 - v^2 + 1))^2 + abs(v/sqrt(-u^2 - v^2 + 1))^2 + 1)
   sage: norm.simplify_full() 

 The last command just sits there on 5.10, and consumes all the resources 
 (more specifically, /Users/Joris/sage/local/bin/sage-cleaner consumes all 
 the available memory). In Sage 5.3, the last command just would return 
 I/sqrt(u^2 + v^2 - 1) which is not very nice but at least it's short and 
 fast.

 Is this known? Is there something I can do to avoid this?

 All the best,
 Joris





-- 
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: Changes in Maxima behavior

2013-06-28 Thread Volker Braun
I can confirm the regression, after a few seconds I get

TypeError: ECL says: Memory limit reached. Please jump to an outer pointer, 
quit program and enlarge the
memory limits before executing the program again.

The process that consumes the memory is sage-ipython (in the ECL shared 
library), not sage-cleaner.


On Friday, June 28, 2013 8:09:49 AM UTC-4, Joris Vankerschaver wrote:

 Hi all, 

 I've been out of the Sage loop for a while, but upon upgrading to 5.10, I 
 found that Maxima seems to choke on the following innocuous code which used 
 to run fine. I'm posting this here, because this issue came up while I was 
 working on #10132, and also because it affects usability.

   sage: u, v = var('u,v')
   sage: assume(u, 'real')
   sage: assume(v, 'real')
   sage: assume(u^2 + v^2  1)
   sage: n = vector((u/sqrt(-u^2 - v^2 + 1), v/sqrt(-u^2 - v^2 + 1), 1))
   sage: norm = n.norm(); norm
   sqrt(abs(u/sqrt(-u^2 - v^2 + 1))^2 + abs(v/sqrt(-u^2 - v^2 + 1))^2 + 1)
   sage: norm.simplify_full() 

 The last command just sits there on 5.10, and consumes all the resources 
 (more specifically, /Users/Joris/sage/local/bin/sage-cleaner consumes all 
 the available memory). In Sage 5.3, the last command just would return 
 I/sqrt(u^2 + v^2 - 1) which is not very nice but at least it's short and 
 fast.

 Is this known? Is there something I can do to avoid this?

 All the best,
 Joris





-- 
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: Changes in Maxima behavior

2013-06-28 Thread rjf


On Friday, June 28, 2013 5:09:49 AM UTC-7, Joris Vankerschaver wrote:

 Hi all, 
 

 

 Is there something I can do to avoid this?


 
 I tried this in Maxima 5.25.1 and 5.28.02

You can avoid this problem by just using one of those versions of  Maxima 
directly.

I suspect, but do not know, that simplify_full is just a call to 
fullratsimp() in Maxima.

-- 
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.