[sage-support] Any way to organize notebooks in folders?

2010-12-12 Thread Nin
I am starting to collect lots of sage notebooks and I was wondering if 
is there any way to store the in different directories.


Thanks a lot 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
URL: http://www.sagemath.org


Re: [sage-support] Any way to organize notebooks in folders?

2010-12-12 Thread Minh Nguyen
Hi Jose,

On Sun, Dec 12, 2010 at 11:38 PM, Nin n...@neurohost.org wrote:
 I am starting to collect lots of sage notebooks and I was wondering if is
 there any way to store the in different directories.

Short answer: no.

Long answer: 
http://groups.google.com/group/sage-notebook/browse_thread/thread/d9ca4981b2214e94

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


Re: [sage-support] New Magma Calculator Interface - magma_free() needs update

2010-12-12 Thread Alexey U. Gudchenko
12.12.2010 02:31, Ugur пишет:
 As the layout of Magma's website have changed, the code for
 magma_free() should be updated. Just want to bring to your attention.
 

I have edit file according new redesign of Magma's  website

Sage-4.6.3/local/lib/python2.6/site-packages/sage/interfaces/magma_free.py

In atachment there is result.

It work for example as in documentation:

 print magma_free(Factorization(9290348092384))
[ 2, 5, 290323377887, 1 ]


I don't understand Magma and can't know more difucult examples, so it
must be verified !!!


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
#*
#   Copyright (C) 2007 William Stein wst...@gmail.com
#
#  Distributed under the terms of the GNU General Public License (GPL)
#
#This code is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#General Public License for more details.
#
#  The full text of the GPL is available at:
#
#  http://www.gnu.org/licenses/
#*

class MagmaExpr(str):
def __repr__(self): 
return str(self)

def magma_free_eval(code, strip=True, columns=0):

Use the free online MAGMA calculator to evaluate the given
input code and return the answer as a string.   

LIMITATIONS: The code must evaluate in at most 20 seconds
and there is a limitation on the amount of RAM.

EXAMPLES:
sage: magma_free(Factorization(9290348092384))  # optional - internet
[ 2, 5, 290323377887, 1 ]

import urllib, httplib

server = magma.maths.usyd.edu.au
processPath = /calc/process.xml
refererPath = /calc/
refererUrl = http://%s%s; % ( server, refererPath)
code = SetColumns(%s);\n%columns + code
params = urllib.urlencode({'input':code})
headers = {Content-type: application/x-www-form-urlencoded, Accept:Accept: text/html, application/xml, application/xhtml+xml, Referer: refererUrl}
conn = httplib.HTTPConnection(server)
conn.request(POST, processPath, params, headers)
response = conn.getresponse()
results = response.read()
conn.close()

# Result form is:
# ?xml version=1.0?
# calculator
#		headers
#		 max_time60/max_time
# seed341657781/seed
# version2.17-1/version
# time0.320/time
# memory9.53MB/memory
#/headers
#results
#line[ lt;2, 5gt;, lt;290323377887, 1gt; ]/line
#/results
# /calculator

# results = ?xml version=1.0?calculatorheadersmax_time60/max_timeseed341657781/seedversion2.17-1/versiontime0.320/timememory9.53MB/memory/headersresultsline[ lt;2, 5gt;, lt;290323377887, 1gt; ]/line/results/calculator

from xml.dom.minidom import parseString
xmlDoc = parseString(results)

res = None
# oHeaders =  doc.getElementsByTagName('headers')   # for version and timing

reslutsNodeList = xmlDoc.getElementsByTagName('results')
if len(reslutsNodeList)  0:
reslutsNode = reslutsNodeList[0]
lines = reslutsNode.getElementsByTagName('line')
if len(reslutsNodeList)  0:
for line in lines:
textNode = line.childNodes[0]
res = textNode.data  
# res is unicode string:  u'[ 2, 5, 290323377887, 1 ]

class MagmaExpr(str):
   def __repr__(self): 
  return str(self)
  
return MagmaExpr(res)

class MagmaFree:

Evaluate MAGMA code without requiring that MAGMA be installed
on your computer by using the free online MAGMA calculator.

EXAMPLES:
sage: magma_free(Factorization(9290348092384))  # optional - internet
[ 2, 5, 290323377887, 1 ]

def eval(self, x, **kwds):
return magma_free_eval(x)
def __call__(self, code, strip=True, columns=0):
return magma_free_eval(code, strip=strip, columns=columns)

magma_free = MagmaFree()


[sage-support] Installing SAGE alongside existing Python installation

2010-12-12 Thread Juanlu_001
Hello everybody, I am a Spanish aerospace engineering student and I
use SAGE every day to do my homework. It is amazing that such a piece
of software exists free of charge and freely distributed.

I know that SAGE is self-contained, but I wanted to know if it's
possible to install it in a way that it uses, for example, my existing
Pyhton installation (Linux user here). If I could do that I could save
lots of disk space.

Is there any way to accomplish what I'm asking? I do not fear the
shell or source code.

Regards,

Juan Luis Cano

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Installing SAGE alongside existing Python installation

2010-12-12 Thread Harald Schilly
On Sunday, December 12, 2010 3:49:33 PM UTC+1, Juanlu_001 wrote:Is
there any way to accomplish what I'm asking? I do not fear the
shell or source code.


It's possible and done for some linux distributions, but I don't think
it's a good idea for you. You can look into Sage's local/lib/python2.6
folder, where you can see that you can only save about 40MB (all the
rest is in the site packages which are part of sage anyways). Also,
Sage is only tested to work well with the given python version. That
might not be true for other ones, because some libs directly access
python internal datastructures that might be subject to changes and so
on. Rather, you could go the other way round and use sage -python as
your python interpreter or work inside the Sage Environment via $
sage -sh ... depending on what you want to accomplish.


H

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: New Magma Calculator Interface - magma_free() needs update

2010-12-12 Thread Ugur
Hey thanks for the new code. But unfortunately, if I understood
correctly, the new code just takes the last line of the output :
( E.g., compare results of magma_free('[[a,b,c]:a,b,c in [1..20] |
a^2+b^2 eq c^2 and a le b];') both in Sage and in Magma-Calc. There
might be another problem, but for the time being, I can report this
problem.

On Dec 12, 3:10 am, Alexey U. Gudchenko p...@goodok.ru wrote:
 12.12.2010 02:31, Ugur пишет:

  As the layout of Magma's website have changed, the code for
  magma_free() should be updated. Just want to bring to your attention.

 I have edit file according new redesign of Magma's  website

 Sage-4.6.3/local/lib/python2.6/site-packages/sage/interfaces/magma_free.py

 In atachment there is result.

 It work for example as in documentation:

  print magma_free(Factorization(9290348092384))

 [ 2, 5, 290323377887, 1 ]

 I don't understand Magma and can't know more difucult examples, so it
 must be verified !!!

  magma_free.py
 3KViewDownload

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Interfacing with Pari

2010-12-12 Thread John Cremona
Victor,

It is quite likely true that the functionality which you are using
from PARI/gp is usable from Sage without you needing to do the
interface yourself.

For example:

sage: E = EllipticCurve([0,0,-1,1,0])
sage: an = E.anlist(1000)
sage: q = CC(2*pi*I*(0.1+0.2*I)).exp()   // randomly chosen point in
upper half-plane!
sage: sum([an[n]*q^n for n in range(1,1000)])
0.175210435119826 + 0.0210885398756192*I

Note also
sage: phi = E.modular_parametrization()
sage: phi(0.1+0.2*I)
(13.1933643695215 - 15.0369223250467*I : -25.6051807665959 +
85.5625648931529*I : 1.00)


John Cremona

On Dec 11, 10:06 pm, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 On 2010-12-11 20:24, victor wrote:

  I work with 'Sage Version 4.6, Release Date: 2010-10-30' on a Mac OS X
  10.6.5.

  I have some problems interfacing with Pari, probably due to my
  inexperience. Could you please tell me why do I get the errors below?

 The problem with what you are doing is that Sage variables and PARI
 variables are completely distinct.  In fact, it is probably best to
 avoid PARI variables as much as possible and use only Sage variables.

  sage: E = pari('ellinit([0,0,1,-1,0])')

 Here, E is a Sage variable.

  sage: pari('a=ellan(E,1000)')

 You are trying to use a Sage variable in PARI, which doesn't work

  I know I can instead do the following, which works:
  sage: a=pari(E.ellan(1000))

 This works indeed.  Note that you don't need the pari() here, because
 E.ellan() already returns an object of type gen (which is the type for
 PARI objects).

  But then the line below produces again a similar error:

  sage: pari('sum(n=1,5,a[n]*q^n)')

 If you want to do this, you could do
 sage: pari('a=%s; sum(n=1,5,a[n]*q^n)'%a)

 Here, %s is replaced by the string representation of a.  Note that
 this is not very efficient because strings are used, it is also error-prone.

 Jeroen.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Minimum Spanning Trees

2010-12-12 Thread Graham Enos
Thanks Minh! I must say, it's rather exciting having open source
software
that fits my needs so well and is both well and speedily maintained. I
hope
to get more involved in the future with this incredible software and
community.

Graham

On Dec 10, 2:07 am, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi Graham,

 On Mon, Dec 6, 2010 at 4:57 AM, Graham Enos graham.e...@gmail.com wrote:
  I wasn't sure if I should submit a ticket on this or not, since it
  seems to fall under unexpected behavior rather than software bug.
  I've been working through some small graph theory problems and was
  computing minimum spanning trees on graphs with weighted edges (where
  edges were assigned a weight as their label). I was getting completely
  unexpected behavior; after some digging, I found that
  G.min_spanning_tree() defaults to setting all edge weights to 1, even
  if the edges have weights assigned.

 The patch at ticket #10433

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

 should fix the problem you were experiencing, at least for the case
 where you use Kruskal's algorithm to find a minimum spanning tree.

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


[sage-support] Re: Installing SAGE alongside existing Python installation

2010-12-12 Thread Juanlu_001
Hmm, you are right, I might break something if I don't stuck in 2.6...
All right, thank you very much anyway.

On Dec 12, 3:57 pm, Harald Schilly harald.schi...@gmail.com wrote:
 On Sunday, December 12, 2010 3:49:33 PM UTC+1, Juanlu_001 wrote:Is

 there any way to accomplish what I'm asking? I do not fear the
 shell or source code.

 It's possible and done for some linux distributions, but I don't think
 it's a good idea for you. You can look into Sage's local/lib/python2.6
 folder, where you can see that you can only save about 40MB (all the
 rest is in the site packages which are part of sage anyways). Also,
 Sage is only tested to work well with the given python version. That
 might not be true for other ones, because some libs directly access
 python internal datastructures that might be subject to changes and so
 on. Rather, you could go the other way round and use sage -python as
 your python interpreter or work inside the Sage Environment via $
 sage -sh ... depending on what you want to accomplish.

 H

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: show()ing 3-tuples of matrices as images?

2010-12-12 Thread Dan Drake
On Fri, 10 Dec 2010 at 10:09AM -0800, jvkersch wrote:
 On Dec 9, 9:57 pm, Dan Drake dr...@kaist.edu wrote:
  *facepalm* That was stupid -- matrix_plot() already accepts numpy arrays
  of shape (x,y,3) and plots them as a color image exactly the way I want.
  No need to mess around with pylab.imshow().
 
  Sorry for the noise.
 
 Actually, your message gave me some good ideas of how to visualize the
 SVD decomposition in my linear algebra class, so not noise at all :)

Here's a published version: https://sagenb.kaist.ac.kr:8066/home/pub/23

Enjoy.

Dan

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


signature.asc
Description: Digital signature


[sage-support] Having trouble getting *ultra* high precision in this infinite sum calculation...

2010-12-12 Thread Chris Seberino
I wanted to confirm that a certain infinite sum agrees with a certain
number to thousands of digits of accuracy.  I know this is true from a
fascinating formula at the top of page 2 of the paper referenced
here:
http://arxiv.org/abs/math.GM/0409014/

The following one liner outputs the error in the sum

sage: n(100*sqrt(pi/log(10.0))-sum(10^(-k^2/1.0) for k in
range(-1,1)))
-1.27897692436818e-13

My finite sum should approximate the infinite sum more accurately as I
change the 1 to 2 but it does not

sage: n(100*sqrt(pi/log(10.0))-sum(10^(-k^2/1.0) for k in
range(-2,2)))
-1.27897692436818e-13

Why isn't the error improving as I increase the number of terms that
are summed?  Am I doing something wrong in Sage?  (Yes it is possible
that this infinite sum converges unimaginably slowly so I wanted to
check first I wasn't doing something dumb.)

Thanks,

Chris

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org