[sage-support] Re: convertor Sage - TeX - PDF

2009-11-02 Thread Stan Schymanski

Dear Wilfried,

The tutorial looks great! How did you do the numbered head lines and the 
index? Is the sage worksheet itself published somewhere?

Cheers
Stan

Wilfried_Huss wrote:

 On 29 Okt., 12:44, ma...@mendelu.cz ma...@mendelu.cz wrote:
   
 Hello all, the conversion into PDF has been discussed several times
 here.

 One option is to print into a PDF file. This is another possibility:

 I wrote for myself a simple converter from Sage worksheets to PDF via
 PDF LaTeX
 

 Great, this is exactly what I need.

   
 You can see the outputs in the bulletted list 
 athttp://user.mendelu.cz/marik/sage/
 , for examplehttp://user.mendelu.cz/marik/sage/dr.pdf

 The initial version of the script is 
 athttp://user.mendelu.cz/marik/sage/sage2tex
 and is neither cleanly written nor clever too much, but still better
 than get a wire into your eye - as we say in Czech :)

 For whom is this topic worth

 Feel free to use it or modify as you need.
 

 I have modified the skript a little bit. It now first builds a list of
 text-, input- and output
 cells, and then converts each sell to latex. This makes things much
 easier. I also
 added syntax highlighting for python, html and latex input cells, and
 if the output is not
 a tex formula it is put into a verbatim environment.

 The HTML-LaTeX conversion is still done by a bunch of regular
 expressions, so this
 will need some improvements. But it already works very well.

 You can find the new version of the script at:
http://www.math.tugraz.at/~huss/sage/sws2tex.py

 And here are example outputs:
http://www.math.tugraz.at/~huss/sage/sage_tutorium.pdf
http://www.math.tugraz.at/~huss/sage/sws2pdf_test.pdf

 Would you agree to release your initial script under the GPL or an
 other Sage compatible
 licence? I hope this can be improved to a point where it could be
 included into Sage, for
 this it needs a proper licence.

 Cheers,
 Wilfried Huss
 
   


--~--~-~--~~~---~--~~
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: Matrix inconsistency with decimal/fraction representations

2009-11-02 Thread John Cremona



On Nov 1, 5:34 pm, Michael Orlitzky mich...@orlitzky.com wrote:
 This one had me stumped for a while. I'm using 4.1.1 here, but found the
 same results in a 4.1.2 notebook. The solve_foo() methods are broken,
 too; probably as a consequence.

 # Good

 sage: m = matrix([ [(-3/10), (1/5), (1/10)],
                     [(1/5), (-2/5), (2/5)],
                     [(1/10), (1/5), (-1/2)] ])

 sage: m.echelon_form()

 [   1    0 -3/2]
 [   0    1 -7/4]
 [   0    0    0]

 # Bad

 sage: n = matrix([ [-0.3, 0.2, 0.1],
                     [0.2, -0.4, 0.4],
                     [0.1, 0.2, -0.5] ])

 sage: n.echelon_form()

 [ 1.00 0.000 0.000]
 [0.000  1.00 0.000]
 [0.000 0.000  1.00]


sage: n.det()
1.04083408558608e-17
sage: n.parent()
Full MatrixSpace of 3 by 3 dense matrices over Real Field with 53 bits
of precision

So to the given precision, n is invertible so its echelon form is the
identity.  But if you convert m to a very high precision RealField:
MatrixSpace(RealField(1),3)(m).echelon_form()
still gives the identity matrix, so this looks bad.  (The determinant
is 0 to 10^4 decimals in that example!)


 # Ugly

 sage: m == n
 True

I think this is a coercion issue.  I agree taht the result is not
mathematically nice at all:
sage: m==n
True
sage: m.rank(), n.rank()
(2, 3)

John Cremona

--~--~-~--~~~---~--~~
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: latex issue after upgrading to 4.2

2009-11-02 Thread Flavio Coelho

Thanks,

that fixed it. I Downloaded the fonts and unpacked them to the
~/.fonts/ directory.



On Oct 30, 4:43 pm, Jason Grout jason-s...@creativetrax.com wrote:
 ma...@mendelu.cz wrote:

  On 30 říj, 13:30, Flavio Coelho fccoe...@gmail.com wrote:
  I forgot to mention my platform:

  Ubuntu Karmic Koala,
  Firefox 3.5.3

  From:http://www.math.union.edu/~dpvc/jsMath/changes.html

  The linux version of Firefox 3.5 doesn't seem to be able to read the
  jsMath TeX fonts (probably due to the non-standard encoding), and so
  new versions have been provided on the font download page for linux
  users.

 My hunch is that this is the problem.  Especially if you just installed
 Karmic and thus upgraded to Firefox 3.5.  Please replace your jsmath
 fonts with the special linux Firefix 3.5 fonts found here:

 http://www.math.union.edu/~dpvc/jsMath/download/jsMath-fonts.html

 (specifically, install 
 these:http://www.math.union.edu/~dpvc/jsMath/download/TeX-fonts-linux.tgz)

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



[sage-support] Polynomial approximation of a function

2009-11-02 Thread Nathann Cohen
Hello !!!

I remember there is an easy way ( through matrices ) to get the best
approximation of a function by a polynomial of bounded degree ( and not only
the usual approximation by a line ) I looked for such functions in Sage,
but found none... Does it mean there is not already in Sage some function to
compute it ( it would be a shame !!! ), or just that I once more failed to
look for a functio properly ( and that would be a shame, too ) :-)

Thank you for your help !!!

Nathann

--~--~-~--~~~---~--~~
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: Polynomial approximation of a function

2009-11-02 Thread Laurent

Nathalie Cohen ha scritto:
 Hello !!!

 I remember there is an easy way ( through matrices ) to get the best
 approximation of a function by a polynomial of bounded degree ( and not only
 the usual approximation by a line )
Are you speaking about the Taylor expansion ?
If so, it is implemented in Sage, but I don't remember the exact names. 
(searching for Taylor in the documentation)

have a good afternoon
Laurent


--~--~-~--~~~---~--~~
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] Ubuntu 9.10

2009-11-02 Thread davedo2

Is the binary for Ubuntu 9.04 also to be used under Ubuntu 9.10 or
will a new one be posted?
--~--~-~--~~~---~--~~
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: Ubuntu 9.10

2009-11-02 Thread Laurent

davier2 ha scritto:
 Is the binary for Ubuntu 9.04 also to be used under Ubuntu 9.10 or
 will a new one be posted?
   


I'm running Sage 4.2 under Karmic, using the file 
sage-4.2-linux-Ubuntu_9.04-i686-Linux.tar.gz
Seems to work for me.

Laurent

--~--~-~--~~~---~--~~
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: Polynomial approximation of a function

2009-11-02 Thread Jason Grout

Robert Bradshaw wrote:
 On Nov 2, 2009, at 8:41 AM, Nathann Cohen wrote:
 
 Hello !!!

 I remember there is an easy way ( through matrices ) to get the  
 best approximation of a function by a polynomial of bounded degree  
 ( and not only the usual approximation by a line ) I looked for  
 such functions in Sage, but found none... Does it mean there is not  
 already in Sage some function to compute it ( it would be a  
 shame !!! ), or just that I once more failed to look for a functio  
 properly ( and that would be a shame, too )
 
 Are you thinking of Chebyshev polynomials? I don't think there is, but  
 there might be as part of scipy. I've got (two) implementations of  
 them that I haven't had time to put into Sage proper, but they're  
 pretty straightforward to implement.
 

Sage also includes mpmath, which appears to have appropriate functions:

http://mpmath.googlecode.com/svn/trunk/doc/build/calculus/approximation.html

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



[sage-support] Re: numerical integration of bessel_J functions

2009-11-02 Thread kcrisman

 integration.  The problem here is that bessel_J is not a symbolic
 function, and does not know how to deal with symbolic variables.  It
 would be great if someone submitted a patch to take care of this!

Yes, in an ideal world we would have already taken care of this, since
this sort of numerical integration cum variables thing really does
come up quite often.

What would be even greater is if someone who uses functions like this
relatively often opened a ticket with all (to their knowledge)
functions Sage has that should also have symbolic variants for
something like integration, or at least to accept symbolic variables.
It would be a lot easier to take care of all of these at once.
Unfortunately, it seems that some special functions don't live in
Ginac by default (see 
http://www.ginac.de/tutorial/Built_002din-functions.html#Built_002din-functions).

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



[sage-support] Re: Polynomial approximation of a function

2009-11-02 Thread Nathann Cohen

Thank you for your answers !!

I was thinking about some multidimensional linear approximation, where
the basis you use is ( for points of coordinates (x_i, y_i ) ) the
vectors
The family of x_i, x_i
The family of x_i, x_i^2
The family of x_i, x_i^3
The family of x_i, x_i^4
...

But it turns out Scipy was the asnwer Thank you very much :-)

Nathann

On Nov 2, 7:15 pm, Jason Grout jason-s...@creativetrax.com wrote:
 Robert Bradshaw wrote:
  On Nov 2, 2009, at 8:41 AM, Nathann Cohen wrote:

  Hello !!!

  I remember there is an easy way ( through matrices ) to get the  
  best approximation of a function by a polynomial of bounded degree  
  ( and not only the usual approximation by a line ) I looked for  
  such functions in Sage, but found none... Does it mean there is not  
  already in Sage some function to compute it ( it would be a  
  shame !!! ), or just that I once more failed to look for a functio  
  properly ( and that would be a shame, too )

  Are you thinking of Chebyshev polynomials? I don't think there is, but  
  there might be as part of scipy. I've got (two) implementations of  
  them that I haven't had time to put into Sage proper, but they're  
  pretty straightforward to implement.

 Sage also includes mpmath, which appears to have appropriate functions:

 http://mpmath.googlecode.com/svn/trunk/doc/build/calculus/approximati...

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



[sage-support] Possible to view cython annotation from command line

2009-11-02 Thread Justin Domke

Hello,

When developing cython code, I find the annotation .html files
(showing yellow lines where python calls are, etc.)  useful.  I can do
this from the notebook interface, or (apparently) from command-line
usage of cython, but I'm not sure it it is possible to do from the
sage command line.  it would be nice to when, for example, attaching
a .spyx file, have the corresponding .html file generated somewhere
when it is compiled.

thanks,
Justin
--~--~-~--~~~---~--~~
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: Ubuntu 9.10

2009-11-02 Thread davedo2

OK, I downloaded Sage 4.2 and -testall seemed OK. However, I have a
question: if I evaluate pari(7).isprime() in the notebook it returns
True, but if I try it from the Sage command line it spawns a longish
list of errors - what's up with that?

Also, is there a way to invoke it such that it returns 1 or 0 instead
of True or False? Thanks...Dave

On Nov 2, 9:56 am, Laurent moky.m...@gmail.com wrote:
 davier2 ha scritto:

  Is the binary for Ubuntu 9.04 also to be used under Ubuntu 9.10 or
  will a new one be posted?

 I'm running Sage 4.2 under Karmic, using the file
 sage-4.2-linux-Ubuntu_9.04-i686-Linux.tar.gz
 Seems to work for me.

 Laurent
--~--~-~--~~~---~--~~
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: Ubuntu 9.10

2009-11-02 Thread Robert Bradshaw

On Nov 2, 2009, at 3:22 PM, davedo2 wrote:


 OK, I downloaded Sage 4.2 and -testall seemed OK. However, I have a
 question: if I evaluate pari(7).isprime() in the notebook it returns
 True, but if I try it from the Sage command line it spawns a longish
 list of errors - what's up with that?

 Also, is there a way to invoke it such that it returns 1 or 0 instead
 of True or False? Thanks...Dave

How about

sage: int(pari(7).isprime())
1

Though I don't know what the advantage to return 1 or 0 would be. Note  
that

sage: sum(is_prime(n) for n in range(100))
25

works just fine.

BTW, you don't have to invoke pari explicitly here, it's faster to do

sage: is_prime(7)
True
sage: int(is_prime(7))
1

- Robert


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



[sage-support] Re: Possible to view cython annotation from command line

2009-11-02 Thread Robert Bradshaw

On Nov 2, 2009, at 3:10 PM, Justin Domke wrote:


 Hello,

 When developing cython code, I find the annotation .html files
 (showing yellow lines where python calls are, etc.)  useful.  I can do
 this from the notebook interface, or (apparently) from command-line
 usage of cython, but I'm not sure it it is possible to do from the
 sage command line.  it would be nice to when, for example, attaching
 a .spyx file, have the corresponding .html file generated somewhere
 when it is compiled.

Try running sage -cython -a path/to/script.spyx, and it should  
generate the .html file for you (that's what the -a option does).

- Robert



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



[sage-support] Re: Possible to view cython annotation from command line

2009-11-02 Thread Justin Domke

Thanks, that works perfectly!  One other question-- is there any way
to get .html output when attaching a .spyx file?  (Perhaps this is
asking a lot...)
--~--~-~--~~~---~--~~
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: Possible to view cython annotation from command line

2009-11-02 Thread Robert Bradshaw

On Nov 2, 2009, at 3:56 PM, Justin Domke wrote:


 Thanks, that works perfectly!  One other question-- is there any way
 to get .html output when attaching a .spyx file?  (Perhaps this is
 asking a lot...)

No, I don't imagine it would be super hard to do though.

- Robert



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



[sage-support] Re: Ubuntu 9.10

2009-11-02 Thread davedo2

Robert,

Thanks for setting me straight on True vs 1. I still wonder though
about the first part of my question.
Why does pari(7).isprime() work just fine in the notebook, but not
from the Sage command line? Thank you for being patient...Dave

On Nov 2, 3:48 pm, Robert Bradshaw rober...@math.washington.edu
wrote:
 On Nov 2, 2009, at 3:22 PM, davedo2 wrote:



  OK, I downloaded Sage 4.2 and -testall seemed OK. However, I have a
  question: if I evaluate pari(7).isprime() in the notebook it returns
  True, but if I try it from the Sage command line it spawns a longish
  list of errors - what's up with that?

  Also, is there a way to invoke it such that it returns 1 or 0 instead
  of True or False? Thanks...Dave

 How about

 sage: int(pari(7).isprime())
 1

 Though I don't know what the advantage to return 1 or 0 would be. Note  
 that

 sage: sum(is_prime(n) for n in range(100))
 25

 works just fine.

 BTW, you don't have to invoke pari explicitly here, it's faster to do

 sage: is_prime(7)
 True
 sage: int(is_prime(7))
 1

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



[sage-support] Re: Ubuntu 9.10

2009-11-02 Thread Marshall Hampton

pari(7).isprime() works fine for me in the sage command line with
sage-4.2.  What error are you getting?

-M. Hampton

On Nov 2, 9:03 pm, davedo2 dave...@gmail.com wrote:
 Robert,

 Thanks for setting me straight on True vs 1. I still wonder though
 about the first part of my question.
 Why does pari(7).isprime() work just fine in the notebook, but not
 from the Sage command line? Thank you for being patient...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
URL: http://www.sagemath.org
-~--~~~~--~~--~--~---