[sage-support] Korean characters in TinyMCE

2009-03-19 Thread Kwankyu

Hi,

If I write in Korean and save in the TinyMCE editor in the Sage
Notebook, it appears fine. But if I open the cell to change the
content, then the Korean characters are all gone and strange
characters are shown instead. Perhaps an encoding problem. I was not
sure where to ask about this problem. Should I ask to the TinyMCE
site?


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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why does import not work?

2009-03-19 Thread Simon King

Dear Robert,

On Mar 19, 4:01 am, Robert Bradshaw rober...@math.washington.edu
wrote:
 I would guess you have a circular import issue going on here when you
 try to put it in the Sage library. Unfortunately, I don't have an
 easy solution other than trying to be very careful about what you are
 importing in your files.

How can a cycle be avoided? Perhaps I could try to import only the
very essentials at the beginning of the file, and to have the
remaining import statements only inside the methods. E.g., when I
construct a polynomial ring in a method ``foo``, I could import ``from
sage.rings.polynomial.polynomial_ring_constructor import
PolynomialRing`` there, rather than on module level.

Does this make sense?
Thank you!
   Simon
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why does import not work?

2009-03-19 Thread Robert Bradshaw

On Mar 19, 2009, at 12:04 AM, Simon King wrote:

 Dear Robert,

 On Mar 19, 4:01 am, Robert Bradshaw rober...@math.washington.edu
 wrote:
 I would guess you have a circular import issue going on here when you
 try to put it in the Sage library. Unfortunately, I don't have an
 easy solution other than trying to be very careful about what you are
 importing in your files.

 How can a cycle be avoided? Perhaps I could try to import only the
 very essentials at the beginning of the file, and to have the
 remaining import statements only inside the methods. E.g., when I
 construct a polynomial ring in a method ``foo``, I could import ``from
 sage.rings.polynomial.polynomial_ring_constructor import
 PolynomialRing`` there, rather than on module level.

Yes, you could do that.

For example, that you're trying to put these into the  
sage.rings.polynomial.all module, you can't import anything from  
sage.rings.polynomial.all (or anything that indirectly imports from  
there). Currently things are messier than they should be. See, e.g.,  
http://trac.sagemath.org/sage_trac/ticket/4986

- 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why does import not work?

2009-03-19 Thread Simon King

Dear Robert,

On Mar 19, 8:11 am, Robert Bradshaw rober...@math.washington.edu
wrote:

 For example, that you're trying to put these into the
 sage.rings.polynomial.all module, you can't import anything from
 sage.rings.polynomial.all

Ok, that answers my original question, since I use PolynomialRing in
my module.

Thank you very much,
  Simon

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Dan Drake
On Wed, 18 Mar 2009 at 11:00PM -0700, Kwankyu wrote:
 If I write in Korean and save in the TinyMCE editor in the Sage
 Notebook, it appears fine. But if I open the cell to change the
 content, then the Korean characters are all gone and strange
 characters are shown instead. Perhaps an encoding problem. I was not
 sure where to ask about this problem. Should I ask to the TinyMCE
 site?

I can confirm this. If I type 안녕하세요! (Hello!), save, and edit, I
get 안녕하세요!

If I save that, it gets displayed the same way, and then if I edit
again, I get 

안녕하세요!

(See https://sagenb.kaist.ac.kr:8066/home/pub/4 to see this in the
notebook.)

My (wild and uneducated) guess is that this is related to some sort of
escaping issue, in the same spirit as #4851.

Dan

-- 
---  Dan Drake dr...@kaist.edu
-  KAIST Department of Mathematical Sciences
---  http://mathsci.kaist.ac.kr/~drake


signature.asc
Description: Digital signature


[sage-support] creating symbolic variables.

2009-03-19 Thread Jose Guzman

This is apparently a very easy question, but I am new to the mathematics 
computing environment and it will take me some time to become familiar 
with Sage. The question is the following; Are these two expressions 
similar?

sage: a,b,c = var('a,b,c')

sage: var('a,b,c')

If not, when should I use one or another?

In the documentation regarding the substitute method and when  I checked the 
examples I noticed that they show:

sage: x,y,t = var('x,y,t')

I guess this is not necessary because Sage considers by default x as a 
symbolic variable, isn't it?

Thanks in advance.

Jose.

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread ma...@mendelu.cz

Hello, the same is with Czech. Seems to be related to
http://groups.google.cz/group/sage-support/browse_thread/thread/60a863def66c05a1/ca1626cc03a29bfa?lnk=gstq=accent#ca1626cc03a29bfa
and reported on http://trac.sagemath.org/sage_trac/ticket/4956

Robert

On 19 Bře, 08:27, Dan Drake dr...@kaist.edu wrote:
 On Wed, 18 Mar 2009 at 11:00PM -0700, Kwankyu wrote:
  If I write in Korean and save in the TinyMCE editor in the Sage
  Notebook, it appears fine. But if I open the cell to change the
  content, then the Korean characters are all gone and strange
  characters are shown instead. Perhaps an encoding problem. I was not
  sure where to ask about this problem. Should I ask to the TinyMCE
  site?

 I can confirm this. If I type 안녕하세요! (Hello!), save, and edit, I
 get 안녕하세요!

 If I save that, it gets displayed the same way, and then if I edit
 again, I get

 안녕하세요!

 (Seehttps://sagenb.kaist.ac.kr:8066/home/pub/4to see this in the
 notebook.)

 My (wild and uneducated) guess is that this is related to some sort of
 escaping issue, in the same spirit as #4851.

 Dan

 --
 ---  Dan Drake dr...@kaist.edu
 -  KAIST Department of Mathematical Sciences
 ---  http://mathsci.kaist.ac.kr/~drake

  signature.asc
  1KZobrazitStáhnout
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread ma...@mendelu.cz

On 19 Bře, 07:00, Kwankyu ekwan...@gmail.com wrote:
 Hi,

 If I write in Korean and save in the TinyMCE editor in the Sage
 Notebook, it appears fine. But if I open the cell to change the
 content, then the Korean characters are all gone and strange
 characters are shown instead. Perhaps an encoding problem. I was not
 sure where to ask about this problem. Should I ask to the TinyMCE
 site?

The problem was before integrating TinyMCE. I think that this is
problem at Sage.

Robert


 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: creating symbolic variables.

2009-03-19 Thread Minh Nguyen

Hi Jose,

On Thu, Mar 19, 2009 at 7:49 AM, Jose Guzman n...@neurohost.org wrote:

 This is apparently a very easy question, but I am new to the mathematics
 computing environment and it will take me some time to become familiar
 with Sage. The question is the following; Are these two expressions
 similar?

 sage: a,b,c = var('a,b,c')

 sage: var('a,b,c')

 If not, when should I use one or another?

Both of the expressions above are more or less the same in that they
produce the same result, i.e. declaring three symbolic variables. But
note these points. If you do

[1]
sage: a,b,c = var(a,b,c)

then it results in what you expect: namely, declaring the three
specified symbolic variables. Now if you do

[2]
sage: var(a,b,c)
(a, b, c)

Sage does the same thing, but this time the three symbolic variables
are printed to your terminal. The last command actually returns a
tuple of three symbolic variables, so it makes sense to do as per [1].
In Python, command [1] technically unpacks the tuple elements and
store them in the variable names to the left of the equal sign. But if
you do as in [2], then the required symbolic variables would have been
declared even if you don't explicitly store the tuple elements: note
this

sage: var(a,b,c)
(a, b, c)
sage: type(a); type(b); type(c)
class 'sage.calculus.calculus.SymbolicVariable'
class 'sage.calculus.calculus.SymbolicVariable'
class 'sage.calculus.calculus.SymbolicVariable'

Also, if you like command [2] because it's less to type on the
keyboard, then by all means do it. And if you don't want to see the
returned tuple of symbolic variables, you can do this:

sage: var(a,b,c);

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] determinants of matrix polynomials

2009-03-19 Thread Chris Godsil

I want to compute determinants of matrix polynomials, for matrices up  
to 20 x 20, say.
The attached transcript seems to indicate 9 or 10 might be my limit.   
(Or it's late
and I am being stupd?)

--
| Sage Version 3.4, Release Date:  
2009-03-11 |
| Type notebook() for the GUI, and license() for information.|
--
# intel mac pro, binary distribution

sage: P = graphs.PetersenGraph()
sage: P.delete_edge([0,1])
sage: P.degree()
[2, 2, 3, 3, 3, 3, 3, 3, 3, 3]
sage: P
Petersen graph: Graph on 10 vertices ## but P is not the Petersen  
graph now
sage: A = P.am()
sage: Id = identity_matrix(10)
sage: R.t = QQ[]
sage: (t+1)^5
t^5 + 5*t^4 + 10*t^3 + 10*t^2 + 5*t + 1
sage: M = t*Id - A; M

[ t  0  0  0 -1 -1  0  0  0  0]
[ 0  t -1  0  0  0 -1  0  0  0]
[ 0 -1  t -1  0  0  0 -1  0  0]
[ 0  0 -1  t -1  0  0  0 -1  0]
[-1  0  0 -1  t  0  0  0  0 -1]
[-1  0  0  0  0  t  0 -1 -1  0]
[ 0 -1  0  0  0  0  t  0 -1 -1]
[ 0  0 -1  0  0 -1  0  t  0 -1]
[ 0  0  0 -1  0 -1 -1  0  t  0]
[ 0  0  0  0 -1  0 -1 -1  0  t]
sage: M.det()  ## and sage hangs

## but the following worked
sage: K =graphs.CompleteGraph(3)
sage: B =K.am()
sage: Id = identity_matrix(3)
sage: (t*Id-B).det()
t^3 - 3*t - 2

sage: C = graphs.CubeGraph(3)
sage: C
3-Cube: Graph on 8 vertices
sage: Id = identity_matrix(8)
sage: (t*Id-C.am()).det()
t^8 - 12*t^6 + 30*t^4 - 28*t^2 + 9

# and the cycle on 9 vertices hangs


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Robert Bradshaw

On Mar 19, 2009, at 1:17 AM, Chris Godsil wrote:

 I want to compute determinants of matrix polynomials, for matrices up
 to 20 x 20, say.
 The attached transcript seems to indicate 9 or 10 might be my limit.
 (Or it's late and I am being stupd?)

It depends on what ring you're over.

sage: M = random_matrix(ZZ, 100); M
100 x 100 dense matrix over Integer Ring
sage: time M.det()
CPU times: user 0.06 s, sys: 0.00 s, total: 0.07 s
Wall time: 0.07 s
227532739129946890993919801650069690831259013161380617147968485792614242 
900489259103289021402067670696965272359625204046028722848602428730109991 
83429371192981564969154912060350722012918063477112770597042

There isn't optimized code for doing it over QQ[t], so that's why  
it's really slow. It looks like what you really want is the  
characteristic polynomial, which on matrices of this size should be  
virtually instantaneous.

sage: P = graphs.PetersenGraph()
sage: P.delete_edge([0,1])
sage: A = P.am()
sage: A.charpoly()
x^10 - 14*x^8 + 65*x^6 - 16*x^5 - 128*x^4 + 72*x^3 + 84*x^2 - 80*x + 16


 --
 | Sage Version 3.4, Release Date:
 2009-03-11 |
 | Type notebook() for the GUI, and license() for information.|
 --
 # intel mac pro, binary distribution

 sage: P = graphs.PetersenGraph()
 sage: P.delete_edge([0,1])
 sage: P.degree()
 [2, 2, 3, 3, 3, 3, 3, 3, 3, 3]
 sage: P
 Petersen graph: Graph on 10 vertices ## but P is not the Petersen
 graph now
 sage: A = P.am()
 sage: Id = identity_matrix(10)
 sage: R.t = QQ[]
 sage: (t+1)^5
 t^5 + 5*t^4 + 10*t^3 + 10*t^2 + 5*t + 1
 sage: M = t*Id - A; M

 [ t  0  0  0 -1 -1  0  0  0  0]
 [ 0  t -1  0  0  0 -1  0  0  0]
 [ 0 -1  t -1  0  0  0 -1  0  0]
 [ 0  0 -1  t -1  0  0  0 -1  0]
 [-1  0  0 -1  t  0  0  0  0 -1]
 [-1  0  0  0  0  t  0 -1 -1  0]
 [ 0 -1  0  0  0  0  t  0 -1 -1]
 [ 0  0 -1  0  0 -1  0  t  0 -1]
 [ 0  0  0 -1  0 -1 -1  0  t  0]
 [ 0  0  0  0 -1  0 -1 -1  0  t]
 sage: M.det()  ## and sage hangs

 ## but the following worked
 sage: K =graphs.CompleteGraph(3)
 sage: B =K.am()
 sage: Id = identity_matrix(3)
 sage: (t*Id-B).det()
 t^3 - 3*t - 2

 sage: C = graphs.CubeGraph(3)
 sage: C
 3-Cube: Graph on 8 vertices
 sage: Id = identity_matrix(8)
 sage: (t*Id-C.am()).det()
 t^8 - 12*t^6 + 30*t^4 - 28*t^2 + 9

 # and the cycle on 9 vertices hangs


 


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Minh Nguyen

Hi Chris,

On Thu, Mar 19, 2009 at 8:17 AM, Chris Godsil cgod...@uwaterloo.ca wrote:

 I want to compute determinants of matrix polynomials, for matrices up
 to 20 x 20, say.
 The attached transcript seems to indicate 9 or 10 might be my limit.
 (Or it's late
 and I am being stupd?)

 --
 | Sage Version 3.4, Release Date:
 2009-03-11 |
 | Type notebook() for the GUI, and license() for information.|
 --
 # intel mac pro, binary distribution

 sage: P = graphs.PetersenGraph()
 sage: P.delete_edge([0,1])
 sage: P.degree()
 [2, 2, 3, 3, 3, 3, 3, 3, 3, 3]
 sage: P
 Petersen graph: Graph on 10 vertices ## but P is not the Petersen
 graph now
 sage: A = P.am()
 sage: Id = identity_matrix(10)
 sage: R.t = QQ[]
 sage: (t+1)^5
 t^5 + 5*t^4 + 10*t^3 + 10*t^2 + 5*t + 1
 sage: M = t*Id - A; M

 [ t  0  0  0 -1 -1  0  0  0  0]
 [ 0  t -1  0  0  0 -1  0  0  0]
 [ 0 -1  t -1  0  0  0 -1  0  0]
 [ 0  0 -1  t -1  0  0  0 -1  0]
 [-1  0  0 -1  t  0  0  0  0 -1]
 [-1  0  0  0  0  t  0 -1 -1  0]
 [ 0 -1  0  0  0  0  t  0 -1 -1]
 [ 0  0 -1  0  0 -1  0  t  0 -1]
 [ 0  0  0 -1  0 -1 -1  0  t  0]
 [ 0  0  0  0 -1  0 -1 -1  0  t]
 sage: M.det()  ## and sage hangs

Well, it hangs for a while and then gives me this:

sage: M.det()
t^10 - 14*t^8 + 65*t^6 - 16*t^5 - 128*t^4 + 72*t^3 + 84*t^2 - 80*t + 16

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Kwankyu

Hi Robert,

Right. Korean texts are not saved properly even in evaluation cells. I
experimented on Sage 3.4

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Kwankyu

Hi Dan,

I see Ticket #4851 was fixed in Sage 3.3. But I found this problem in
Sage 3.4. Also Korean texts even in evaluation cells are not saved
properly. So... is someone working on this or is this a new bug?

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How to set up a macmini as a server?

2009-03-19 Thread Stan Schymanski

Check out this thread:

http://groups.google.com/group/sage-support/browse_thread/thread/b6d99cac522a3cd9/6b99c90b85b68d80?lnk=gstq=stan+server#6b99c90b85b68d80

In brief, William's instructions worked for me:


sage: notebook(address=ipaddress,port=8100,secure=True)

then from another computer on your network try to visit the web page

   https://ipaddress:8100

That's pretty much it, except for making accounts. To create accounts
you could temporarily do

  sage: notebook(address=ipaddress,port=8100,secure=True, accounts=True)

let people make accounts, then do

  sage: notebook(address=ipaddress,port=8100,secure=True,accounts=False)

so no new accounts can be created. 


I used it on our intranet, where I replaced ipaddress by the network 
name of my computer. It works great.

Stan

Calcifer wrote:
 Hi,

 I have downloaded Sage 3.4 to my MacMini running10.5.6.

 When I write notebook(), it starts as expected in a web broswer, but
 may not be accessible throu the local network.

 if I write the following, I get blank (white) pages both on the
 macmini and on the other computer, ie can not access Sage through
 either of the computers.
 notebook('local_notebook', port=8001, secure=True, address='',
 open_viewer=False, accounts=True)
 I found the above in one of posts, but don't really understand all of
 the expression.

 My aim is to be able to access Sage from any computer and that Sage is
 automatically starts up after a power failure.

 Have a nice day,
 T

 
   


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread kcrisman

Could this conceivably be a Unicode issue, i.e. that it's not
supported by the Sage notebook internally?  What file format does
worksheet.txt have - just ASCII?  That could explain why different
character sets, not just one or the other script, are having trouble.

- kcrisman
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Mike Hansen

Hello,

I put up a patch at #5564 which (along with the patches at #4547 and
#5211) fixes all of the issues at #2896, #1477, and #4956 for me.  It
could use some wider testing though.

--Mike
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] bug in region_plot

2009-03-19 Thread ma...@mendelu.cz

Hello, this command produces one half of a cirle, not 1/4 as excepted.
I think that this is a bug in sage 3.4

Robert

region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,
3),plot_points=100,incol='gray').show(aspect_ratio=1)


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: OS X Clickable application

2009-03-19 Thread Byungchul Cha


I must misunderstand something very trivial. I followed the steps
described at the release tour of Sage 3.3, except that I replaced 3.3
with 3.4, since I thought I was compiling sage-3.4. Compiling was
successful and when I did ./sage -bdist 3.4, I saw that this generated
a directory SAGE_ROOT/dist. But, in the directory I have a dmg file
and one subdirectory sage-3.4-i386-Darwin, which just looks like
another copy of SAGE_ROOT. I don't see any clickable Mac OS X app
anywhere, including in the disk image from the dmg file.

What am I missing?

Oh, btw, I'm using OS X 10.5.6. Thanks in advance.

On Mar 18, 9:50 pm, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi,

 On Thu, Mar 19, 2009 at 1:43 AM, Byungchul Cha cha3...@gmail.com wrote:

  I remember reading something about making a clickable sage application
  for mac os X. Can I now do such a thing with sage 3.4? If so, where I
  can find the instruction?

 The release tour of Sage 3.3 at

 http://mvngu.wordpress.com/2009/02/23/sage-33-released/

 contains instruction on making a clickable Mac OS X app. See
 especially the instructions under the heading Distribution on that
 page. If any of the three steps listed under that heading fail for
 your particular OS X version, please inform me.

 --
 Regards
 Minh Van Nguyen
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] weird behaviour when selecting a row/column from a matrix

2009-03-19 Thread Christophe Oosterlynck

Hi,

let me dive straight into my problem wit a simple example:

 a = identity_matrix(ZZ,2,2)
 a[0,0]
1

vs.

 a[:,0]
[1]
[0]
 a[:,0][0]
(1)

So when selecting an element from a matrix by first selecting a row
and selecting the wanted element in that new 'row object', I don't get
an element from ZZ but a FreeModuleElement.
Why is this happening? Is there a way to make my two actions behave
like selecting an element from the original matrix?

Thanks,

Christophe
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: bug in region_plot

2009-03-19 Thread Jason Grout

ma...@mendelu.cz wrote:
 Hello, this command produces one half of a cirle, not 1/4 as excepted.
 I think that this is a bug in sage 3.4
 
 Robert
 
 region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,
 3),plot_points=100,incol='gray').show(aspect_ratio=1)


I get a quarter-circle on my sage 3.4 and on sagenb.org.  Can you try on 
sagenb.org?

Also, can you open a fresh worksheet and try the above code, just to 
make sure it's not a bug with displaying old images?

Thanks,

Jason


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread ma...@mendelu.cz

Hello, I used the commands

hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
attachment/ticket/4547/trac_4547.patch)
hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
attachment/ticket/5211/trac_5211.patch)
hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
attachment/ticket/5564/trac_5564-1.patch)
hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
attachment/ticket/5564/trac_5564-2.patch)

but nothing changed. Are these commands correct?
Are these commands enough to apply patches?

Thank you. Robert.

On 19 Bře, 13:15, Mike Hansen mhan...@gmail.com wrote:
 Hello,

 I put up a patch at #5564 which (along with the patches at #4547 and
 #5211) fixes all of the issues at #2896, #1477, and #4956 for me.  It
 could use some wider testing though.

 --Mike
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread ma...@mendelu.cz

On 19 Bře, 16:55, ma...@mendelu.cz ma...@mendelu.cz wrote:
 Hello, I used the commands

 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/4547/trac_4547.patch)
 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/5211/trac_5211.patch)
 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/5564/trac_5564-1.patch)
 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/5564/trac_5564-2.patch)

 but nothing changed. Are these commands correct?
 Are these commands enough to apply patches?

Oops, I forgot build using   sage -b
After this commands Czech input works for me.

Thank you very much for the patches. 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Jason Grout

ma...@mendelu.cz wrote:
 Hello, I used the commands
 
 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/4547/trac_4547.patch)
 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/5211/trac_5211.patch)
 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/5564/trac_5564-1.patch)
 hg_sage.import_patch(http://trac.sagemath.org/sage_trac/raw-
 attachment/ticket/5564/trac_5564-2.patch)
 
 but nothing changed. Are these commands correct?
 Are these commands enough to apply patches?


You also need to rebuild sage.  Exit sage and do sage -br

Jason



 
 Thank you. Robert.
 
 On 19 Bře, 13:15, Mike Hansen mhan...@gmail.com wrote:
 Hello,

 I put up a patch at #5564 which (along with the patches at #4547 and
 #5211) fixes all of the issues at #2896, #1477, and #4956 for me.  It
 could use some wider testing though.

 --Mike
  
 


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: OS X Clickable application

2009-03-19 Thread William Stein

On Thu, Mar 19, 2009 at 6:46 AM, Byungchul Cha cha3...@gmail.com wrote:


 I must misunderstand something very trivial. I followed the steps
 described at the release tour of Sage 3.3, except that I replaced 3.3
 with 3.4, since I thought I was compiling sage-3.4. Compiling was
 successful and when I did ./sage -bdist 3.4, I saw that this generated
 a directory SAGE_ROOT/dist. But, in the directory I have a dmg file
 and one subdirectory sage-3.4-i386-Darwin, which just looks like
 another copy of SAGE_ROOT. I don't see any clickable Mac OS X app
 anywhere, including in the disk image from the dmg file.

 What am I missing?

I believe there were some bugs/kinks in the clickable app, so we still
aren't making it by default when one does sage -bdist.

William


 Oh, btw, I'm using OS X 10.5.6. Thanks in advance.

 On Mar 18, 9:50 pm, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi,

 On Thu, Mar 19, 2009 at 1:43 AM, Byungchul Cha cha3...@gmail.com wrote:

  I remember reading something about making a clickable sage application
  for mac os X. Can I now do such a thing with sage 3.4? If so, where I
  can find the instruction?

 The release tour of Sage 3.3 at

 http://mvngu.wordpress.com/2009/02/23/sage-33-released/

 contains instruction on making a clickable Mac OS X app. See
 especially the instructions under the heading Distribution on that
 page. If any of the three steps listed under that heading fail for
 your particular OS X version, please inform me.

 --
 Regards
 Minh Van Nguyen
 




-- 
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: bug in region_plot

2009-03-19 Thread Wilfried_Huss



On 19 Mrz., 16:47, Jason Grout jason-s...@creativetrax.com wrote:
 ma...@mendelu.cz wrote:
  Hello, this command produces one half of a cirle, not 1/4 as excepted.
  I think that this is a bug in sage 3.4

  Robert

  region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,
  3),plot_points=100,incol='gray').show(aspect_ratio=1)

 I get a quarter-circle on my sage 3.4 and on sagenb.org.  Can you try on
 sagenb.org?

This works:
sage: var('x,y')
sage: region_plot([y0,x0,x^2+y^23], (x, -3, 3), (y, -3,3))

But if one leaves out the variables, one gets an half circle:
sage: region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,3))

I've written a patch which fixes this:
http://trac.sagemath.org/sage_trac/ticket/5567

cheers,
Wilfried

 Also, can you open a fresh worksheet and try the above code, just to
 make sure it's not a bug with displaying old images?

 Thanks,

 Jason
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: bug in region_plot

2009-03-19 Thread ma...@mendelu.cz


On 19 Bře, 16:47, Jason Grout jason-s...@creativetrax.com wrote:
 ma...@mendelu.cz wrote:
  Hello, this command produces one half of a cirle, not 1/4 as excepted.
  I think that this is a bug in sage 3.4

  Robert

  region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,
  3),plot_points=100,incol='gray').show(aspect_ratio=1)

 I get a quarter-circle on my sage 3.4 and on sagenb.org.  Can you try on
 sagenb.org?


strange, I get half-circle on sagenb.org (started new worksheet,
published as http://sagenb.org/home/pub/385/  )

Robert

 Also, can you open a fresh worksheet and try the above code, just to
 make sure it's not a bug with displaying old images?

 Thanks,

 Jason
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: bug in region_plot

2009-03-19 Thread ma...@mendelu.cz



 This works:
 sage: var('x,y')
 sage: region_plot([y0,x0,x^2+y^23], (x, -3, 3), (y, -3,3))

 But if one leaves out the variables, one gets an half circle:
 sage: region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,3))

 I've written a patch which fixes 
 this:http://trac.sagemath.org/sage_trac/ticket/5567

 cheers,
 Wilfried


Many thanks, this explains the problem.
Thanks.
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] how to pull back an ideal by a canonical surjection ?

2009-03-19 Thread David Madore

Dear List,

I'm trying to do some algebraic geometrical / arithmetical computation
with Sage and I find myself stuck on the following dumb problem: if I
have an ideal J of a quotient ring R/I (where R is a polynomial ring
and I some ideal of it), I wish to construct the ideal of R (called
p^{-1}(J) or perhaps even simply I+J) which is obtained by pulling
back J by the canonical map p:R-R/I.  This presents no algorithmic
difficulty, since I is given by generators (in R), and J is also given
by generators (in R/I, but they are themselves represented by elements
of R) and it is just a question of taking the union of these lists of
generators (seeing those of J in R/I as arbitrary representatives in
R) to obtain the desired idea.  Unfortunately, this doesn't seem to
work (probably because Sage doesn't know how to handle the canonical
surjection specially?):

vega david /usr/local/src/sage-3.4 $ ./sage
--
| Sage Version 3.4, Release Date: 2009-03-11 |
| Type notebook() for the GUI, and license() for information.|
--
sage: R.x,y = QQ['x','y']
sage: I = Ideal(y^2 - x^3 - x)
sage: Rq = R.quotient(I)
sage: p = R.hom(Rq)
sage: J = Ideal(p(y)-1)
sage: J
Ideal (ybar - 1) of Quotient of Multivariate Polynomial Ring in x, y over 
Rational Field by the ideal (-x^3 + y^2 - x)
sage: p.inverse_image(J)
---
NotImplementedError   Traceback (most recent call last)

/usr/src/local/sage-3.4/ipython console in module()

/usr/src/local/sage-3.4/local/lib/python2.5/site-packages/sage/rings/morphism.so
 in sage.rings.morphism.RingHomomorphism.inverse_image 
(sage/rings/morphism.c:3480)()

NotImplementedError: 
sage: whatiwantedwasthis = I + Ideal(y-1)
sage: whatiwantedwasthis
Ideal (-x^3 + y^2 - x, y - 1) of Multivariate Polynomial Ring in x, y over 
Rational Field
sage: p(whatiwantedwasthis)
Ideal (0, ybar - 1) of Quotient of Multivariate Polynomial Ring in x, y over 
Rational Field by the ideal (-x^3 + y^2 - x)
sage: p(whatiwantedwasthis) == J
True

By comparison, Macaulay2 does this:

vega david ~ $ /opt/Macaulay2-1.2-r8438/bin/M2 
Macaulay 2, version 1.2
with packages: Elimination, IntegralClosure, LLLBases, PrimaryDecomposition,
   ReesAlgebra, SchurRings, TangentCone

i1 : R = QQ[x,y]

o1 = R

o1 : PolynomialRing

i2 : I = ideal(y^2-x^3-x)

  32
o2 = ideal(- x  + y  - x)

o2 : Ideal of R

i3 : Rq = R/I

o3 = Rq

o3 : QuotientRing

i4 : p = map(Rq,R,matrix{{x,y}})

o4 = map(Rq,R,{x, y})

o4 : RingMap Rq --- R

i5 : J = ideal(y-1)

o5 = ideal(y - 1)

o5 : Ideal of Rq

i6 : preimage(p,J)

3
o6 = ideal (y - 1, x  + x - 1)

o6 : Ideal of R

i7 : use R; whatiwantedwasthis = I + ideal(y-1)

   32
o8 = ideal (- x  + y  - x, y - 1)

o8 : Ideal of R

i9 : o6 == whatiwantedwasthis

o9 = true

i10 : p(whatiwantedwasthis)

o10 = ideal (0, y - 1)

o10 : Ideal of Rq

i11 : p(whatiwantedwasthis) == J

o11 = true

(Unfortunately, I can't do my computations in Macaulay2 because I need
polynomial rings over number fields - the above example is in Q - and
it can't handle them.)

So, is there a way in Sage to pull back an ideal by a canonical map?

-- 
 David A. Madore
   ( http://www.madore.org/~david/ )

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Testing whether a function is always positive

2009-03-19 Thread PaulBurk

Hi all,

I'm working on a project, and my professor suggest I post a question
here.

I'm trying to use programs such as Mathematica, Maple and Sage to test
whether a function is always positive.  Maple has an is command,
which can be used to test some properties.  Sometimes it is
sufficient, other times it fails.

Does Sage have anything like an is command?  Is there any other way
to test if a function is always positve/negative?

Thanks

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Testing whether a function is always positive

2009-03-19 Thread ma...@mendelu.cz

Do you mean something like bool(x^6-1)

Or you can use maxima inside sage and the command  is
http://maxima.sourceforge.net/docs/manual/en/maxima_5.html#Item_003a-is

I think that in general  you can expect poor results in any computer
algebra system (like you write about Maple).

Robert


On 19 Bře, 15:51, PaulBurk paulburkan...@gmail.com wrote:
 Hi all,

 I'm working on a project, and my professor suggest I post a question
 here.

 I'm trying to use programs such as Mathematica, Maple and Sage to test
 whether a function is always positive.  Maple has an is command,
 which can be used to test some properties.  Sometimes it is
 sufficient, other times it fails.

 Does Sage have anything like an is command?  Is there any other way
 to test if a function is always positve/negative?

 Thanks
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: OS X Clickable application

2009-03-19 Thread mabshoff



On Mar 19, 9:35 am, William Stein wst...@gmail.com wrote:
 On Thu, Mar 19, 2009 at 6:46 AM, Byungchul Cha cha3...@gmail.com wrote:

  I must misunderstand something very trivial. I followed the steps
  described at the release tour of Sage 3.3, except that I replaced 3.3
  with 3.4, since I thought I was compiling sage-3.4. Compiling was
  successful and when I did ./sage -bdist 3.4, I saw that this generated
  a directory SAGE_ROOT/dist. But, in the directory I have a dmg file
  and one subdirectory sage-3.4-i386-Darwin, which just looks like
  another copy of SAGE_ROOT. I don't see any clickable Mac OS X app
  anywhere, including in the disk image from the dmg file.

  What am I missing?

 I believe there were some bugs/kinks in the clickable app, so we still
 aren't making it by default when one does sage -bdist.

 William

Run

   SAGE_APP_BUNDLE=yes; export SAGE_APP_BUNDLE

before -bdisting and there App bundle will be created. As William
mentioned due to bugs this is not done per default at the moment.

Cheers,

Michael
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: SSE4_1 errors when running sage 3.4

2009-03-19 Thread bix...@gmail.com

Hi,

I built sage from source and ran 'make test' on it. It failed on
sage -t  devel/sage/sage/plot/plot.py
sage -t  devel/sage/sage/symbolic/function.pyx
sage -t  devel/sage/sage/rings/polynomial/multi_polynomial.pyx
sage -t  devel/sage/sage/functions/constants.py
though the build documentation suggested that it was normal to fail on
a couple tests?

When I launch the version I compiled from source, it didn't give me
any warning about instruction sets. It appears to function exactly the
same as the binary I downloaded, once I removed the sage-flags.txt
file. So it seems that there is nothing wrong with the pre-built
version, though someone might want to look into why it claims to
require sse4_1 when it does not appear to need them (possibly it was
compiled on a machine with sse4 so it automatically assumes it is
needed?). Perhaps sse4 doesn't need to be listed in sage-flags.txt?

As for William Stein's comment, I watched memory usage as it tried to
compute pi(10^10), and it didn't rise noticeably before giving the seg
fault (it also only took a moment). Even if it is a memory issue,
doesn't sage have a more graceful and informative way to fail? I
wonder how pi(x) is computed in sage, it it is simply referencing a
pre-computed table of primes then perhaps the seg fault is an
indication that it went past the end of the table?

I looked at the entry in the tracker, what does prime_pi(k,40) do? I
thought that prime_pi was a function of a single variable, and when I
tried using it that way in sage it threw an error.

Thank you both for your help,

 - Ryan

On Mar 18, 3:20 pm, Johan Oudinet johan.oudi...@gmail.com wrote:
 On Wed, Mar 18, 2009 at 4:20 PM, bix...@gmail.com bix...@gmail.com wrote:

  Hi,

  After using version 3 for over a year, it finally occured to me I
  should upgrade. When trying to start version 3.4 I get:

  --
  | Sage Version 3.4, Release Date: 2009-03-11                         |
  | Type notebook() for the GUI, and license() for information.        |
  --

  **
  WARNING!  This Sage install was built on a machine that supports
  instructions that are not available on this computer.  Sage will
  likely fail with ILLEGAL INSTRUCTION errors! The following processor
  flags were on the build machine but are not on this computer:

  sse4_1

  Emailhttp://groups.google.com/group/sage-supportfor help.
  To remove this warning and make Sage start, just delete
      /home/bixbyr/Desktop/sage-3.4-linux-Ubuntu_8.10-i686-Linux/local/
  lib/sage-flags.txt
  **

  I tried removing this file to see if sage will run correctly, it
  doesn't seem to. For a quick stress test I did
  sage: prime_pi(10^10)   ... and got back
  /home/bixbyr/Desktop/sage-3.4-linux-Ubuntu_8.10-i686-Linux/local/bin/
  sage-sage: line 197:  8689 Segmentation fault      sage-ipython $@ -
  i

  It returns correctly for prime_pi(10^9), so although it's possible
  that the two errors are unrelated, that seems a strange way to fail if
  the issue were related to insufficient memory.

  I downloaded sage-3.4-linux-Ubuntu_8.10-i686-Linux.tar.gz from the
  University of Washington mirror. I'm running ubuntu 8.10, kernel
  version 2.6.27-11-generic. I have 4gb of ram, though running a 32 bit
  kernel effectively limits me to ~3.2 gb. Since sse4 is a cpu
  instruction set (from what I understand), here it the output for cat /
  proc/cpuinfo:

  processor       : 0
  vendor_id       : GenuineIntel
  cpu family      : 6
  model           : 15
  model name      : Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz
  stepping        : 11
  cpu MHz         : 1600.000
  cache size      : 4096 KB
  physical id     : 0
  siblings        : 4
  core id         : 0
  cpu cores       : 4
  apicid          : 0
  initial apicid  : 0
  fdiv_bug        : no
  hlt_bug         : no
  f00f_bug        : no
  coma_bug        : no
  fpu             : yes
  fpu_exception   : yes
  cpuid level     : 10
  wp              : yes
  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
  cmov
  pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm
  constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2
  ssse3 cx16 xtpr lahf_lm
  bogomips        : 4799.97
  clflush size    : 64
  power management:
  ( ... it then lists 3 more processors with the same information)

  Although not the newest processor, it seems like this should be recent
  enough to run sage. I also tried installing the new version on my
  laptop, another ubuntu 8.10 system this time with a core 2 duo
  processor, and got the exact same error.

  Any thoughts? Thanks a lot,

 Have you tried to build Sage from sources? If you also get the same
 error, it will 

[sage-support] Re: bug in region_plot

2009-03-19 Thread Jason Grout

Wilfried_Huss wrote:
 
 
 On 19 Mrz., 16:47, Jason Grout jason-s...@creativetrax.com wrote:
 ma...@mendelu.cz wrote:
 Hello, this command produces one half of a cirle, not 1/4 as excepted.
 I think that this is a bug in sage 3.4
 Robert
 region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,
 3),plot_points=100,incol='gray').show(aspect_ratio=1)
 I get a quarter-circle on my sage 3.4 and on sagenb.org.  Can you try on
 sagenb.org?
 
 This works:
 sage: var('x,y')
 sage: region_plot([y0,x0,x^2+y^23], (x, -3, 3), (y, -3,3))
 
 But if one leaves out the variables, one gets an half circle:
 sage: region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,3))
 
 I've written a patch which fixes this:
 http://trac.sagemath.org/sage_trac/ticket/5567


Ah, yes, good catch.  For those that want to know, Sage was interpreting 
the first two constraints as functions of one variable, so when it 
plugged in two numbers, Sage behaved as though you had typed x0, x0. 
When I did my example, I explicitly put in the variable names (it's a 
good habit to be explicit in plotting), so I got the right plot.

There should be a standard function that takes a tuple of functions and 
returns a list of variables for all the functions.  This is used all 
over the plotting code, the fast_callable code, now this code, etc. 
Basically, there should be a function that, treating a tuple of 
functions as a vector-valued function, returns the variables used in the 
vector-valued function.

Also, I wonder why fast_float is not used?  It could drastically speed 
up plots.  You could just replace the lines like:

s = symbolic_expression(f.rhs() - f.lhs()).function(*variables)

with

s = fast_float(f.rhs() - f.lhs(), *vars)

and you'd probably see at least an order of magnitude speedup.  (make 
sure to do from sage.ext.fast_eval import fast_float first).

Jason


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: how to pull back an ideal by a canonical surjection ?

2009-03-19 Thread Martin Albrecht

On Thursday 19 March 2009, David Madore wrote:
 Dear List,

 I'm trying to do some algebraic geometrical / arithmetical computation
 with Sage and I find myself stuck on the following dumb problem: if I
 have an ideal J of a quotient ring R/I (where R is a polynomial ring
 and I some ideal of it), I wish to construct the ideal of R (called
 p^{-1}(J) or perhaps even simply I+J) which is obtained by pulling
 back J by the canonical map p:R-R/I.  This presents no algorithmic
 difficulty, since I is given by generators (in R), and J is also given
 by generators (in R/I, but they are themselves represented by elements
 of R) and it is just a question of taking the union of these lists of
 generators (seeing those of J in R/I as arbitrary representatives in
 R) to obtain the desired idea.  Unfortunately, this doesn't seem to
 work (probably because Sage doesn't know how to handle the canonical
 surjection specially?):

 vega david /usr/local/src/sage-3.4 $ ./sage
 --

 | Sage Version 3.4, Release Date: 2009-03-11 |
 | Type notebook() for the GUI, and license() for information.|

 --
 sage: R.x,y = QQ['x','y']
 sage: I = Ideal(y^2 - x^3 - x)
 sage: Rq = R.quotient(I)
 sage: p = R.hom(Rq)
 sage: J = Ideal(p(y)-1)
 sage: J
 Ideal (ybar - 1) of Quotient of Multivariate Polynomial Ring in x, y over
 Rational Field by the ideal (-x^3 + y^2 - x) sage: p.inverse_image(J)
 ---
 NotImplementedError   Traceback (most recent call last)

 /usr/src/local/sage-3.4/ipython console in module()

 /usr/src/local/sage-3.4/local/lib/python2.5/site-packages/sage/rings/morphi
sm.so in sage.rings.morphism.RingHomomorphism.inverse_image
 (sage/rings/morphism.c:3480)()

 NotImplementedError:
 sage: whatiwantedwasthis = I + Ideal(y-1)
 sage: whatiwantedwasthis
 Ideal (-x^3 + y^2 - x, y - 1) of Multivariate Polynomial Ring in x, y over
 Rational Field sage: p(whatiwantedwasthis)
 Ideal (0, ybar - 1) of Quotient of Multivariate Polynomial Ring in x, y
 over Rational Field by the ideal (-x^3 + y^2 - x) sage:
 p(whatiwantedwasthis) == J
 True

 By comparison, Macaulay2 does this:

 vega david ~ $ /opt/Macaulay2-1.2-r8438/bin/M2
 Macaulay 2, version 1.2
 with packages: Elimination, IntegralClosure, LLLBases,
 PrimaryDecomposition, ReesAlgebra, SchurRings, TangentCone

 i1 : R = QQ[x,y]

 o1 = R

 o1 : PolynomialRing

 i2 : I = ideal(y^2-x^3-x)

   32
 o2 = ideal(- x  + y  - x)

 o2 : Ideal of R

 i3 : Rq = R/I

 o3 = Rq

 o3 : QuotientRing

 i4 : p = map(Rq,R,matrix{{x,y}})

 o4 = map(Rq,R,{x, y})

 o4 : RingMap Rq --- R

 i5 : J = ideal(y-1)

 o5 = ideal(y - 1)

 o5 : Ideal of Rq

 i6 : preimage(p,J)

 3
 o6 = ideal (y - 1, x  + x - 1)

 o6 : Ideal of R

 i7 : use R; whatiwantedwasthis = I + ideal(y-1)

32
 o8 = ideal (- x  + y  - x, y - 1)

 o8 : Ideal of R

 i9 : o6 == whatiwantedwasthis

 o9 = true

 i10 : p(whatiwantedwasthis)

 o10 = ideal (0, y - 1)

 o10 : Ideal of Rq

 i11 : p(whatiwantedwasthis) == J

 o11 = true

 (Unfortunately, I can't do my computations in Macaulay2 because I need
 polynomial rings over number fields - the above example is in Q - and
 it can't handle them.)

 So, is there a way in Sage to pull back an ideal by a canonical map?

Quotient rings are in a particularly bad shape in Sage, here's a hack:

sage: R.x,y = QQ['x','y']
sage: I = Ideal(y^2 - x^3 - x)
sage: Q = R.quotient(I)
sage: p = R.hom(Q)
sage: J = Ideal(p(y)-1)
sage: J
Ideal (ybar - 1) of Quotient of Multivariate Polynomial Ring in x, y over 
Rational Field by the ideal (-x^3 + y^2 - x)

sage: I2 = Ideal([f._QuotientRingElement__rep for f in  J.gens()]) + I
sage: I2
Ideal (y - 1, -x^3 + y^2 - x) of Multivariate Polynomial Ring in x, y over 
Rational Field

sage: I2.groebner_basis()
[x^3 + x - 1, y - 1]

that should be what you want. However, f._QuotientRingElement__rep is quite 
evil because it uses the internal representation. 

I'd actually give it a shot to implement the NotImplementedError above but I'm 
unsure where the implementation belongs:

Not sure whether I should just patch RingHomomorphism_coercion:add a bunch of 
type checks and then do something like the above if they pass and raise 
NotImplementedError otherwise?

Cheers,
Martin
-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinralbre...@jabber.ccc.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 

[sage-support] Re: creating symbolic variables.

2009-03-19 Thread William Stein

On Thu, Mar 19, 2009 at 1:01 AM, Minh Nguyen nguyenmi...@gmail.com wrote:

 Hi Jose,

 On Thu, Mar 19, 2009 at 7:49 AM, Jose Guzman n...@neurohost.org wrote:

 This is apparently a very easy question, but I am new to the mathematics
 computing environment and it will take me some time to become familiar
 with Sage. The question is the following; Are these two expressions
 similar?

 sage: a,b,c = var('a,b,c')

 sage: var('a,b,c')

 If not, when should I use one or another?

Just another point.  Using the above two is equivalent on the command
line or in .sage scripts.  The function var uses a Cython hack to
inject a,b,c into the globals() namespace.   In some cases of Sage
library code (.py files) it is *not* equivalent in that doing
var('a,b,c') will make the symbolic variables somewhere, but a,b,c
might not be defined in the current scope.

William


 Both of the expressions above are more or less the same in that they
 produce the same result, i.e. declaring three symbolic variables. But
 note these points. If you do

 [1]
 sage: a,b,c = var(a,b,c)

 then it results in what you expect: namely, declaring the three
 specified symbolic variables. Now if you do

 [2]
 sage: var(a,b,c)
 (a, b, c)

 Sage does the same thing, but this time the three symbolic variables
 are printed to your terminal. The last command actually returns a
 tuple of three symbolic variables, so it makes sense to do as per [1].
 In Python, command [1] technically unpacks the tuple elements and
 store them in the variable names to the left of the equal sign. But if
 you do as in [2], then the required symbolic variables would have been
 declared even if you don't explicitly store the tuple elements: note
 this

 sage: var(a,b,c)
 (a, b, c)
 sage: type(a); type(b); type(c)
 class 'sage.calculus.calculus.SymbolicVariable'
 class 'sage.calculus.calculus.SymbolicVariable'
 class 'sage.calculus.calculus.SymbolicVariable'

 Also, if you like command [2] because it's less to type on the
 keyboard, then by all means do it. And if you don't want to see the
 returned tuple of symbolic variables, you can do this:

 sage: var(a,b,c);

 --
 Regards
 Minh Van Nguyen

 




-- 
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: bug in region_plot

2009-03-19 Thread Jason Grout

Jason Grout wrote:
 Wilfried_Huss wrote:

 On 19 Mrz., 16:47, Jason Grout jason-s...@creativetrax.com wrote:
 ma...@mendelu.cz wrote:
 Hello, this command produces one half of a cirle, not 1/4 as excepted.
 I think that this is a bug in sage 3.4
 Robert
 region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,
 3),plot_points=100,incol='gray').show(aspect_ratio=1)
 I get a quarter-circle on my sage 3.4 and on sagenb.org.  Can you try on
 sagenb.org?
 This works:
 sage: var('x,y')
 sage: region_plot([y0,x0,x^2+y^23], (x, -3, 3), (y, -3,3))

 But if one leaves out the variables, one gets an half circle:
 sage: region_plot([y0,x0,x^2+y^23], (-3, 3), (-3,3))

 I've written a patch which fixes this:
 http://trac.sagemath.org/sage_trac/ticket/5567
 
 
 Ah, yes, good catch.  For those that want to know, Sage was interpreting 
 the first two constraints as functions of one variable, so when it 
 plugged in two numbers, Sage behaved as though you had typed x0, x0. 
 When I did my example, I explicitly put in the variable names (it's a 
 good habit to be explicit in plotting), so I got the right plot.
 
 There should be a standard function that takes a tuple of functions and 
 returns a list of variables for all the functions.  This is used all 
 over the plotting code, the fast_callable code, now this code, etc. 
 Basically, there should be a function that, treating a tuple of 
 functions as a vector-valued function, returns the variables used in the 
 vector-valued function.
 
 Also, I wonder why fast_float is not used?  It could drastically speed 
 up plots.  You could just replace the lines like:
 
 s = symbolic_expression(f.rhs() - f.lhs()).function(*variables)
 
 with
 
 s = fast_float(f.rhs() - f.lhs(), *vars)
 
 and you'd probably see at least an order of magnitude speedup.  (make 
 sure to do from sage.ext.fast_eval import fast_float first).
 


Actually, I believe that the call to setup_eval_on_grid automatically 
does the call to fast_float, so it's probably already happening and we 
don't have to worry about anything.

In fact, I think the root of the problem is in 
plot/plot3d/parametric_plot3d.py in the adapt_to_callable function (this 
is called by setup_for_eval_on_grid, which is in turn called by 
region_plot).  Observe (and please pardon my debugging in public :)


sage: from sage.plot.plot3d.parametric_plot3d import adapt_to_callable
sage: var('x,y')
(x, y)
sage: funcs = [x,y]
sage: adapt_to_callable(funcs,2)

((sage.ext.interpreters.wrapper_rdf.Wrapper_rdf object at 0xa9b1d9c,
   sage.ext.interpreters.wrapper_rdf.Wrapper_rdf object at 0xa9d916c),
  (y, x))


First of all, why in the world are the arguments y, then x?  I thought 
the convention was alphabetical ordering if an ordering wasn't specified.

Well, the problem is in this line of adapt_to_callable:

tuple(sorted(set(sum( [z.variables() for z in f], ()) )))

Note:

sage: sorted(set(sum([z.variables() for z in funcs],(
[y, x]

and even

sage: sorted(list(set(sum([z.variables() for z in funcs],()
[y, x]


For some reason, sorting the list [y,x] doesn't make it [x,y]:

sage: sorted([y,x])
[y, x]


There seem to be other problems too:

sage: funcs=[x,y,1]
sage: adapt_to_callable(funcs,2)
---
TypeError Traceback (most recent call last)

/home/jason/.sage/temp/littleone/16993/_home_jason__sage_init_sage_0.py 
in module()

/home/jason/sage/local/lib/python2.5/site-packages/sage/plot/plot3d/parametric_plot3d.pyc
 
in adapt_to_callable(f, nargs)
 620 except TypeError:
 621 vars = ()
-- 622 f = [fast_float_constant(x) for x in f]
 623
 624 if nargs is not None and len(vars) != nargs:

/home/jason/sage/local/lib/python2.5/site-packages/sage/ext/fast_eval.so 
in sage.ext.fast_eval.fast_float_constant (sage/ext/fast_eval.c:6827)()

/home/jason/sage/local/lib/python2.5/site-packages/sage/ext/fast_eval.so 
in sage.ext.fast_eval.FastDoubleFunc.__init__ (sage/ext/fast_eval.c:2781)()

TypeError: a float is required


This comes from assuming that if any of the functions doesn't have a 
.variables() method, then *all* of the functions must be constants. 
That seems a bit silly...

So I think it not a coincidence that this function has no doctests.  I 
think this is yet another example of code that doesn't have doctests 
that (not surprisingly) is broken.

Wilfried, can you take a look at this function (adapt_to_callable)?  I 
think fixing it will fix probably lots of other bugs as well, since it 
is called from lots of plotting code.

Thanks,

Jason


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org

[sage-support] Re: SSE4_1 errors when running sage 3.4

2009-03-19 Thread William Stein

On Thu, Mar 19, 2009 at 10:10 AM, bix...@gmail.com bix...@gmail.com wrote:

 Hi,

 I built sage from source and ran 'make test' on it. It failed on
        sage -t  devel/sage/sage/plot/plot.py
        sage -t  devel/sage/sage/symbolic/function.pyx
        sage -t  devel/sage/sage/rings/polynomial/multi_polynomial.pyx
        sage -t  devel/sage/sage/functions/constants.py
 though the build documentation suggested that it was normal to fail on
 a couple tests?

 When I launch the version I compiled from source, it didn't give me
 any warning about instruction sets. It appears to function exactly the
 same as the binary I downloaded, once I removed the sage-flags.txt
 file. So it seems that there is nothing wrong with the pre-built
 version, though someone might want to look into why it claims to
 require sse4_1 when it does not appear to need them (possibly it was
 compiled on a machine with sse4 so it automatically assumes it is
 needed?

That's true.

 ). Perhaps sse4 doesn't need to be listed in sage-flags.txt?

I think that is true.  In fact, I posted a patch to remove ssse4 from
the flag list.

 As for William Stein's comment, I watched memory usage as it tried to
 compute pi(10^10), and it didn't rise noticeably before giving the seg
 fault (it also only took a moment). Even if it is a memory issue,
 doesn't sage have a more graceful and informative way to fail?

One would hope.

 I
 wonder how pi(x) is computed in sage, it it is simply referencing a
 pre-computed table of primes then perhaps the seg fault is an
 indication that it went past the end of the table?

No -- in sage = 3.4 it uses the PARI C library to *enumerate* all
primes up to x.

 I looked at the entry in the tracker, what does prime_pi(k,40) do? I
 thought that prime_pi was a function of a single variable, and when I
 tried using it that way in sage it threw an error.

 Thank you both for your help,

  - Ryan

 On Mar 18, 3:20 pm, Johan Oudinet johan.oudi...@gmail.com wrote:
 On Wed, Mar 18, 2009 at 4:20 PM, bix...@gmail.com bix...@gmail.com wrote:

  Hi,

  After using version 3 for over a year, it finally occured to me I
  should upgrade. When trying to start version 3.4 I get:

  --
  | Sage Version 3.4, Release Date: 2009-03-11                         |
  | Type notebook() for the GUI, and license() for information.        |
  --

  **
  WARNING!  This Sage install was built on a machine that supports
  instructions that are not available on this computer.  Sage will
  likely fail with ILLEGAL INSTRUCTION errors! The following processor
  flags were on the build machine but are not on this computer:

  sse4_1

  Emailhttp://groups.google.com/group/sage-supportfor help.
  To remove this warning and make Sage start, just delete
      /home/bixbyr/Desktop/sage-3.4-linux-Ubuntu_8.10-i686-Linux/local/
  lib/sage-flags.txt
  **

  I tried removing this file to see if sage will run correctly, it
  doesn't seem to. For a quick stress test I did
  sage: prime_pi(10^10)   ... and got back
  /home/bixbyr/Desktop/sage-3.4-linux-Ubuntu_8.10-i686-Linux/local/bin/
  sage-sage: line 197:  8689 Segmentation fault      sage-ipython $@ -
  i

  It returns correctly for prime_pi(10^9), so although it's possible
  that the two errors are unrelated, that seems a strange way to fail if
  the issue were related to insufficient memory.

  I downloaded sage-3.4-linux-Ubuntu_8.10-i686-Linux.tar.gz from the
  University of Washington mirror. I'm running ubuntu 8.10, kernel
  version 2.6.27-11-generic. I have 4gb of ram, though running a 32 bit
  kernel effectively limits me to ~3.2 gb. Since sse4 is a cpu
  instruction set (from what I understand), here it the output for cat /
  proc/cpuinfo:

  processor       : 0
  vendor_id       : GenuineIntel
  cpu family      : 6
  model           : 15
  model name      : Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz
  stepping        : 11
  cpu MHz         : 1600.000
  cache size      : 4096 KB
  physical id     : 0
  siblings        : 4
  core id         : 0
  cpu cores       : 4
  apicid          : 0
  initial apicid  : 0
  fdiv_bug        : no
  hlt_bug         : no
  f00f_bug        : no
  coma_bug        : no
  fpu             : yes
  fpu_exception   : yes
  cpuid level     : 10
  wp              : yes
  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
  cmov
  pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm
  constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2
  ssse3 cx16 xtpr lahf_lm
  bogomips        : 4799.97
  clflush size    : 64
  power management:
  ( ... it then lists 3 more processors with the same information)

  Although not the newest processor, it seems like this should 

[sage-support] Re: Testing whether a function is always positive

2009-03-19 Thread Carl Witty

On Mar 19, 7:51 am, PaulBurk paulburkan...@gmail.com wrote:
 Hi all,

 I'm working on a project, and my professor suggest I post a question
 here.

 I'm trying to use programs such as Mathematica, Maple and Sage to test
 whether a function is always positive.  Maple has an is command,
 which can be used to test some properties.  Sometimes it is
 sufficient, other times it fails.

 Does Sage have anything like an is command?  Is there any other way
 to test if a function is always positve/negative?

What sort of function?  With one argument or multiple arguments?  For
arbitrary functions (involving trig, exponents, etc.), I'm pretty sure
that it's provably impossible to always decide whether a function is
always positive, so the best any system can do is apply some
heuristics that work for some functions but not others.

For univariate or multivariate polynomials (with rational
coefficients), it's always possible in theory to determine whether a
function is positive everywhere, although I don't know of a method
that's usable in practice if there's more than a few variables.

Carl
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: creating symbolic variables.

2009-03-19 Thread Jose Guzman

Jose Guzman wrote:
 This is apparently a very easy question, but I am new to the mathematics 
 computing environment and it will take me some time to become familiar 
 with Sage. The question is the following; Are these two expressions 
 similar?

 sage: a,b,c = var('a,b,c')

 sage: var('a,b,c')

 If not, when should I use one or another?

 In the documentation regarding the substitute method and when  I checked the 
 examples I noticed that they show:

 sage: x,y,t = var('x,y,t')

 I guess this is not necessary because Sage considers by default x as a 
 symbolic variable, isn't it?

 Thanks in advance.

 Jose.

 
   
Ok, thank you both for your nice explanations. In my case I will 
substitute the 'a' and 'b' value setting the equation and evaluate the 
results algebraically in terms of x and other symbolic variable. I will 
probably give you examples once I became more familiar with Sage.

Regards!

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Error message installing sage 3.4 on G4 iBook

2009-03-19 Thread jlvm

Dear friends,

(Sorry for my bad english)

I'm trying to install sage 3.4 on a G4 iBook with Mac OS X 10.5.6.

I download sage-3.4-PowerPC-OSX10.5-PowerMacintosh-Darwin.dmg without
problems. Then I follow README.txt and I copy the sage fonder to the /
Applications folder without problems.

But, after doing double click on the sage icon, I get the following
error on the Terminal:
---
Last login: Thu Mar 19 22:21:10 on console
/Applications/sage/sage ; exit;
Macario:~ jvarona$ /Applications/sage/sage ; exit;
--
| Sage Version 3.4, Release Date: 2009-03-11 |
| 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.
/Applications/sage/local/bin/sage-sage: line 197:   257 Illegal
instruction sage-ipython $@ -i
logout

[Proceso completado]
---

What happens?

I cannot to use sage. What to do?

Thanks in advance,

Juan Luis


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Error message installing sage 3.4 on G4 iBook

2009-03-19 Thread William Stein

On Thu, Mar 19, 2009 at 3:58 PM, jlvm juanluis.var...@gmail.com wrote:

 Dear friends,

 (Sorry for my bad english)

 I'm trying to install sage 3.4 on a G4 iBook with Mac OS X 10.5.6.

 I download sage-3.4-PowerPC-OSX10.5-PowerMacintosh-Darwin.dmg without
 problems. Then I follow README.txt and I copy the sage fonder to the /
 Applications folder without problems.

 But, after doing double click on the sage icon, I get the following
 error on the Terminal:
 ---
 Last login: Thu Mar 19 22:21:10 on console
 /Applications/sage/sage ; exit;
 Macario:~ jvarona$ /Applications/sage/sage ; exit;
 --
 | Sage Version 3.4, Release Date: 2009-03-11                         |
 | 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.
 /Applications/sage/local/bin/sage-sage: line 197:   257 Illegal
 instruction     sage-ipython $@ -i
 logout

 [Proceso completado]
 ---

 What happens?

 I cannot to use sage. What to do?

If you have a recent version of XCode installed then you can build from source.

1. Get the sage-3.4.tar file here: http://sagemath.org/src/

2. Extract it (possibly by double clicking on it).

3. Using terminal, change into the sage-3.4 directory, and type

$  make

This will take a couple of hours, and will likely work fine so long as
you have an xcode that is from at least about 2007 or newer.

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Error message installing sage 3.4 on G4 iBook

2009-03-19 Thread Minh Nguyen

On Thu, Mar 19, 2009 at 11:20 PM, William Stein wst...@gmail.com wrote:

 On Thu, Mar 19, 2009 at 3:58 PM, jlvm juanluis.var...@gmail.com wrote:

 Dear friends,

 (Sorry for my bad english)

 I'm trying to install sage 3.4 on a G4 iBook with Mac OS X 10.5.6.

 I download sage-3.4-PowerPC-OSX10.5-PowerMacintosh-Darwin.dmg without
 problems. Then I follow README.txt and I copy the sage fonder to the /
 Applications folder without problems.

 But, after doing double click on the sage icon, I get the following
 error on the Terminal:

SNIP

 What happens?

 I cannot to use sage. What to do?

 If you have a recent version of XCode installed then you can build from 
 source.

 1. Get the sage-3.4.tar file here: http://sagemath.org/src/

If download speed is one of your concerns, you might want to consider
downloading Sage from a mirror. Here's a list of available mirrors:

http://www.sagemath.org/download-linux.html


 2. Extract it (possibly by double clicking on it).

 3. Using terminal, change into the sage-3.4 directory, and type

$  make

 This will take a couple of hours, and will likely work fine so long as
 you have an xcode that is from at least about 2007 or newer.

 William

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Kwankyu

Hi Jason,

Korean input works wonderfully with these patches. Thank you!

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Kwankyu

Hi Mike,

Korean input works wonderfully with these patches. Thank you for your
nice work!

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] resetting vertex labels

2009-03-19 Thread davidp

Suppose G is a DiGraph.  Is there a way to change the vertex labels of
G so that they are shown when G.show() is called?  The method,
G.set_vertex() does not seem to do that.

Sample code

sage: G = DiGraph({1:{2: 2}, 2:{1:1}})
sage: G.show()
sage: G.set_vertex(1,4)
sage: G.show() # -- there is no change

What I am really after is this: I have a collection of integers, one
for each vertex.  Over time the integers change.  I would like to show
the graph with vertices labeled by these integers.  Best of all would
be to do this via @interact.

Thanks,
Dave
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] showing graphs with multiple edges

2009-03-19 Thread davidp

Hi,

I was a bit surprised by the difference exhibited below:

sage: G = DiGraph({1:{2: 2}, 2:{1:1}})
sage: G.show()
sage: DiGraph(G.laplacian_matrix()).show()

The latter draws multiple edges.

Dave
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Error when running Notebook: Error showing url: There was an error launching the default action command associated with this location

2009-03-19 Thread Alex Lara

I got the following error when running
sage -notebook
**
**
* Open your web browser to http://localhost:8000 *
**
**
2009-03-19 17:33:51-0700 [-] Log opened.
2009-03-19 17:33:51-0700 [-] twistd 8.1.0 (/usr/local/sage-3.4/local/
bin/python 2.5.2) starting up
2009-03-19 17:33:51-0700 [-] reactor class: class
'twisted.internet.selectreactor.SelectReactor'
2009-03-19 17:33:51-0700 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2009-03-19 17:33:51-0700 [-] Starting factory
twisted.web2.channel.http.HTTPFactory instance at 0x8ca724c

Error showing url: There was an error launching the default action
command associated with this location.

If after that, in the url of firefox I type  http://localhost:8000
it begins to work.

Any idea why it does not work?

---Alex Lara

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: showing graphs with multiple edges

2009-03-19 Thread Jason Grout

davidp wrote:
 Hi,
 
 I was a bit surprised by the difference exhibited below:
 
 sage: G = DiGraph({1:{2: 2}, 2:{1:1}})
 sage: G.show()

I'm surprised by the output of this.  There are clearly two edges in the 
graph: 1-2 and 2-1, but only one edge is shown.


 sage: DiGraph(G.laplacian_matrix()).show()
 

The Laplacian matrix has nonzero entries indicating edges from each 
vertex to each other vertex, so why do you find it surprising that there 
are two edges?

sage: H=DiGraph(G.laplacian_matrix())
sage: H.edges()
[(0, 0, 1), (0, 1, -1), (1, 0, -1), (1, 1, 1)]


I find it surprising that arrowheads don't appear in the following, though:

sage: DiGraph(G.laplacian_matrix()).show()


Thanks,

Jason


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: showing graphs with multiple edges

2009-03-19 Thread davidp

Sorry.  I was not being clear.  I was surprised by the fact that
*only* the latter shows multiple edges.

I am also surprised that arrowheads don't appear with multiple edges.
This is especially a problem with weighted digraphs.

(By the way, it probably would have been better for me to have written

sage: G = DiGraph({1:{2: 2}, 2:{1:1}}, weighted=True)

so that the Laplacian comes out correctly.  However, this doesn't help
with my problem.)

Dave

On Mar 19, 6:01 pm, Jason Grout jason-s...@creativetrax.com wrote:
 davidp wrote:
  Hi,

  I was a bit surprised by the difference exhibited below:

  sage: G = DiGraph({1:{2: 2}, 2:{1:1}})
  sage: G.show()

 I'm surprised by the output of this.  There are clearly two edges in the
 graph: 1-2 and 2-1, but only one edge is shown.

  sage: DiGraph(G.laplacian_matrix()).show()

 The Laplacian matrix has nonzero entries indicating edges from each
 vertex to each other vertex, so why do you find it surprising that there
 are two edges?

 sage: H=DiGraph(G.laplacian_matrix())
 sage: H.edges()
 [(0, 0, 1), (0, 1, -1), (1, 0, -1), (1, 1, 1)]

 I find it surprising that arrowheads don't appear in the following, though:

 sage: DiGraph(G.laplacian_matrix()).show()

 Thanks,

 Jason
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Chris Godsil

Thanks for your comments so far.  Please note that I want to compute
determinants of
matrices whose entries are polynomials over QQ (so performance over ZZ
is irrelevant).
For the examples I offered, the determinants were characteristic
polynomials
but this would not be true for the cases I want to study.  Also I
would be computing tens of
thousands of these determinants, ideally with matrices of orders of up
to 30 x 30.
Eventually I may want to look at cases where the entries are
polynomials
in two or three variables.

So this leads to the following questions.
What algorithm(s) does sage use to compute determinants over QQ[t] or
QQ[t,u]?
Does they work over the ring of definition, or over the field of
fractions?
Are they polynomial time?

My limited experiments seem to suggest that the default algorithm sage
uses for matrices
over QQ[t] is not polynomial time. As the Reference Manual suggests, I
entered
M.determinant? to see what algorithm was being used, but did not get
any useful information.

Thanks
Chris


On Mar 19, 4:17 am, Chris Godsil cgod...@uwaterloo.ca wrote:
 I want to compute determinants of matrix polynomials, for matrices up  
 to 20 x 20, say.
 The attached transcript seems to indicate 9 or 10 might be my limit.  
 (Or it's late
 and I am being stupd?)

 --
 | Sage Version 3.4, Release Date:  
 2009-03-11                             |
 | Type notebook() for the GUI, and license() for information.        |
 --
 # intel mac pro, binary distribution

 sage: P = graphs.PetersenGraph()
 sage: P.delete_edge([0,1])
 sage: P.degree()
 [2, 2, 3, 3, 3, 3, 3, 3, 3, 3]
 sage: P
 Petersen graph: Graph on 10 vertices ## but P is not the Petersen  
 graph now
 sage: A = P.am()
 sage: Id = identity_matrix(10)
 sage: R.t = QQ[]
 sage: (t+1)^5
 t^5 + 5*t^4 + 10*t^3 + 10*t^2 + 5*t + 1
 sage: M = t*Id - A; M

 [ t  0  0  0 -1 -1  0  0  0  0]
 [ 0  t -1  0  0  0 -1  0  0  0]
 [ 0 -1  t -1  0  0  0 -1  0  0]
 [ 0  0 -1  t -1  0  0  0 -1  0]
 [-1  0  0 -1  t  0  0  0  0 -1]
 [-1  0  0  0  0  t  0 -1 -1  0]
 [ 0 -1  0  0  0  0  t  0 -1 -1]
 [ 0  0 -1  0  0 -1  0  t  0 -1]
 [ 0  0  0 -1  0 -1 -1  0  t  0]
 [ 0  0  0  0 -1  0 -1 -1  0  t]
 sage: M.det()  ## and sage hangs

 ## but the following worked
 sage: K =graphs.CompleteGraph(3)
 sage: B =K.am()
 sage: Id = identity_matrix(3)
 sage: (t*Id-B).det()
 t^3 - 3*t - 2

 sage: C = graphs.CubeGraph(3)
 sage: C
 3-Cube: Graph on 8 vertices
 sage: Id = identity_matrix(8)
 sage: (t*Id-C.am()).det()
 t^8 - 12*t^6 + 30*t^4 - 28*t^2 + 9

 # and the cycle on 9 vertices hangs
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Minh Nguyen

Hi Chris,

On Fri, Mar 20, 2009 at 1:54 AM, Chris Godsil cgod...@uwaterloo.ca wrote:


SNIP

 As the Reference Manual suggests, I
 entered
 M.determinant? to see what algorithm was being used, but did not get
 any useful information.

For the specified matrix M as defined above in your original email, I
entered this

sage: M.determinant?

in Sage 3.4 and received the following snippet of info:

ALGORITHM: For small matrices (n4), this is computed using the
naive formula For integral domains, the charpoly is computed (using
hessenberg form) Otherwise this is computed using the very stupid
expansion by minors stupid *naive generic algorithm*. For matrices
over more most rings more sophisticated algorithms can be used.
(Type ``A.determinant?`` to see what is done for a
specific matrix A.)


But I don't think that snippet on algorithm helps in answering your
question on the specific (implementation of) algorithms.

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: showing graphs with multiple edges

2009-03-19 Thread Jason Grout

davidp wrote:
 Sorry.  I was not being clear.  I was surprised by the fact that
 *only* the latter shows multiple edges.
 
 I am also surprised that arrowheads don't appear with multiple edges.
 This is especially a problem with weighted digraphs.
 
 (By the way, it probably would have been better for me to have written
 
 sage: G = DiGraph({1:{2: 2}, 2:{1:1}}, weighted=True)
 
 so that the Laplacian comes out correctly.  However, this doesn't help
 with my problem.)


Well, the lack of arrowheads on weighted graphs is the problem in the 
second case.  Because the 0,1 entry is -1, Sage assumes that the matrix 
represents a weighted graph.

Thanks,

Jason




 
 Dave
 
 On Mar 19, 6:01 pm, Jason Grout jason-s...@creativetrax.com wrote:
 davidp wrote:
 Hi,
 I was a bit surprised by the difference exhibited below:
 sage: G = DiGraph({1:{2: 2}, 2:{1:1}})
 sage: G.show()
 I'm surprised by the output of this.  There are clearly two edges in the
 graph: 1-2 and 2-1, but only one edge is shown.

 sage: DiGraph(G.laplacian_matrix()).show()
 The Laplacian matrix has nonzero entries indicating edges from each
 vertex to each other vertex, so why do you find it surprising that there
 are two edges?

 sage: H=DiGraph(G.laplacian_matrix())
 sage: H.edges()
 [(0, 0, 1), (0, 1, -1), (1, 0, -1), (1, 1, 1)]

 I find it surprising that arrowheads don't appear in the following, though:

 sage: DiGraph(G.laplacian_matrix()).show()

 Thanks,

 Jason
  
 


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Mike Hansen

Hi Chris,

I'm not sure what other types of matrices you're looking at, but if
the matrices are similar to the ones you posted, then one typical
approach is to evaluate the matrices at a number of points, take the
determinant, and then rebuild the determinant from that data.  This
work well if you have a good degree bound on the entries since it
reduces the number of determinants you have to take. Here is a (very)
rough function that does this:


def poly_det(m, degree_bound):
#Get a bunch of points to evaluate the determinant at
points = range(degree_bound+1)
n = len(points)

#Evaluate the matrix at a number of points and compute
#the determinant
evaluations = [m.apply_map(lambda x: x(p)).det() for p in points]

#Rebuild the polynomial determinant
det_matrix = matrix( [[p^i for i in range(n)] for p in points] )
coefficients = det_matrix.solve_right(vector(evaluations))

#Return the polynomial
R = PolynomialRing(QQ, 't')
return R(list(coefficients))

Then, on my machine:

sage: C = graphs.CycleGraph(9)
sage: m = t - C.am()
sage: %time m.det()
t^9 - 9*t^7 + 27*t^5 - 30*t^3 + 9*t - 2
CPU time: 24.74 s,  Wall time: 25.81 s
sage: %time poly_det(m, len(C))
t^9 - 9*t^7 + 27*t^5 - 30*t^3 + 9*t - 2
CPU time: 0.06 s,  Wall time: 0.06 s

With this approach all of the hard linear algebra ends up being done
with fast integer linear algebra: QQ[t] - QQ - ZZ.

--Mike
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Mike Hansen

On Mar 19, 6:54 pm, Chris Godsil cgod...@uwaterloo.ca wrote:
 What algorithm(s) does sage use to compute determinants over QQ[t] or
 QQ[t,u]?

For both of these, it is computing them using minors, which is awful
when the matrices are not tiny.

 Does they work over the ring of definition, or over the field of
 fractions?

These work over the ring of definition.  If you work over the field of
fractions, then you can get some speedup since you can put then matrix
in Hessenberg form and read the determinant off from the
characteristic polynomial.  For the CycleGraph(9):

sage: m.change_ring(R.fraction_field()).det()
t^9 - 9*t^7 + 27*t^5 - 30*t^3 + 9*t - 2
CPU time: 0.54 s,  Wall time: 0.57 s

 over QQ[t] is not polynomial time. As the Reference Manual suggests, I
 entered
 M.determinant? to see what algorithm was being used, but did not get
 any useful information.

In this case, doing M.determinant?? to see the actual source code
gives you everything it's doing.

--Mike
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Pynac bug

2009-03-19 Thread Alex Raichev

Here's another one for you, Burcin...

Alex

sage: var('n',ns=1)
n
sage: (QQbar(2)^3)^n
---
TypeError Traceback (most recent call
last)

/Users/arai021/ipython console in module()

/Applications/sage/local/lib/python2.5/site-packages/sage/rings/
qqbar.pyc in __pow__(self, e)
   2808 1
   2809 
- 2810 e = QQ._coerce_(e)
   2811 n = e.numerator()
   2812 d = e.denominator()

/Applications/sage/local/lib/python2.5/site-packages/sage/structure/
parent_old.so in sage.structure.parent_old.Parent._coerce_ (sage/
structure/parent_old.c:4031)()

/Applications/sage/local/lib/python2.5/site-packages/sage/structure/
parent.so in sage.structure.parent.Parent.coerce (sage/structure/
parent.c:4185)()

TypeError: no canonical coercion from New Symbolic Ring to Rational
Field




--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sage problem

2009-03-19 Thread William Stein

On Thu, Mar 19, 2009 at 6:14 PM, ARMAND BRUMER bru...@fordham.edu wrote:
 Hi William,

 This is my first attempt to use sage. I have OSX 10.4.11 and just downloaded
 it.

 I wanted to use liu's program. After trying out your examples and getting
 the same result, I tried the example I was curious about and here is the
 output. Can you do better. Did I screw up?

 Thanks,
 armand

 sage: genus2reduction(x^3 + x^2 + x,-2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2)
 ---
 ValueError    Traceback (most recent call last)



You have found a bug in Sage.When I try the above by directly
using Liu's program (note that i have to remove the spaces in the
polynomials and use an explanation point to run the program), I get
the following problem:

sage: !genus2reduction

enter Q(x) : x^3+x^2+x
enter P(x) : -2*x^5+3*x^4-x^3-x^2-6*x-2

factorization CPU time = 5
a minimal equation over Z[1/2] is :
y^2 = x^6+18*x^3+36*x^2-27

factorization of the minimal (away from 2) discriminant :
[2,1;3,15;53,1]

p=2
(potential) stable reduction :  (II), j=1
reduction at p : [I{1-0-0}] page 170, (1), f=1
p=3
(potential) stable reduction :  (I)
reduction at p :   ***   expected character: ',' instead of: mod(y,y^2-3)

I don't know if this ever worked, but I bet it did, and PARI changed
from 2004 or whatever, until now, and we just didn't pick up the
change because we didn't test genus2reduction enough.

2. A second problem is that if genus2reduction works once, then fails,
then it fails to work again:

sage: R = genus2reduction(x^3 - 2*x^2 - 2*x + 1, -5*x^5)
sage: R.conductor
1416875
sage: R = genus2reduction(x^3 + x^2 + x,-2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2)
Traceback (most recent call last):
ValueError: error in input; possibly singular curve? (Q=x^3 + x^2 + x,
P=-2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2)
sage: R = genus2reduction(x^3 - 2*x^2 - 2*x + 1, -5*x^5)  # just worked above
Traceback (most recent call last):
...
ValueError: error in input; possibly singular curve? (Q=x^3 - 2*x^2 -
2*x + 1, P=-5*x^5)

---

When we fix this, we will of course have to write code to run through
random curves and verify that genus2reduction works sensibly on
millions of inputs.

Liu's program genus2reduction, included with Sage, is a C program that
is written to use the Pari C library.


I've posted the above to our bug tracking system:

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

Please report any and all other issues you find with Sage.  I'll email
you when the above gets fixed.

 -- William


 /Users/armandbrumer/sage/ipython console in module()

 /Users/armandbrumer/sage/local/lib/python2.5/site-packages/sage/interfaces/genus2reduction.pyc
 in __call__(self, Q, P)
     356 from sage.misc.all import sage_eval
     357
 -- 358 s, Q, P = self.raw(Q, P)
     359 raw = s
     360

 /Users/armandbrumer/sage/local/lib/python2.5/site-packages/sage/interfaces/genus2reduction.pyc
 in raw(self, Q, P)
     347 s = E.eval(str(P).replace(' ',''))
     348 except RuntimeError:
 -- 349 raise ValueError, error in input; possibly singular
 curve? (Q=%s, P=%s)%(Q,P)
     350 i = s.find('a minimal')
     351 j = s.rfind(']')

 ValueError: error in input; possibly singular curve? (Q=x^3 + x^2 + x,
 P=-2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2)





-- 
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Rob Beezer

Chris,

Some flakiness with Google Groups.  Here's the rest of what I wanted
to say.

Sage is *very* fast over ZZ, and I know you said that was irrelevant.
Use the command in the previous message to scale out the fractions, do
your computation, and then move the scalar back in to the result.  Not
sure what you are up to exactly, but with determinants and
polynomials, perhaps the scaling has a predictable effect.  I like the
looks of Mike's suggestion very much, and if this helps you get there,
then I think thousands of 30x30's are achievable.

Rob

On Mar 19, 9:29 pm, Rob Beezer goo...@beezer.cotse.net wrote:
 Chris,

 I'm having trouble posting a reply here.  Here's the essence of what I
 wanted to show you.  Perhaps more in just a minute.

 sage: m=matrix(QQ, [[3/2, 4/3], [1/7, 5/11])
 sage: m._clear_denoms()

 ([693 616]
 [ 66 210], 462)

 Rob

 On Mar 19, 8:13 pm, Mike Hansen mhan...@gmail.com wrote:

  On Mar 19, 6:54 pm, Chris Godsil cgod...@uwaterloo.ca wrote:

   What algorithm(s) does sage use to compute determinants over QQ[t] or
   QQ[t,u]?

  For both of these, it is computing them using minors, which is awful
  when the matrices are not tiny.

   Does they work over the ring of definition, or over the field of
   fractions?

  These work over the ring of definition.  If you work over the field of
  fractions, then you can get some speedup since you can put then matrix
  in Hessenberg form and read the determinant off from the
  characteristic polynomial.  For the CycleGraph(9):

  sage: m.change_ring(R.fraction_field()).det()
  t^9 - 9*t^7 + 27*t^5 - 30*t^3 + 9*t - 2
  CPU time: 0.54 s,  Wall time: 0.57 s

   over QQ[t] is not polynomial time. As the Reference Manual suggests, I
   entered
   M.determinant? to see what algorithm was being used, but did not get
   any useful information.

  In this case, doing M.determinant?? to see the actual source code
  gives you everything it's doing.

  --Mike
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread William Stein

On Thu, Mar 19, 2009 at 9:33 PM, Rob Beezer goo...@beezer.cotse.net wrote:

 Chris,

 Some flakiness with Google Groups.  Here's the rest of what I wanted
 to say.

 Sage is *very* fast over ZZ, and I know you said that was irrelevant.
 Use the command in the previous message to scale out the fractions, do
 your computation, and then move the scalar back in to the result.  Not
 sure what you are up to exactly, but with determinants and
 polynomials, perhaps the scaling has a predictable effect.  I like the
 looks of Mike's suggestion very much, and if this helps you get there,
 then I think thousands of 30x30's are achievable.


Mike's multimodular method is probably a pretty good first
nontrivial approach to this problem.

Chris -- you might want to talk with Arne Storjohann since he's
probably the world expert on algorithms for computing determinants of
matrices with entries in QQ[t], and he's in the same department as
you.  He's also responsible for IML, which is the library at the heart
of Sage's current code for computing det's over QQ and ZZ.
Asymptotically -- for matrices with large entries -- Sage is by far
the world's fastest program for computing determinants (e.g, handily
beating Magma).

Rob -- Sage computes det's over QQ currently internally by rescaling
to ZZ and computing the det there.

 -- 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sage problem

2009-03-19 Thread William Stein

On Thu, Mar 19, 2009 at 9:56 PM, ARMAND BRUMER bru...@fordham.edu wrote:
 Thanks, Bill,  for your prompt reply. I had noticed the second phenomenon
 and attributed it to my not knowing how to use sage properly! By the way, if
 you can get the conductor exponent at 3, I would be grateful. Liu's paper
 goes becomes a bit unclear with precisely this type of example. I think it
 is 3^2, but would like an independent check!

 Thanks again,

 armand
 PS I was trying to circumvent having to learn C to attach Liu's program to
 Pari (that I also do not have!)  I had an old version in Maple of Liu's
 program, but wanted to confirm...


Does the Maple program work on your input example?

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---