[sage-support] unable to get SAGE working on my debian lenny machine ...

2009-05-26 Thread Rajeev Singh
Hi, I have recently started using SAGE on sagenb.org and I am very impressed by it. I have downloaded the full system and was following the instruction given, but it didn't work for me. Precisely, the following problems come - 1. it is unable to execute the binary file 10:38:07 $ ./sage -

[sage-support] Re: unable to get SAGE working on my debian lenny machine ...

2009-05-26 Thread Rajeev Singh
Thanks a lot William. This was the problem. > He downloaded the wrong binary for his computer/OS. Maybe he > downloaded a 64-bit binary for a 32-bit operating system or something. > I downloaded the correct binary and its working fine. Sorry for a question, which should not have been there in f

[sage-support] Re: create a subdiagonal matrix quickly

2009-06-21 Thread Rajeev Singh
> > I should mention that these methods are all nice for this problem, but > they also end up copying an awful lot of zeros. I think it would be way > more efficient in general to make a zero matrix, then set the right > diagonal by hand using a for loop. > Don't you think using a sparse matrix w

Re: [sage-support] Re: Why isn't Sage showing plots from matplotlib/pylab ?

2010-05-14 Thread Rajeev Singh
> Is there any way to get only one plot in one figure? Yes, use plt.figure(). plt.plot( ... ) plt.savefig('a.png') plt.figure() plt.plot( ...) plt.savefig('b.png') # you can actually give the same name if you are doing it in different cells Rajeev On Fri, May 14, 2010 at 1:29 PM, zetro wrote

Re: [sage-support] interact question

2010-05-18 Thread Rajeev Singh
here is the answer to the first thing. use auto_update=False - sage: @interact ... def _(A=matrix(QQ,3,3,range(9)), v=matrix(QQ,3,1,range(3)), auto_update=False): ... try: ... x = A\v ... html('$$%s %s = %s$$'%(latex(A), latex(x), latex(v))) ... except: ... html('Th

Re: [sage-support] Re: using existing functions with vectors / lists / arrays

2011-05-22 Thread Rajeev Singh
On Sun, May 22, 2011 at 4:45 PM, Berkin Malkoc wrote: > > > > > I have something like: >> > y = x^2 >> > >> > I can evaluate it at one point: >> > y(2) # 4 >> > >> > I'd like to evaluate it at a group of points: >> > y( x ) # 2, 4, 9, 16, ... >> > >> > Can this "just work" like in IDL

Re: [sage-support] Re: imposing commutation relation

2011-05-23 Thread Rajeev Singh
Hi, I think my other question got buried in the first one, so here it is again. If I have - sage: R. = FreeAlgebra(QQ, 2) sage: a*(a+b) a^2 + a*b Is there a simple way to get a*a instead of a^2 ? Rajeev -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from

Re: [sage-support] Re: imposing commutation relation

2011-05-24 Thread Rajeev Singh
Thanks Simon, i think list of lists and tuples are good enough for me. sage: R. = FreeAlgebra(QQ, 2) > sage: p = a*(a+2*b) > sage: list(p) > [(2, a*b), (1, a^2)] > is there a simple way to reverse this last step? just for information - i asked this same question at the sympy mailing list and i

Re: [sage-support] Re: imposing commutation relation

2011-05-26 Thread Rajeev Singh
On Wed, May 25, 2011 at 11:55 AM, Simon King wrote: > Hi Rajeev, > > On 25 Mai, 06:14, Rajeev Singh wrote: > > sage: R. = FreeAlgebra(QQ, 2) > > > > > sage: p = a*(a+2*b) > > > sage: list(p) > > > [(2, a*b), (1, a^2)] > > > > is ther

Re: [sage-support] Import Ellipse module?

2011-05-27 Thread Rajeev Singh
On Thu, May 26, 2011 at 10:26 PM, Mel wrote: > Do I need to download/load something before I can import the ellipse > module? > > When I type >from sage.plot.ellipse import Ellipse > I get "ImportError: No module named ellipse" > > Thanks! > > -- > To post to this group, send email to sage-su

Re: [sage-support] Log log plots in sage.

2011-06-13 Thread Rajeev Singh
Hi, One way using pylab is following - sage: import pylab as plt sage: x = plt.array([2^ii for ii in range(10)]) sage: y = x^2 sage: plt.loglog(x, y, '.') [] sage: plt.savefig('/home/rajeev/a.png') Hope it helps. Rajeev -- To post to this group, send email to sage-support@googlegroups.com To

Re: [sage-support] function of vector variables

2011-07-08 Thread Rajeev Singh
On Tue, Jun 21, 2011 at 5:37 PM, Dmitry Shkirmanov wrote: > Hello, i think that my question is simple one, but i have not found > answer in the reference manual. I need a function of vector variables. > For example: > var("x1,x2,x3") > x=vector([x1,x2,x3]) > Is it possible to define a function of

Re: [sage-support] dirac delta function

2011-07-11 Thread Rajeev Singh
On Mon, Jul 11, 2011 at 9:43 AM, robin hankin wrote: > Hi. > > When I type > > integrate(dirac_delta(x),x,-1,1) > > > I expected to get 1, as the documentation clearly implies. > > But instead I get a symbolic answer. > > How do I make sage return 1? > > > > > cheers > > Robin > > > -- > Robin Han

[sage-support] f2py error within sage

2011-07-30 Thread Rajeev Singh
Hi, I have a script (say a.py) which uses a function written in fortran 90. Within the script I give the command to compile using - os.system('f2py -c PD_evolve.f90 -m PD_evolve') It works fine on my computer if I run the script using - python a.py However it doesn't work if I use - sage -pyt

[sage-support] Re: f2py error within sage

2011-08-02 Thread Rajeev Singh
On Sat, Jul 30, 2011 at 1:42 PM, Rajeev Singh wrote: > Hi, > > I have a script (say a.py) which uses a function written in fortran 90. > Within the script I give the command to compile using - > > os.system('f2py -c PD_evolve.f90 -m PD_evolve') > > It work

[sage-support] ode_solver in cython

2011-08-10 Thread Rajeev Singh
Hi, I am not able to understand why the following should not work (in notebook) - cell 1 ## %cython from sage.all import ode_solver, random cdef class A: cdef double mu def __init__(self, double mu=1.): self.mu = mu def func(self, x):

[sage-support] fortran example in numerical sage document not working

2011-08-13 Thread Rajeev Singh
Hi, If I put the following in notebook, I don't get what is expected, i.e. a function called linearequations - fortran.libraries = ['lapack', 'blas'] code = '''!f90 Subroutine LinearEquations(A,b,n) Integer n Real*8 A(n,n), b(n) Integer i, j, pivot(n), ok call DGESV(n, 1, A, n, pivot, b, n, ok)

[sage-support] Fwd: Speeding up Python Again

2011-08-23 Thread Rajeev Singh
On Wed, Aug 10, 2011 at 6:48 PM, Rajeev Singh wrote: > Hi, > I was trying out the codes discussed > at http://technicaldiscovery.blogspot.com/2011/07/speeding-up-python-again.html > Here is a summary of my results - > Computer: Desktopimsc9arav

Re: [sage-support] noob q: solve in loop doesn't iterate each time

2011-09-07 Thread Rajeev Singh
On Wed, Sep 7, 2011 at 7:31 PM, Chipslinger wrote: > I've been messing around with using Sage for solving node equations. I > have the right syntax and structure for creating and symbolically > solving equations, but am struggling with: >    * Using solve in a loop -- it doesn't evaluate using new

[sage-support] gsl in sage outside of notebook

2011-09-14 Thread Rajeev Singh
Hi, The following examples compiles from the notebook %cython cimport sage.gsl.ode import sage.gsl.ode include 'gsl.pxi' cdef class van_der_pol(sage.gsl.ode.ode_system): cdef double beta def __cinit__(self, double beta=1.0): self.beta = beta cdef int c_f(self,double t, double

[sage-support] Re: gsl in sage outside of notebook

2011-09-14 Thread Rajeev Singh
On Wed, Sep 14, 2011 at 3:01 PM, Rajeev Singh wrote: > Hi, > > The following examples compiles from the notebook > > %cython > cimport sage.gsl.ode > import sage.gsl.ode > include 'gsl.pxi' > > cdef class van_der_pol(sage.gsl.ode.ode_system): >    cdef

Re: [sage-support] gsl in sage outside of notebook

2011-09-15 Thread Rajeev Singh
On Thu, Sep 15, 2011 at 12:07 PM, Robert Bradshaw wrote: > On Wed, Sep 14, 2011 at 2:31 AM, Rajeev Singh wrote: >> Hi, >> >> The following examples compiles from the notebook >> >> %cython >> cimport sage.gsl.ode >> import sage.gsl.ode >

Re: [sage-support] loading a series of files inside a loop

2011-09-15 Thread Rajeev Singh
On Thu, Sep 15, 2011 at 6:23 PM, Rajeev Singh wrote: > On Thu, Sep 15, 2011 at 4:56 PM, Andrew Francis wrote: >> Hi all, >> >> I'm new to this group; thanks for having me. >> >> I have generated a large number of text files (several lots of 81 >> fi

Re: [sage-support] loading a series of files inside a loop

2011-09-15 Thread Rajeev Singh
On Thu, Sep 15, 2011 at 4:56 PM, Andrew Francis wrote: > Hi all, > > I'm new to this group; thanks for having me. > > I have generated a large number of text files (several lots of 81 > files) with the intention of reading them back into another sage > program (via the command line).  The text fil

Re: [sage-support] Re: plot3d with adaptive=True fails

2011-09-15 Thread Rajeev Singh
On Thu, Sep 15, 2011 at 7:10 PM, kcrisman wrote: > > > On Sep 15, 9:08 am, Dan Drake wrote: >> This is strange: >> >> x, y =var('x y') >> plot3d(sqrt(x^2+y^2)*sin(1/sqrt(x^2+y^2)), (x,-1/2, 1/2), (y, -1/2, 1/2), >> adaptive=True) >> >> fails with "ValueError: cannot convert float NaN to integer"

Re: [sage-support] gsl in sage outside of notebook

2011-09-17 Thread Rajeev Singh
On Thu, Sep 15, 2011 at 3:24 PM, Rajeev Singh wrote: > On Thu, Sep 15, 2011 at 12:07 PM, Robert Bradshaw > wrote: >> On Wed, Sep 14, 2011 at 2:31 AM, Rajeev Singh wrote: >>> Hi, >>> >>> The following examples compiles from the notebook >>>

Re: [sage-support] How to write Sage code to cython code

2011-09-17 Thread Rajeev Singh
On Sat, Sep 17, 2011 at 5:46 PM, Santanu Sarkar wrote: > Hi all, > > I want to use cython. > > The following code does not work > %cython > cdef P > P = next_prime(ZZ.random_element(2^(100-1),2^100)) > > > -- > To post to this group, send email to sage-support@googlegroups.com > To unsubscribe fro

Re: [sage-support] Re: Evaluating Symbolic Expressions

2011-11-02 Thread Rajeev Singh
On Wed, Nov 2, 2011 at 12:08 PM, Laurent wrote: > In order to anticipate the next question, if you are wotking in a script > instead of > the terminal. > > The code > >        f(x,y)=x*y >        print f(5,4) > > raises > SyntaxError: can't assign to function call > > > The code >        x,y=var('

[sage-support] getting error while compiling sage-4.8 from source

2012-02-01 Thread Rajeev Singh
Hi, I am getting the following error when I try to compile sage-4.8 from source - UNKNOWN COMPILER 'gcc-4.3' for ICC: you must also supply flags! make[3]: *** [atlas_run] Error 1 I am on an amd64 machine running debian. If more details are needed I can attach the log file. Thanks in advance for