[sage-support] Re: feature request ...

2008-04-03 Thread Mike Hansen

Hello,

>  sage: r = matrix(SR, 4, 4, [[21,17,6,8], [-5,-1,-6,-3], [4,4,16,2],
>  [2,3,-4,-1]])
>  sage: r.exp()
>  .

This is happening since Maxima is failing to do the computation for
reasons that I don't know.  I suppose it wouldn't be too difficult to
write our own matrix exponentiation.

--Mike

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Genus calculation

2008-04-03 Thread Mike Hansen

Hello,

I think something like the following should get you going in the right
direction:

sage: delta = lambda m, n: (m-1)*(n-1)/2 + gcd(m,n)-1/2
sage: m = 3
sage: n = 2
sage: for m_part in Partitions(m):
:for n_part in Partitions(n):
:print "%s, %s"%(m_part, n_part)
:for mi in m_part:
:for ni in n_part:
:print "delta(%s,%s) = %s"%(mi,ni,delta(mi,ni))
:
[3], [2]
delta(3,2) = 3/2
[3], [1, 1]
delta(3,1) = 1/2
delta(3,1) = 1/2
[2, 1], [2]
delta(2,2) = 2
delta(1,2) = 1/2
[2, 1], [1, 1]
delta(2,1) = 1/2
delta(2,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
[1, 1, 1], [2]
delta(1,2) = 1/2
delta(1,2) = 1/2
delta(1,2) = 1/2
[1, 1, 1], [1, 1]
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2

You just need to combine the individual deltas in the appropriate way.

--Mike

On Thu, Apr 3, 2008 at 3:17 PM, Erick Galinkin <[EMAIL PROTECTED]> wrote:
>
>  Mike,
>  Thank you for responding!
>
>  delta is calculated by taking:
>
>  delta(m,n) = ((m-1)(n-1)/2)+(gcd(m,n)-1/2)
>
>  The issue I'm running into is getting sage to cycle these partitions
>  through this calculation. I can get the partitions and do it all by
>  hand, but that's an awful pain.
>
>  ~Erick
>
>
>
>  On Apr 3, 5:51 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
>  > Hi Erick,
>  >
>  > How do you calculate the delta invariant?  (This is not my area of
>  > math.)  How large of m and n do you want to work with?  For example,
>  > here is some Sage code to generate all the integer partitions of 40:
>  >
>  > sage: time l = Partitions(40).list()
>  > CPU times: user 0.50 s, sys: 0.03 s, total: 0.53 s
>  > Wall time: 0.56
>  > sage: len(l)
>  > 37338
>  > sage: l[:5]
>  > [[40], [39, 1], [38, 2], [38, 1, 1], [37, 3]]
>  >
>  > --Mike
>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Genus calculation

2008-04-03 Thread Erick Galinkin

Mike,
Thank you for responding!

delta is calculated by taking:

delta(m,n) = ((m-1)(n-1)/2)+(gcd(m,n)-1/2)

The issue I'm running into is getting sage to cycle these partitions
through this calculation. I can get the partitions and do it all by
hand, but that's an awful pain.

~Erick

On Apr 3, 5:51 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
> Hi Erick,
>
> How do you calculate the delta invariant?  (This is not my area of
> math.)  How large of m and n do you want to work with?  For example,
> here is some Sage code to generate all the integer partitions of 40:
>
> sage: time l = Partitions(40).list()
> CPU times: user 0.50 s, sys: 0.03 s, total: 0.53 s
> Wall time: 0.56
> sage: len(l)
> 37338
> sage: l[:5]
> [[40], [39, 1], [38, 2], [38, 1, 1], [37, 3]]
>
> --Mike
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Genus calculation

2008-04-03 Thread Mike Hansen

Hi Erick,

How do you calculate the delta invariant?  (This is not my area of
math.)  How large of m and n do you want to work with?  For example,
here is some Sage code to generate all the integer partitions of 40:

sage: time l = Partitions(40).list()
CPU times: user 0.50 s, sys: 0.03 s, total: 0.53 s
Wall time: 0.56
sage: len(l)
37338
sage: l[:5]
[[40], [39, 1], [38, 2], [38, 1, 1], [37, 3]]


--Mike

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Genus calculation

2008-04-03 Thread Erick Galinkin

I'm attempting to write a program using SAGE to calculate the genus of
a curve given the bidegree of the equation. However, I'm having a
problem when I use the partition function. Here's a rough sketch of
the algorithm:

prompt for m and n
partition m
partition n
calculate the delta invariant
calculate the genus
return the genus and repeat for the next piece of the partition.

For example, let us assume the value of m is 3 and the value of n is
2. Thus, we have:

m_part = [{3},{2,1},{1,1,1}]
n_part = [{2},{1,1}]

I need to calculate delta(3,2), and that's no problem. The problem is
then using some sort of loop to calculate delta({2,1},2) since for
larger numbers, the number of partitions is very large and would make
this task difficult. Is there anyone who may be able to help?

~Erick Galinkin

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Problems with Sage 2.11

2008-04-03 Thread Georg Muntingh

I did something stupid and your answer gave it away: I forgot that
that computer has an AMD Athlon inside it. Installing the Debian
Athlon binary did the job.

Thanks a lot for the very fast response. :)


On Apr 3, 6:28 pm, mabshoff <[EMAIL PROTECTED]
dortmund.de> wrote:
> On Apr 3, 6:23 pm, Georg Muntingh <[EMAIL PROTECTED]> wrote:
>
>
>
> > I just installed Sage 2.11 on an old computer that I upgraded to
> > Ubuntu Gutsy a couple of hours before. Any idea what's wrong?
>
> > [EMAIL PROTECTED]:~/Apps/sage-2.11-ubuntu32-intel-i686-Linux$ ./sage
> > --
> > | SAGE Version 2.11, Release Date: 2008-03-30|
> > | 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)...
> > Please do not interrupt this.
>
> > /home/georgm/Apps/sage-2.11-ubuntu32-intel-i686-Linux/local/bin/sage-
> > sage: line 214:  7325 Illegal instruction (core dumped) sage-
> > ipython "$@" -c "$SAGE_STARTUP_COMMAND;"
>
> That release has an ATLAS that uses instructions not available on that
> CPU. You can compile from source [which I assume would take an
> unreasonable amount of time] or uses the system's ATLAS build. See
> "QUESTION: I downloaded a Sage binary and it crashes on startup with
> Illegal instruction." fromhttp://wiki.sagemath.org/faq
>
> Cheers,
>
> Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: [sage-devel] Do I need Expect to invoke Sage from a *python* script?

2008-04-03 Thread Timothy Clemans

You have to use the Python install included with Sage which has
everything you need.

So write your script and then do "sage -python blah.py"

On Thu, Apr 3, 2008 at 11:35 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>  I saw the example that used Expect to invoke Sage from an external
>  program.
>
>  Is Expect necessary from Python scripts too?
>
>  Can I just import some sage modules and then call some functions from
>  Python?
>
>  Chris
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: feature request ...

2008-04-03 Thread Georg



> sage: matrix(SR, 3, 3, [[21,17,6],[-5,-1,-6],[4,4,16]]).exp()
>
> [  (13*e^16 - e^4)/4 (13*e^16 - 5*e^4)/4  (e^16 - e^4)/2]
> [   (e^4 - 9*e^16)/4  (5*e^4 - 9*e^16)/4  (e^4 - e^16)/2]
> [ 4*e^16  4*e^16e^16]
>
this does not work for 4x4 matrices, try
sage: r = matrix(SR, 4, 4, [[21,17,6,8], [-5,-1,-6,-3], [4,4,16,2],
[2,3,-4,-1]])
sage: r.exp()
.
Georg
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Mac install error

2008-04-03 Thread mabshoff



On Apr 3, 7:40 pm, tccraven <[EMAIL PROTECTED]> wrote:

Hi,

> Intel Mac, OS 10.4.11
> The install seemed to go okay, but when I try to run it, I seem to be
> missing something.  Also, some of the error messages mention Wiindows,
> so that seems very strange.  Can someone tell me exactly what I need
> based on the output?
>
> : dlopen(/Applications/sage/local/lib/
> python2.5/site-packages/sage/misc/misc_c.so, 2): Symbol not found:
> _close$UNIX2003

If it is complaining about a "UNIX2003" symbol I would guess that you
downloaded the OSX 10.5 binary. Can you make sure you really got the
10.4 binary?

>   Referenced from: /Applications/sage/local/lib//libpari-gmp.dylib
>   Expected in: flat namespace



Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Mac install error

2008-04-03 Thread tccraven

Intel Mac, OS 10.4.11
The install seemed to go okay, but when I try to run it, I seem to be
missing something.  Also, some of the error messages mention Wiindows,
so that seems very strange.  Can someone tell me exactly what I need
based on the output?

: dlopen(/Applications/sage/local/lib/
python2.5/site-packages/sage/misc/misc_c.so, 2): Symbol not found:
_close$UNIX2003
  Referenced from: /Applications/sage/local/lib//libpari-gmp.dylib
  Expected in: flat namespace

WARNING: Failure executing code: 'import sage.misc.preparser_ipython;
sage.misc.preparser_ipython.magma_colon_equals=True'
WARNING: Readline services not available on this platform.
WARNING: The auto-indent feature requires the readline library
WARNING: Proper color support under MS Windows requires the pyreadline
library.
You can find it at:
http://ipython.scipy.org/moin/PyReadline/Intro
Gary's readline needs the ctypes module, from:
http://starship.python.net/crew/theller/ctypes
(Note that ctypes is already part of Python versions 2.5 and newer).

Defaulting color scheme to 'NoColor'
---
   Traceback (most recent call
last)

/Applications/sage/local/bin/ in ()

/Users/was/build/sage-2.11/local/lib/python2.5/site-packages/sage/misc/
misc.py in ()

: dlopen(/Applications/sage/local/lib/
python2.5/site-packages/sage/misc/misc_c.so, 2): Symbol not found:
_close$UNIX2003
  Referenced from: /Applications/sage/local/lib//libpari-gmp.dylib
  Expected in: flat namespace



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: PDE and Finite Element methods

2008-04-03 Thread Ondrej Certik

On Thu, Apr 3, 2008 at 2:18 AM, William Stein <[EMAIL PROTECTED]> wrote:
>
>  On Wed, Apr 2, 2008 at 4:19 PM, Hector Villafuerte <[EMAIL PROTECTED]> wrote:
>  >
>  >  Hi,
>  >  I wonder what the current situation in SAGE is for dealing with PDE
>  >  and methods to solve them numerically, such as say Finite Elements.
>  >
>  >  A quick search threw this thread (which I'm afraid is not very 
> conclusive):
>  >  
> http://groups.google.com/group/sage-devel/browse_thread/thread/15c7e426fc571e26
>  >
>  >  Thanks in advance for any pointers!
>
>  I don't know, since that's not my area.   However, it would be a
>  really good idea
>  to ask this same question on the scipy list (maybe this one)?:
>http://projects.scipy.org/mailman/listinfo/scipy-dev
>
>  Also do a google search for
> pde finite element scipy
>  This paper that pops up might be relevant:
>http://ieeexplore.ieee.org/iel5/5992/4160244/04160257.pdf

I don't have access to this article, but from the author names, those
are people from the Simula laboratory doing SyFi.

>  Definitely report back.  We could put the best of what you find into
>  Sage, if it isn't
>  there already...

Yep, let us know what you like the best.

Writing a good FEM library is very hard. After trying fenics, syfi,
libmesh (I used that one for quite a long time), I ended up with
sfepy:

http://code.google.com/p/sfepy/

that is Python + C, maybe not so nice documented for newcomers, but
very simple, fast, doing all I need and having the author 100km from
Prague, where I live. :)

Ondrej

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Problems with Sage 2.11

2008-04-03 Thread mabshoff



On Apr 3, 6:23 pm, Georg Muntingh <[EMAIL PROTECTED]> wrote:
> I just installed Sage 2.11 on an old computer that I upgraded to
> Ubuntu Gutsy a couple of hours before. Any idea what's wrong?
>
> [EMAIL PROTECTED]:~/Apps/sage-2.11-ubuntu32-intel-i686-Linux$ ./sage
> --
> | SAGE Version 2.11, Release Date: 2008-03-30                        |
> | 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)...
> Please do not interrupt this.
>
> /home/georgm/Apps/sage-2.11-ubuntu32-intel-i686-Linux/local/bin/sage-
> sage: line 214:  7325 Illegal instruction     (core dumped) sage-
> ipython "$@" -c "$SAGE_STARTUP_COMMAND;"

That release has an ATLAS that uses instructions not available on that
CPU. You can compile from source [which I assume would take an
unreasonable amount of time] or uses the system's ATLAS build. See
"QUESTION: I downloaded a Sage binary and it crashes on startup with
Illegal instruction." from http://wiki.sagemath.org/faq

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Problems with Sage 2.11

2008-04-03 Thread Georg Muntingh

I just installed Sage 2.11 on an old computer that I upgraded to
Ubuntu Gutsy a couple of hours before. Any idea what's wrong?

[EMAIL PROTECTED]:~/Apps/sage-2.11-ubuntu32-intel-i686-Linux$ ./sage
--
| SAGE Version 2.11, Release Date: 2008-03-30|
| 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)...
Please do not interrupt this.

/home/georgm/Apps/sage-2.11-ubuntu32-intel-i686-Linux/local/bin/sage-
sage: line 214:  7325 Illegal instruction (core dumped) sage-
ipython "$@" -c "$SAGE_STARTUP_COMMAND;"

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Problem to access C code

2008-04-03 Thread bourba



On 31 mar, 00:15, bourba <[EMAIL PROTECTED]> wrote:
> On 30 mar, 22:37, "William Stein" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Sun, Mar 30, 2008 at 12:44 PM, bourba <[EMAIL PROTECTED]> wrote:
>
> > >  Hello.
>
> > >  I would like to access external C code so I have
> > >  exactly followed the example exposed in
> > >  http://www.sagemath.org/doc/html/tut/node51.html
> > >  (5.2.1 Accessing C Functions in Separate Files)
>
> > >  My directory "/home/mainuser/test_sage" contains
> > >  "test.c" plus "test.spyx" and when I type :
>
> > >  sage : load "/home/mainuser/test_sage/test.spyx"
>
> > >  then sage returns this error message:
>
> > >  Loading of file "/home/mainuser/test_sage/test.spy" has type not
> > >  implemented.
>
> > Try changing the filename to test.pyx and see if that helps.
>
> > William
>
> 1) I have renamed the file to test.pyx and now SAGE returns :
>
> Syntax Error:
> load "/home/mainuser/test_sage/test.pyx"
>
> 2) I use SAGE 2.10.4 (i686 athlon Debian)

I've upgraded to 2.11.
I still get the same symptom while
sage runs on notebook mode *but*
when I launch SAGE on console the example
given by the tutorial works fine (with the .spyx
extension.) I can't see the link between
the notebook-interface causing problem when
cython is simultaneously working...

Is it possible to increase the verbosity
of the error message ?

Thanks.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Sage 2.11 for OS X 10.5 not working properly

2008-04-03 Thread Samuel Gaehwiler

On Apr 3, 3:56 am, "William Stein" <[EMAIL PROTECTED]> wrote:

> Can you try this binary, which I just built for you on osx 10.5.2:
>
> http://sagemath.org/SAGEbin/apple_osx/intel/sage-2.11-osx10.5.2-intel...

Thank you William!
Sadly this maxima-starting-problem still occurs on my system. Since
everything is included in the sage folder I guess compiling the
sources myself wouldn't change anything.
But if someone more familiar with sage thinks this might be the cure I
certainly will compile it myself.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---