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

2012-02-01 Thread Rajeev Singh
dvance for any help. Rajeev -- 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: Evaluating Symbolic Expressions

2011-11-02 Thread Rajeev Singh
was *autogenerated* from the file temp.sage. from sage.all_cmdline import * # import sage library _sage_const_5 = Integer(5); _sage_const_4 = Integer(4) var('x,y') __tmp__=var("x,y"); f = symbolic_expression(x*y).function(x,y) print f(_sage_const_5 ,_sage_const_4 ) I think you can n

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

2011-09-17 Thread Rajeev Singh
= next_prime(ZZ.random_element(2^(100-1),2^100)) print P Rajeev -- 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] 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] 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] loading a series of files inside a loop

2011-09-15 Thread Rajeev Singh
t;> for i in range(10): ... os.system('echo a = %d > %d.sage' %(i,i)) # generating files 0.sage, 1.sage, etc ... >>> for i in range(10): ... load('%d.sage' %i) ... print a This gives the expected output. By the way I don't see your filename changing i

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] 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 >

[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

[sage-support] gsl in sage outside of notebook

2011-09-14 Thread Rajeev Singh
", ["vander.pyx"], include_dirs = ['/home/rajeev/bin/sage/devel/sage-main/sage/gsl/']) setup(ext_modules=[ext], cmdclass = {'build_ext': build_ext}) I get the following error

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

2011-09-07 Thread Rajeev Singh
ates = [0, 5] vthresh = solve([eq1], vnode)[0].rhs() for i in range(2): vcc = out_states[i] print '%4s: %.4f'%(vcc, vthresh.substitute(vcc=vcc).n()) output is - 0: 2.4877 5: 2.5123 I have done very small changes in your code. Hope it helps. Rajeev -- To post to this grou

[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

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

2011-08-13 Thread Rajeev Singh
k call DGESV(n, 1, A, n, pivot, b, n, ok) end ''' fortran(code) Although apart from showing some warning it does generate a .so file. I am using Sage 4.6.2 compiled from source on Debian squeeze. Can someone suggest how to get it working? Rajeev -- To post to this group, send ema

[sage-support] ode_solver in cython

2011-08-10 Thread Rajeev Singh
TypeError: arg is not a Python function If I define func1 outside the cython cell then everything works fine. This is just a toy problem but captures the behavior I encountered. I hope someone can explain. Rajeev -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe

[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] f2py error within sage

2011-07-30 Thread Rajeev Singh
f I use - sage -python a.py and gives an error while compiling. The last lines of error message are - /usr/bin/gfortran -Wall /tmp/tmpBTbBKB/tmp/tmpBTbBKB/src.linux-i686-2.6/PD_evolvemodule.o /tmp/tmpBTbBKB/tmp/tmpBTbBKB/src.linux-i686-2.6/fortranobject.o /tmp/tmpBTbBKB/PD_evolve.o -L/home/rajeev/bin

Re: [sage-support] dirac delta function

2011-07-11 Thread Rajeev Singh
legroups.com > For more options, visit this group at > http://groups.google.com/group/sage-support > URL: http://www.sagemath.org > You can use sympy as - >>> import sympy >>> sympy.integrate(sympy.DiracDelta(x), (x,-1,1)) 1 Rajeev -- To post to this

Re: [sage-support] function of vector variables

2011-07-08 Thread Rajeev Singh
googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-support > URL: http://www.sagemath.org > Hi, sage: var('x1, x2, x3') (x1, x2, x3) sage: x = vector([x1,x2,x3]) sage: f = lambda x: sum([ii*ii for ii in x]) sage: f(x) x1^2 + x2^2 + x

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

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] 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] Re: imposing commutation relation

2011-05-24 Thread Rajeev Singh
+ (1 + y⋅x)⋅y > Actually, it looks like if you are using SymPy 0.6.7, there is a bug that makes this return a wrong result: For people using sympy in sage, this last point seems important. I actually checked and we use SymPy 0.6.4 Rajeev -- To post to this group, send email to sage-suppo

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: using existing functions with vectors / lists / arrays

2011-05-22 Thread Rajeev Singh
= np.vectorize(y) this fails - sage: y(x) --- ValueErrorTraceback (most recent call last) while this works - sage: y_vec(x) array([ 2, 4, 9, 16]) hope it helps. Rajeev -- To po

[sage-support] imposing commutation relation

2011-05-22 Thread Rajeev
job done. Thanks in advance. Regards, Rajeev -- 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

[sage-support] regarding arrayobject.h

2010-08-09 Thread Rajeev
Hi, I was trying to work out the first example given in http://wiki.cython.org/WrappingNumpy in sage notebook, but got an error saying arrayobject.h not found. How do I get this example working? Best wishes, Rajeev -- To post to this group, send email to sage-support@googlegroups.com To

[sage-support] Re: sage much slower than ipython

2010-08-05 Thread Rajeev
> > Can you try doing > > sage: preparser(False) > sage: preparser(False) sage: from layered_ising_mc import layered_ising_mc sage: a = layered_ising_mc(n=16, J_p=20, h=19.94, beta=0.5) sage: a.set_initial_condition() sage: time data = a.monte_carlo(1000); a.check_consistency() CPU times: user 40.5

[sage-support] sage much slower than ipython

2010-08-05 Thread Rajeev
) sage: a.set_initial_condition() sage: time data = a.monte_carlo(1000); a.check_consistency() CPU times: user 191.94 s, sys: 0.11 s, total: 192.04 s Wall time: 194.03 s I was surprised that the difference is a factor of 10. I hope I am not comparing apples to oranges. Best wishes, Rajeev -- To post

[sage-support] error using scipy sparse matrix

2010-06-22 Thread Rajeev
Hi, I think following is a bug - sage: from scipy import sparse sage: a = sparse.lil_matrix((10,10)) sage: a[1,2] = 1 --- ValueErrorTraceback (most recent call last) /home/rajeev/programs

[sage-support] unable to run spyx file

2010-06-07 Thread Rajeev
Hi, I was trying to run a spyx file but got the following error 11:25:23 $ sage prime_pattern1.spyx < input Traceback (most recent call last): File "/home/rajeev/bin/sage/local/bin/sage-sagex", line 5, in from sage.misc.interpreter import load_sagex ImportError: canno

Re: [sage-support] interact question

2010-05-18 Thread Rajeev Singh
html('There is no solution to $$%s x=%s$$'%(latex(A), latex(v))) Rajeev On Tue, May 18, 2010 at 1:50 PM, ma...@mendelu.cz wrote: > Dear support, this code is from interact help: > > sage: @interact > ... def _(A=matrix(QQ,3,3,range(9)), v=matrix(QQ,3,1,range(3))): >

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,

[sage-support] problem with multi line program statement in notebook

2010-05-14 Thread Rajeev
^ SyntaxError: invalid syntax I am using version 4.4.1. I couldn't find a discussion about it recently. Is someone else also getting the same error? Best wishes, Rajeev -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to s

[sage-support] Re: strange behavior on assigning string with single quotes

2010-05-12 Thread Rajeev
Let me also add that there is no problem if the dropdown menu at the top is set at sage (the default option). On May 12, 4:31 pm, Rajeev wrote: > Hi, > > I am finding a very strange behavior in notebook. Evaluating > > a = 'hello' > > gives > > Traceb

[sage-support] strange behavior on assigning string with single quotes

2010-05-12 Thread Rajeev
u0027\u0027\u0027, \u0027/home/rajeev/sage_notebook/ sage_notebook.sagenb/home/admin/32/cells/25\u0027) File "", line 1 print _support_.syseval(python, ur'''a = 'hello'''', '/home/rajeev/ sage_notebook/sage_notebook.sagenb/home/admin/32/cell

[sage-support] Re: some basics of weave

2010-05-12 Thread Rajeev
Hi, > In sage notebook, start the cell with %python in the very first line. %python doesn't help, getting the same error. > suggest you to look into cython because that's the "weave" we use I am trying to understand the scope of variables while using weave :) Thanks anyway. As I said earlier -

[sage-support] some basics of weave

2010-05-11 Thread Rajeev
an this code in sage notebook, I got the following error Traceback (most recent call last):print a, b File "/home/rajeev/bin/sage-4.2/local/lib/python2.6/site-packages/ scipy/weave/inline_tools.py", line 321, in inline results = attempt_function_call(code,local_dict,global_dict

[sage-support] Re: weighted graph plotting

2010-04-27 Thread Rajeev
Thanks Jason, But the color assigned is random. I wonder if it is possible to assign it systematically (like image in matplotlib) and possibly with a colorbar. Rajeev On Apr 27, 7:28 pm, Jason Grout wrote: > On 04/27/2010 07:32 AM, Rajeev wrote: > > > Hi, > > > I want to

[sage-support] weighted graph plotting

2010-04-27 Thread Rajeev
Hi, I want to plot weighted graphs such that the link-width or color may have the information of relative weights. Please point the relevant document page. I couldn't find one. Best wishes, Rajeev -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from

[sage-support] Re: ndsolve??

2010-03-27 Thread Rajeev
will help. Best wishes, Rajeev On Mar 26, 11:06 am, dabu wrote: > Hi, > Many thanks. I will try to have a look. > best, > Pallab > On Mar 25, 1:05 pm, Jason Grout wrote: > > > On 03/25/2010 10:25 AM, dabu wrote: > > > > Hi, > > > > I am new

[sage-support] Re: monte carlo integration

2010-02-05 Thread Rajeev
Hi, There is a cython script for the example given in the gsl document. The file is examples/gsl/examples/monte.pyx in the sage package. Looking at this example is quite instructive. Rajeev -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group

[sage-support] Re: monte carlo integration

2010-02-03 Thread Rajeev
Hi, SAGE wraps GSL which has monte carlo integration routines. You may look at the source file gsl_monte.pxi and the gsl document at - http://www.gnu.org/software/gsl/manual/html_node/Monte-Carlo-Integration.html Rajeev On Feb 3, 7:23 pm, ggrafendorfer wrote: > Hi all, > > does any

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

2009-06-21 Thread Rajeev Singh
k using a sparse matrix would be a better thing to do in such situations? Rajeev --~--~-~--~~~---~--~~ 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 m

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

2009-05-26 Thread Rajeev Singh
there in first place! Thanks again, Rajeev --~--~-~--~~~---~--~~ 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

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

2009-05-26 Thread Rajeev Singh
/sage -- | Sage Version 3.4.1, Release Date: 2009-04-21 | | Type notebook() for the GUI, and license() for information.| -- /home/rajeev/sage/