[sage-support] Re: intersection points of circles - irritating

2010-03-10 Thread ma...@mendelu.cz
fixed at http://trac.sagemath.org/sage_trac/ticket/8487

R.M.

On 9 bře, 05:26, Markus markus_la...@gmx.net wrote:
 Hi,

 when trying to compute the intersection points of 2 circles i got
 strange results.

 Example 1:

 c1(x,y)=(x-5)^2+y^2-25; c2(x,y)=(y-3)^2+x^2-9
 solve([c1(x,y)==0,c2(x,y)==0],x,y)

 produces the expected result:

 [[x == (45/17), y == (75/17)], [x == 0, y == 0]]

 Example 2:
 (circle 1 smaller)

 c1(x,y)=(x-5)^2+y^2-16; c2(x,y)=(y-3)^2+x^2-9
 solve([c1(x,y)==0,c2(x,y)==0],x,y)

 produces the unexpected result:

 []

 whereas intersection points do exist, e.g.
 x=(-9(sqrt(55)-15)/68, y=(-3(sqrt(55)-41)/68

 Is it because Example 1 has a rational result, whereas Examples 2 has
 an irrational one?

 Thanks for any help.

 Markus

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] clifford algebras etc.

2010-03-10 Thread karl . landsteiner

 

 Hi,

I am currently trying to switch from commercial CAS to sage. 
As a physicist I need to handle non-commutative algebras, most notably Clifford 
algebras.
I have read that GiNaC is pretty good in that and that sage is using a variant 
called Pynac.
Does Pynac have the non-commutative algebras which are extensively used in 
theoretical 
high energy physics: Clifford algebras, SU(3) Lie algebras, and Lorentz 
tensors. (quotes from 
the Wikipaedia article on GiNaC) ? 




-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Xelatex and Sage notebook

2010-03-10 Thread ma...@mendelu.cz
Hi, is already http://trac.sagemath.org/sage_trac/ticket/8472

R.M.

On 10 bře, 08:51, Kwankyu ekwan...@gmail.com wrote:
 Hi Dan,

 I worked on this. Would you review Trac 8486?

 http://trac.sagemath.org/sage_trac/ticket/8486

 Thank you in advance.

 Kwankyu

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Can I factor x^2 - 2 and get (x-sqrt(2))*(x+sqrt(2)) ?

2010-03-10 Thread slabbe
Hi,

A friend of mine wants to factorize symbolicly x^2 - 2 :

sage: p = x^2 - 2
sage: p.factor()
x^2 - 2

Apparently p.roots() gives almost what he wants :

sage: p.roots()
[(-sqrt(2), 1), (sqrt(2), 1)]

So, I just proposed him to do :

sage: Factorization([(x-r,m) for r,m in p.roots()])
(x - sqrt(2)) * (x + sqrt(2))

Do any of you have a better solution?

Thank you,

Sébastien Labbé, Montpellier

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Symmetric group: bug with trivial cycle

2010-03-10 Thread vdelecroix
Hello,

I get a strange error while constructing permutation from a cycle
decomposition. Is it a bug or not the right way to build a
permutation ?

{{{
sage: G = SymmetricGroup(3)
sage: G([(2,3), (1,)])
(2,3)
sage: G([(1,), (2,3)])
---
TypeError Traceback (most recent call
last)

[...]

TypeError: Gap produced error output
Syntax error: ; expected
$sage8:=(1)(2, 3);;
   ^

   executing $sage8:=(1)(2, 3);;
}}}

(the same error occurs by using the constructor
PermutationGroupElement instead of G)

Vincent

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] 3D plot in sage

2010-03-10 Thread wxuyec
Hi everyone,I want do this thing as follows in sage, is that 
OK?var('x,y,z')f=cos(x)*cos(y)+cos(y)*cos(z)+cos(z)*cos(x)and then I want to 
plot f. how can do it in sage?Thanks in advance!regards,YC

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: 3D plot in sage

2010-03-10 Thread John H Palmieri
On Mar 10, 9:39 am, wxu...@sohu.com wrote:
 Hi everyone,I want do this thing as follows in sage, is that 
 OK?var('x,y,z')f=cos(x)*cos(y)+cos(y)*cos(z)+cos(z)*cos(x)and then I want to 
 plot f. how can do it in sage?Thanks in advance!regards,YC

Isn't this a 4d plot?  Or do you want to plot f(x,y,z)=0?   In that
case, you could do

sage: implicit_plot3d(f == 0, (x, -2, 2), (y, -2, 2), (z, -2, 2))

--
John

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Can I factor x^2 - 2 and get (x-sqrt(2))*(x+sqrt(2)) ?

2010-03-10 Thread John H Palmieri
On Mar 10, 3:23 am, slabbe sla...@gmail.com wrote:
 Hi,

 A friend of mine wants to factorize symbolicly x^2 - 2 :

 sage: p = x^2 - 2
 sage: p.factor()
 x^2 - 2

 Apparently p.roots() gives almost what he wants :

 sage: p.roots()
 [(-sqrt(2), 1), (sqrt(2), 1)]

Or

sage: p.roots(multiplicities=False)
[-sqrt(2), sqrt(2)]

 So, I just proposed him to do :

 sage: Factorization([(x-r,m) for r,m in p.roots()])
 (x - sqrt(2)) * (x + sqrt(2))

 Do any of you have a better solution?

How about:

sage: S.y = PolynomialRing(QQ[sqrt(2)])
sage: p = y^2 - 2
sage: p.factor()
(y - sqrt2) * (y + sqrt2)

(I don't know why it says sqrt2 instead of sqrt(2).)

--
John

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Can I factor x^2 - 2 and get (x-sqrt(2))*(x+sqrt(2)) ?

2010-03-10 Thread Robert Bradshaw

On Mar 10, 2010, at 10:15 AM, John H Palmieri wrote:


On Mar 10, 3:23 am, slabbe sla...@gmail.com wrote:

Hi,

A friend of mine wants to factorize symbolicly x^2 - 2 :

sage: p = x^2 - 2
sage: p.factor()
x^2 - 2

Apparently p.roots() gives almost what he wants :

sage: p.roots()
[(-sqrt(2), 1), (sqrt(2), 1)]


Or

sage: p.roots(multiplicities=False)
[-sqrt(2), sqrt(2)]


So, I just proposed him to do :

sage: Factorization([(x-r,m) for r,m in p.roots()])
(x - sqrt(2)) * (x + sqrt(2))

Do any of you have a better solution?


How about:

sage: S.y = PolynomialRing(QQ[sqrt(2)])
sage: p = y^2 - 2
sage: p.factor()
(y - sqrt2) * (y + sqrt2)

(I don't know why it says sqrt2 instead of sqrt(2).)


That is because this is a number field, and generator names are  
supposed to be atomic.


- Robert

--
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] saving data from interact

2010-03-10 Thread D. Monarres
Hello all,

I am using a sage notebook interact to generate and display some
random graphs  (more specifically a self-created extension of the
graph class with extra properties) and would like to have the chance
to save the output. Usually the notebook makes all defined variables
global and I can specifically save certain results, but since I have
defined my interact as a function all of the objects created seem to
be local and disappear when the interact is finished. (other than for
the graph output) I have tried to pickle the objects and save to a
file but sage doesn't seem to allow me to pickle self defined classes.
I was wondering if there was a standard way that people work around
this. Thank you in advance for your help, sage is a wonderful piece of
software.

David Monarres

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] saving data from interact

2010-03-10 Thread William Stein
On Wed, Mar 10, 2010 at 11:17 AM, D. Monarres dmmonar...@gmail.com wrote:
 Hello all,

 I am using a sage notebook interact to generate and display some
 random graphs  (more specifically a self-created extension of the
 graph class with extra properties) and would like to have the chance
 to save the output. Usually the notebook makes all defined variables
 global and I can specifically save certain results, but since I have
 defined my interact as a function all of the objects created seem to
 be local and disappear when the interact is finished. (other than for
 the graph output) I have tried to pickle the objects and save to a
 file but sage doesn't seem to allow me to pickle self defined classes.
 I was wondering if there was a standard way that people work around
 this. Thank you in advance for your help, sage is a wonderful piece of
 software.

 David Monarres

This is easy.  Just use the global keyword in Python.Here's an example:

  http://sagenb.org/home/pub/1757/


William


 --
 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
 For more options, visit this group at 
 http://groups.google.com/group/sage-support
 URL: http://www.sagemath.org




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] plot3d in notebook generates no plot

2010-03-10 Thread Eckhard Kosin
Hi all,

I just installed Sage and now I'm working through the tutorial.
However, inside notebook I'm unable to generate 3d plots: Issuing i.e.

x,y = var('x,y')
plot3d(x^2 + y^2, (x,-2,2), (y,-2,2))

only yields a gray square without any plots.  At the right lower corner
of the square there is a link Get Image, but clicking on it do not get
the image but jumps the top of the current worksheet (the address of the
link is http://localhost:8000/home/admin/3/#;).

On the Sage command line plot3d works, a Jmol window pops up showing the
graphic.  Also inside notebook plot3d(..., viewer='tachyon') works.

Java (OpenJDK) is installed and enabled in the browser.

In this group, there was a thread 
http://groups.google.com/group/sage-support/browse_thread/thread/150340666982775/ad08c6a84218c53f?lnk=gstq=plot3d+notebook#ad08c6a84218c53f
describing the same issue, but without giving any solution.

My system:

Dell Optiplex GX620, Intel Pentium 630, 1GB RAM

:~$ uname -a
Linux Adler 2.6.24-27-generic #1 SMP Mon Feb 22 18:17:28 UTC 2010 x86_64
GNU/Linux

:~$ lsb_release -d
Description:Ubuntu 8.04.4 LTS

:~$ sage --version
| Sage Version 4.3.3, Release Date: 2010-02-21   |

installed tar ball:
sage-4.3.3-linux-64bit-ubuntu_8.04.4_lts-x86_64-Linux.tar.gz 

:~$ java -version
java version 1.6.0_0
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)

:~$ firefox --version
Mozilla Firefox 3.0.18, Copyright (c) 1998 - 2010 mozilla.org


Any help is appreciated.  Thanks in advance

 Eckhard

-- 
  Service für Mathematik und Simulation
  Dr. Eckhard Kosin, selbständiger Diplom-Mathematiker

  Am Nymphenbad 14
D-81245 München, Germany

  Tel.: (+49)(+89) 88 88 479
  Tel.,Fax: (+49)(+89) 835 844
  mailto:e...@mathematik-service-kosin.de
  http://www.mathematik-service-kosin.de

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: saving data from interact

2010-03-10 Thread D. Monarres
Thank you very much, that was a great help.  Is there a way to pickle
user defined types? So that I can, say, email my advisor files
containing the sage objects.



On Mar 10, 11:25 am, William Stein wst...@gmail.com wrote:
 On Wed, Mar 10, 2010 at 11:17 AM, D. Monarres dmmonar...@gmail.com wrote:
  Hello all,

  I am using a sage notebook interact to generate and display some
  random graphs  (more specifically a self-created extension of the
  graph class with extra properties) and would like to have the chance
  to save the  output. Usually the notebook makes all defined variables
  global and I can specifically save certain results, but since I have
  defined my interact as a function all of the objects created seem to
  be local and disappear when the interact is finished. (other than for
  the graph output) I have tried to pickle the objects and save to a
  file but sage doesn't seem to allow me to pickle self defined classes.
  I was wondering if there was a standard way that people work around
  this. Thank you in advance for your help, sage is a wonderful piece of
  software.

  David Monarres

 This is easy.  Just use the global keyword in Python.    Here's an example:

  http://sagenb.org/home/pub/1757/

 William



  --
  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
  For more options, visit this group 
  athttp://groups.google.com/group/sage-support
  URL:http://www.sagemath.org

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] plot3d in notebook generates no plot

2010-03-10 Thread Robert Bradshaw

On Mar 10, 2010, at 11:53 AM, Eckhard Kosin wrote:


Hi all,

I just installed Sage and now I'm working through the tutorial.
However, inside notebook I'm unable to generate 3d plots: Issuing i.e.

x,y = var('x,y')
plot3d(x^2 + y^2, (x,-2,2), (y,-2,2))

only yields a gray square without any plots.  At the right lower  
corner
of the square there is a link Get Image, but clicking on it do not  
get
the image but jumps the top of the current worksheet (the address of  
the

link is http://localhost:8000/home/admin/3/#;).

On the Sage command line plot3d works, a Jmol window pops up showing  
the

graphic.  Also inside notebook plot3d(..., viewer='tachyon') works.

Java (OpenJDK) is installed and enabled in the browser.


Do the demos at http://jmol.sourceforge.net/demo/ work for you?

- Robert


--
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Typesetting bug

2010-03-10 Thread Gustav Delius
There is a surprising typesetting bug in the sage 4.3.3 notebook
interface, as it is running on sagenb.org, for example. If the Typset
checkbox is ticked and one evaluates something like

6.5/x

one gets

1/x

So any floating point number is convered to 1 when it is divided by a
symbolic variable. When the Typeset checkbox is unchecked, the correct
6.50/x is returned.

To reproduce this, just open a worksheet and check the Typeset box and
enter 6.5/x or take a look at http://www.sagenb.org/home/pub/1758

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Typesetting bug

2010-03-10 Thread Harald Schilly
On Mar 10, 9:27 pm, Gustav Delius gustav.del...@gmail.com wrote:
 There is a surprising typesetting bug ...

http://trac.sagemath.org/sage_trac/ticket/8491

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Typesetting bug

2010-03-10 Thread Burcin Erocal
On Wed, 10 Mar 2010 12:35:28 -0800 (PST)
Harald Schilly harald.schi...@gmail.com wrote:

 On Mar 10, 9:27 pm, Gustav Delius gustav.del...@gmail.com wrote:
  There is a surprising typesetting bug ...
 
 http://trac.sagemath.org/sage_trac/ticket/8491

Indeed this is very embarrassing. I can't believe I missed this, or
it wasn't caught by any doctest.

The cause is the broken py_numer() function in sage/symbolic/pynac.pyx.
I will post a patch shortly.


Thanks.

Burcin

-- 
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
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: bug in Sage's interface to Singular?

2010-03-10 Thread Alex Raichev
Hi all:

It looks like working with polynomial rings over transcendental field
extensions still doesn't work in Sage.  Am i doing something wrong
below?  The same computation works in Singular, giving the correct
answer of the ideal generated by x*y.  Should i submit a Trac ticket
for this?  It appears someone has taken a look at the issue since i
last reported it, because this time there's a new error.

Alex

--
| Sage Version 4.3.3, Release Date: 2010-02-21   |
| Type notebook() for the GUI, and license() for information.|
--
The Sage install tree may have moved.
Regenerating Python.pyo and .pyc files that hardcode the install PATH
(please wait at most a few minutes)...
Do not interrupt this.

sage: R0.q = PolynomialRing(QQ); R0
Univariate Polynomial Ring in q over Rational Field
sage: k= FractionField(R0); k
Fraction Field of Univariate Polynomial Ring in q over Rational Field
sage: R.x,y = PolynomialRing(k); R
Multivariate Polynomial Ring in x, y over Fraction Field of Univariate
Polynomial Ring in q over Rational Field
sage: I = R.ideal((q*x*y)^2); I
Ideal (q^2*x^2*y^2) of Multivariate Polynomial Ring in x, y over
Fraction Field of Univariate Polynomial Ring in q over Rational Field
sage: I.radical()
---
TypeError Traceback (most recent call
last)

/Users/arai021/ipython console in module()

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/
polynomial/multi_polynomial_ideal.py in __call__(self, *args, **kwds)
405 if not R.base_ring().is_field():
406 raise ValueError(Coefficient ring must be a field
for function '%s'.%(self.f.__name__))
-- 407 return self.f(self._instance, *args, **kwds)
408
409 require_field = RequireField

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/
polynomial/multi_polynomial_ideal.py in wrapper(*args, **kwds)
367 
368 with RedSBContext():
-- 369 return func(*args, **kwds)
370
371 from sage.misc.sageinspect import sage_getsource

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/
polynomial/multi_polynomial_ideal.py in radical(self)
   1397 import sage.libs.singular
   1398 radical = sage.libs.singular.ff.primdec__lib.radical
- 1399 r = radical(self)
   1400
   1401 S = self.ring()

/Applications/sage/local/lib/python2.6/site-packages/sage/libs/
singular/function.so in
sage.libs.singular.function.SingularFunction.__call__ (sage/libs/
singular/function.cpp:9628)()

TypeError: Cannot call Singular function 'radical' with ring parameter
of type 'class
'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain''






On Jan 15, 2:58 pm, Alex Raichev tortoise.s...@gmail.com wrote:
 Hi all:

 I'm trying to get Sage to compute in a multivariate polynomial ring
 over a transcendental field extension but am running into
 difficulties.  For example, Sage crashes when trying to compute a
 radical ideal as demonstrated by the example below.  I tried the same
 example in Singular, which gave me the correct answer (the ideal
 generated by x*y).

 So is the failure below a Singular interface bug or am i doing
 something wrong?  I suspect Singular doesn't like Sage's fraction
 field construction of a transcendental extension.

 Alex

 --
 | Sage Version 4.3, Release Date: 2009-12-24                         |
 | Type notebook() for the GUI, and license() for information.        |
 --
 WARNING: There is one major unsolved bug in some versions of
 Sage on OS X 10.6 that causes an 'Abort trap' crash when
 doing certain symbolic computations.
 Seehttp://trac.sagemath.org/sage_trac/ticket/7095/.
 sage: R0.q = PolynomialRing(QQ); R0
 Univariate Polynomial Ring in q over Rational Field
 sage: k= FractionField(R0); k
 Fraction Field of Univariate Polynomial Ring in q over Rational Field
 sage: R.x,y = PolynomialRing(k); R
 Multivariate Polynomial Ring in x, y over Fraction Field of Univariate
 Polynomial Ring in q over Rational Field
 sage: R.x,y = PolynomialRing(k); R
 Multivariate Polynomial Ring in x, y over Fraction Field of Univariate
 Polynomial Ring in q over Rational Field
 sage: I = R.ideal((q*x*y)^2); I
 Ideal (q^2*x^2*y^2) of Multivariate Polynomial Ring in x, y over
 Fraction Field of Univariate Polynomial Ring in q over Rational Field
 sage: I.radical()
 ---
 RuntimeError                              Traceback (most recent call
 last)

 /Users/arai021/ipython console in module()

 

[sage-support] can't factor a symbolic expression with Laplace transforms

2010-03-10 Thread Dan Drake
Hello,

I'm trying to factor a symbolic expression with Laplace transforms in
it:

sage: var('s t')
(s, t)
sage: y = function('y', t)
sage: lt = laplace(diff(y, t,t) - 3*diff(y, t) + 2*y , t, s)
sage: lt
s^2*laplace(y(t), t, s) - 3*s*laplace(y(t), t, s) - s*y(0) +
2*laplace(y(t), t, s) + 3*y(0) - D[0](y)(0)
sage: lt.factor()
[boom]

It ultimately complains about IndexError: tuple index out of range.
I'd like to see something like

laplace(y(t), t, s)*(s^2 - 3*s + 2) + 3*y(0) - D[0](y)(0)

and to hopefully get solve() to solve for laplace(y(t), t, s). Is this
possible?

Dan

-- 
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature