[sage-support] Re: how to factorize an expression with constant variables ?

2012-09-20 Thread mazkime
sorry for the late answer.
After some investigations on the internet, I did not find any convenient 
solution.
My concern being on polynomials, I ended up doing some copy/paste of my 
expressions and working in another window with a polynomial ring defined 
the following way :

R.A,B = QQ[]
R.x,y,z = PolynomialRing(QQ[A,B],order='deglex')

where x, y, z are the variables and A, B some parameters.
It's not very nice because I have to do some copy/paste, but at least I had 
my answer at the end.
Best regards.

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




[sage-support] Re: Jacobi sn

2012-09-20 Thread Rafael
Thank you for your reply.

I get:

sage: maxima.version()
'5.26.0'

I searched the Maxima change logs at:

http://code.metager.de/source/xref/maxima/ChangeLog-5.27

(and also for 5.28) and did not see any direct changes to elliptic 
functions.  
But I am glad to see that they seem to be working better in 5.28.

Is there any chance that Maxima 5.28 will be included in the next version 
of Sage ?
In February, I will be teaching a course (at AIMS in Cape Town) using Sage, 
where I plan
to introduce the elliptic functions; and it would be nice to have this 
working by then.

Thanks again! 

Rafael.

On Sunday, September 16, 2012 2:09:02 AM UTC-4, Robert Dodier wrote:

 On 2012-09-16, kcrisman kcri...@gmail.com javascript: wrote: 

  I don't have access to a Maxima instance right now - can someone try to 
  recreate this there? 

 For the record, here's what I get w/ Maxima 5.28.0 (current release). 

 (%i1) u : 1.2 $ 
 (%i2) m : 0.5 $ 
 (%i3) jacobi_sn (u, m); 
 (%o3)  .8877154886192781 
 (%i4) jacobi_sn (u + 2 * %i * elliptic_kc (1 - m), m); 
 (%o4) 0.88771548861928 - 1.884363664625109E-15 %i 

 I don't know what version of Maxima Sage is using, and I would have to 
 look at the revision log to see if the elliptic functions have changed 
 since then. 

 best, 

 Robert Dodier 



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




Re: [sage-support] Strange results with multivariate resultants

2012-09-20 Thread Julian Rüth
* Georgi Guninski gunin...@guninski.com [2012-09-19 07:34:46 +0300]:

 According to wikipedia [1]
 the multivariate resultant or Macaulay's resultant of n homogeneous 
 polynomials in n variables is a polynomial in their coefficients that 
 vanishes when they have a common non-zero solution
 My pain is $1$ can't vanish while solutions exist.
I don't think the article talks about the multivariate resultant. Imho
the line you quote is just there to mention that there are
generalizations of resultants to the multivariate case (it says
Alternatively, More generally close to that line).

 Here is homogeneous example:
 sage: K.x1,x2,x3,x4=QQ[]
 sage: p1,p2=(x2)*(x3-x4),x2*(x3-2*x4)
 sage: p1.resultant(p2,x1)
 1
Afaik this computes the resultant of p1 and p2 as polynomials in
QQ(x2,x3,x4)[x1]. As p1 and p2 are constant, they have no common root.

 On the same example pari/gp returns 0:
I don't know anything about GP, but it seems that it doesn't like to
compute resultants when the variable is not in any of the polynomials
(or do any of the variables have a special meaning?)

? p1=(x2)*(x3-x4);p2=x2*(x3-2*x4);
? polresultant(p1,p2,x1)
%2 = 0
? p1=(y)*(z-t);p2=y*(z-2*t);
? polresultant(p1,p2,x1)
%4 = 1

julian

 On Tue, Sep 18, 2012 at 05:22:59PM +0200, Julian Rüth wrote:
  Hi,
  
  I'm not sure if I understand what is counterintuitive about the results.
  
  * Georgi Guninski gunin...@guninski.com [2012-09-18 16:55:37 +0300]:
   sage: K.x1,x2,x3=PolynomialRing(QQ)
   sage: p1=(x2-1)*(x3+2)
   sage: p2=(x2-1)*(x3+3)
   sage: p1.resultant(p2)
   1
  This is the resultant of p1 and p2 w.r.t. x1 (the first variable of K).
  
   sage: K_.x2,x3=PolynomialRing(QQ)
   sage: p1_=K_(p1)
   sage: p2_=K_(p2)
   sage: p1_.resultant(p2_)
   0
  The resultant of p1 and p2 w.r.t. x2 (the first variable of K_).
  
   sage: gp.polresultant(gp(p1),gp(p2))
   0
  I'm not entirely sure what gp.polresultant() does, but it seems it
  computes the resultant w.r.t. variable()
  
  sage: gp(p1).variable()
  x2
  
  The following is strange though:
  
  sage: gp.polresultant(p1,p2,x1)
  0 # this should be 1?
  sage: gp.polresultant(p1,p2,x2)
  0
  sage: gp.polresultant(p1,p2,x3)
  x2^2 - 2*x2 + 1
  
  Am I missing something here?
  
  julian
  
  -- 
  You received this message because you are subscribed to the Google Groups 
  sage-support group.
  To post to this group, send email to sage-support@googlegroups.com.
  To unsubscribe from this group, send email to 
  sage-support+unsubscr...@googlegroups.com.
  Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 

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




[sage-support] Re: Problem with sagecell server installation

2012-09-20 Thread ma...@mendelu.cz


Dne středa, 19. září 2012 7:40:02 UTC+2 ma...@mendelu.cz napsal(a):


 I have the following problem when running web_server.py

 sagecell@sagecell:~/sage-5.3/devel/sagecell$ ../../sage web_server.py 
 Computer 3b203f84-d093-43f4-aade-47e371970bd3 did not respond, connecting 
 failed!


The problem has been in the path to the sage program and disappeared when I 
fixed the path in the config file. However, now I have this:


Websocket closed http://192.168.26.133:8000/#
Websocket connection to 
ws://192.168.26.133:/kernel/428c10d5-20f2-4db5-ae9c-e678d6538c9b could 
not be established. You will NOT be able to run code. Your browser may not 
be compatible with the websocket version in the server, or if the url does 
not look right, there could be an error in the server's configuration.

Robert

 

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




Re: [sage-support] Strange results with multivariate resultants

2012-09-20 Thread luisfe


On Wednesday, September 19, 2012 6:34:52 AM UTC+2, Georgi Guninski wrote:

 Hi, 

 I may be missing something, but the resultant = 1 confuses me. 
 According to wikipedia [1] 
 the multivariate resultant or Macaulay's resultant of n homogeneous 
 polynomials in n variables is a polynomial in their coefficients that 
 vanishes when they have a common non-zero solution 


Note that this means n homogeneous polynomials in n variables, in your 
example you only have two polynomials in four variables, it is not the same 
case of Macaulay's resultant.
 

 My pain is $1$ can't vanish while solutions exist. 

 Here is homogeneous example: 
 sage: K.x1,x2,x3,x4=QQ[] 
 sage: p1,p2=(x2)*(x3-x4),x2*(x3-2*x4) 
 sage: p1.resultant(p2,x1) 
 1 

 Certainly p1 and p2 have common solutions while the res. w.r.t. 
 x1 never vanishes (got this in a real world situation). 


As said, in this case the resultant is computed in the ring QQ(x2,x3)[x1] 
and the resultant will vanish if the two (univariate) polynomials have a 
common root in the algebraic closure of QQ(x2,x3). This is the standard 
resultant of multivariate polynomials with respect to one variable.

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




Re: [sage-support] Strange results with multivariate resultants

2012-09-20 Thread luisfe


On Thursday, September 20, 2012 1:05:56 PM UTC+2, Georgi Guninski wrote:

 pari disagrees with sage and maxima agrees with it. 

 which way is it? 

 maxima session: 
 (%i12) p1:(x2)*(x3-x4);p2:x2*(x3-2*x4); 
 (%i14) resultant(p1,p2,x1); 
 (%o14) 1 


In this case, there is no evaluation of x1 in the algbebraic closure of 
QQ(x2,x3,x4) that makes both polynomials zero.
 

 (%i15) resultant(p1,p2,x2); 
 (%o15) 0


In this case, there is a common root in the algebraic closure of 
QQ(x1,x3,x4), namely x2=0

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




Re: [sage-support] Strange results with multivariate resultants

2012-09-20 Thread Dima Pasechnik


On Thursday, 20 September 2012 19:05:56 UTC+8, Georgi Guninski wrote:

 pari disagrees with sage and maxima agrees with it. 

 which way is it? 

 maxima session: 
 (%i12) p1:(x2)*(x3-x4);p2:x2*(x3-2*x4); 
 (%i14) resultant(p1,p2,x1); 
 (%o14) 1 
 (%i15) resultant(p1,p2,x2); 
 (%o15) 0 

 On Wed, Sep 19, 2012 at 07:34:46AM +0300, Georgi Guninski wrote: 
  Hi, 
  
  I may be missing something, but the resultant = 1 confuses me. 


I bet the confusion comes from the fact the Sylvester matrix in this case 
is empty.
Whether an empty matrix has determinant 0, or 1, it's a deep question :–)
Note that in the ring of empty matrices, 0 equals 1, so in this sense it's 
OK...

sage: K.x1,x2,x3,x4=QQ[] 
sage: p1,p2=(x2)*(x3-x4),x2*(x3-2*x4)
sage: p1.sylvester_matrix(p2,x1)
[]
sage: p1.sylvester_matrix(p2,x1).det()
1


 

  According to wikipedia [1] 
  the multivariate resultant or Macaulay's resultant of n homogeneous 
 polynomials in n variables is a polynomial in their coefficients that 
 vanishes when they have a common non-zero solution 
  My pain is $1$ can't vanish while solutions exist. 
  
  Here is homogeneous example: 
  sage: K.x1,x2,x3,x4=QQ[] 
  sage: p1,p2=(x2)*(x3-x4),x2*(x3-2*x4) 
  sage: p1.resultant(p2,x1) 
  1 
  
  Certainly p1 and p2 have common solutions while the res. w.r.t. 
  x1 never vanishes (got this in a real world situation). 
  
  On the same example pari/gp returns 0: 
  ? p1=(x2)*(x3-x4);p2=x2*(x3-2*x4);polresultant(p1,p2,x1) 
  %5 = 0 
  
  
  [1]: 
  http://en.wikipedia.org/w/index.php?title=Resultantoldid=511538674 
  
  


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




Re: [sage-support] Strange results with multivariate resultants

2012-09-20 Thread Georgi Guninski
Thanks all for the replies.

Pari devs acknowledged their bug and fixed it in trunk here:

http://pari.math.u-bordeaux.fr/archives/pari-dev-1209/msg00034.html


On Thu, Sep 20, 2012 at 09:45:14AM -0700, Dima Pasechnik wrote:
 
 
 On Thursday, 20 September 2012 19:05:56 UTC+8, Georgi Guninski wrote:
 
  pari disagrees with sage and maxima agrees with it. 
 
  which way is it? 
 
  maxima session: 
  (%i12) p1:(x2)*(x3-x4);p2:x2*(x3-2*x4); 
  (%i14) resultant(p1,p2,x1); 
  (%o14) 1 
  (%i15) resultant(p1,p2,x2); 
  (%o15) 0 
 
  On Wed, Sep 19, 2012 at 07:34:46AM +0300, Georgi Guninski wrote: 
   Hi, 
   
   I may be missing something, but the resultant = 1 confuses me. 
 
 
 I bet the confusion comes from the fact the Sylvester matrix in this case 
 is empty.
 Whether an empty matrix has determinant 0, or 1, it's a deep question :–)
 Note that in the ring of empty matrices, 0 equals 1, so in this sense it's 
 OK...
 
 sage: K.x1,x2,x3,x4=QQ[] 
 sage: p1,p2=(x2)*(x3-x4),x2*(x3-2*x4)
 sage: p1.sylvester_matrix(p2,x1)
 []
 sage: p1.sylvester_matrix(p2,x1).det()
 1
 
 
  
 
   According to wikipedia [1] 
   the multivariate resultant or Macaulay's resultant of n homogeneous 
  polynomials in n variables is a polynomial in their coefficients that 
  vanishes when they have a common non-zero solution 
   My pain is $1$ can't vanish while solutions exist. 
   
   Here is homogeneous example: 
   sage: K.x1,x2,x3,x4=QQ[] 
   sage: p1,p2=(x2)*(x3-x4),x2*(x3-2*x4) 
   sage: p1.resultant(p2,x1) 
   1 
   
   Certainly p1 and p2 have common solutions while the res. w.r.t. 
   x1 never vanishes (got this in a real world situation). 
   
   On the same example pari/gp returns 0: 
   ? p1=(x2)*(x3-x4);p2=x2*(x3-2*x4);polresultant(p1,p2,x1) 
   %5 = 0 
   
   
   [1]: 
   http://en.wikipedia.org/w/index.php?title=Resultantoldid=511538674 
   
   
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

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