Re: [sage-support] Same Matrix Construction gives two different results

2015-11-09 Thread P Purkayastha
Hi Dima!

  Yes, we clearly overlooked that bug because we also tested on Sage
itself, and never from just python. An easy fix to this would be the
following in my opinion, so that everything gets coerced to Sage
integers, irrespective of the input:

Q = Integer(q)
kraw = jth_term = (Q-1)**l * binomial(n, l) # And replace all q with
Q. everywhere else

Regards,
  basu.


On Mon, Nov 9, 2015 at 6:56 PM, Dima Pasechnik  wrote:
>
>
> On Monday, 9 November 2015 07:19:45 UTC, Nils Bruin wrote:
>>
>> On Sunday, November 8, 2015 at 11:13:24 PM UTC-8, Nils Bruin wrote:
>>>
>>>
>>> That's a bug, and one that should be pretty straightforward to solve.
>>
>> Indeed, it's exceedingly silly. In Krawtchouk we execute:
>>
>> jth_term *= -q*(l-j+1)*(i-j+1)/((q-1)*j*(n-j+1))
>>
>> If we'de doing that division with Sage Integer then we'll be getting
>> rational numbers. With python int this amounts to "//", so will likely give
>> other answers.
>
>
> I wrote that code a while ago, as an internal function, and the reviewer (hi
> Basu!) insisted that I made it public. But me and he missed the argument
> checking
>
> Dima
>
>>
>>
>> Workaround: make sure you input Sage Integers (i.e., if you absolutely
>> have to use a ".py" file, write Integer(1) instead of 1.
>>
>> Fix:
>> -for j in range(1,l+1):
>> +for j in srange(1,l+1):
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: How to turn off colored prompt?

2015-02-06 Thread P Purkayastha
The colors are controlled by ipython. You can run the following to create a 
default profile and get the path to the configuration file

~» sage -ipython profile create default

Inside the file there is a color configuration. See this website for the 
three settings that they have:
http://ipython.org/ipython-doc/rel-0.10.2/html/config/initial_config.html#color


On Friday, February 6, 2015 at 2:45:26 AM UTC+8, doug5y wrote:

 Hello,

 Im running sage 6.4.1 and notcie that the sage prompt is set to dark 
 blue. I'd like it to be that same as the other text in my terminal window.

 How could I do that?

 TIA,
 Doug N


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Displaying plots in inline mode for IPython notebook

2014-10-09 Thread P Purkayastha
You can use os.system:

import os
os.system(convert. )
 On Oct 10, 2014 12:54 PM, sato...@gmail.com wrote:

 Hi,
 I have an idea using ImageMagic.

 In terminal:
 $ convert -resize x350 file.png file2.png

 In notebook:
 from IPython.display import display, Image
 display(Image('/path/to/directory/file2.png'))

 Would you please show me  how to do convert -resize x350 file.png
 file2.png in notebook ?

 I usually input the following.
 $ sage -ipython notebook
 from sage.all import *
 ...

 Thanks,
 Y. Sato

 2014年9月29日月曜日 11時47分19秒 UTC+9 sat...@gmail.com:

 Hi,

 I made an example.

 from IPython.display import display, Image
 x = var('x')
 plot(sin(x), 0, 2*pi, figsize= 4).save('/path/to/directory/file.png')
 display(Image('/path/to/directory/file.png'))

 Thanks.
  y. Sato
 On Sunday, September 28, 2014 11:57:52 AM UTC+9, P Purkayastha wrote:

 You can use the figsize keyword to resize your image. See this:
 http://www.sagemath.org/doc/reference/plotting/sage/plot/
 graphics.html#sage.plot.graphics.Graphics.show

 More examples can be found in the plot() documentation:
 http://www.sagemath.org/doc/reference/plotting/sage/plot/
 plot.html#sage.plot.plot.plot

 On Friday, September 26, 2014 11:04:45 AM UTC+8, sat...@gmail.com wrote:

 Hello,

 Would you teach me how to change image size ?

 Thanks!



 Yoshihiro Sato

 On Thursday, June 6, 2013 4:18:54 PM UTC+9, Jose Guzman wrote:

 This was a very good idea!

 Now I generate the plots as you mentioned:

 The trick was to use IPython.display to take the png files. Like this:


 x = var('x')
 plot(sin(x), 0, 2*pi).save('/path/to/directory/file.png')
 from IPython.display import display, Image
 display(Image('/path/to/directory/file.png'))

 On Sunday, June 2, 2013 11:34:06 AM UTC+2, P Purkayastha wrote:

 In Sage the plots appear inline, but the plots are saved as files
 in a directory structure within the working worksheet directory. From my
 reading here:
 http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html#the-
 notebook-format
 it appears that the ipython notebook saves everything inside a single
 json file, which is probably also how one gets everything inline. I am
 just thinking out loud; not sure if this is exactly how it works - but it
 does look like it is not compatible with how the Sage plots work.

 There are two possible solutions:
 1. Find out how matplotlib plots are handled. They must be saved in
 some directory as png files before they are displayed in the ipython
 notebook. If you can find that directory, then give that path along with 
 a
 file name to the Sage's plot command, like this:

 plot(x).save('/path/to/directory/file.png')


 2. Use Sage to plot, but at the last step, take the matplotlib Figure
 object out of sage. Then use some direct matplotlib calls to show this
 figure (I don't know exactly what they should be), like this:

 p = plot(x) + plot(x^2) + list_plot(range(5))
 pm = p.matplotlib(pass other options as you see fit) # This is a
 matplotlib Figure object
 from matplotlib import pyplot as plt
 # Some matplotlib commands which can incorporate this Figure object
 into the plt object
 plt.show()


 On Friday, May 31, 2013 9:41:34 PM UTC+8, Jose Guzman wrote:

 Hi everyboydy!


 Is there any way to display Sage plots in inline mode? I've tried
 sage
 ipython notebook -pylab=inline but It did not work.


 Declaring %pylab inline does not help, for example:

   from sage.all import*
   t = var('t')
   plot(sin(t), 0, 2*pi)

 n _plot_args(self, tup, kwargs)
  290 tup = tup[:-1]
  291 elif len(tup) == 3:
 -- 292 raise ValueError('third arg must be a format
 string')
  293 else:
  294 linestyle, marker, color = None, None, None

 ValueError: third arg must be a format string

 Thanks!

 Jose

 --
 Jose Guzman
 http://www.ist.ac.at/~jguzman/

  --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/9pUhO8wO4nE/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Processors Info for benchmarks on Sagenb: platform.processor()

2014-10-07 Thread P Purkayastha
That command works here. Did you forget to import platform first?

sage: import platform
sage: platform.processor()
'Intel(R) Core(TM) i7-3537U CPU @ 2.00GHz'



On Tuesday, October 7, 2014 1:04:58 PM UTC+8, rach reb wrote:

 Dear all,

 I am trying to get information related to the processors used during some 
 experiments I did using Sagenb's worksheet.  I need these kind of 
 information to present my benchmarks.
 I tried   platform.processor() but it did not work.
 Could you please let me know how I could get those information.
 Thanks.
 Rach.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Displaying plots in inline mode for IPython notebook

2014-09-27 Thread P Purkayastha
You can use the figsize keyword to resize your image. See this:
http://www.sagemath.org/doc/reference/plotting/sage/plot/graphics.html#sage.plot.graphics.Graphics.show

More examples can be found in the plot() documentation:
http://www.sagemath.org/doc/reference/plotting/sage/plot/plot.html#sage.plot.plot.plot

On Friday, September 26, 2014 11:04:45 AM UTC+8, sat...@gmail.com wrote:

 Hello,

 Would you teach me how to change image size ?

 Thanks!

 Yoshihiro Sato

 On Thursday, June 6, 2013 4:18:54 PM UTC+9, Jose Guzman wrote:

 This was a very good idea!

 Now I generate the plots as you mentioned:

 The trick was to use IPython.display to take the png files. Like this:


 x = var('x')
 plot(sin(x), 0, 2*pi).save('/path/to/directory/file.png')
 from IPython.display import display, Image
 display(Image('/path/to/directory/file.png'))

 On Sunday, June 2, 2013 11:34:06 AM UTC+2, P Purkayastha wrote:

 In Sage the plots appear inline, but the plots are saved as files in a 
 directory structure within the working worksheet directory. From my reading 
 here:

 http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html#the-notebook-format
 it appears that the ipython notebook saves everything inside a single 
 json file, which is probably also how one gets everything inline. I am 
 just thinking out loud; not sure if this is exactly how it works - but it 
 does look like it is not compatible with how the Sage plots work.

 There are two possible solutions:
 1. Find out how matplotlib plots are handled. They must be saved in some 
 directory as png files before they are displayed in the ipython notebook. 
 If you can find that directory, then give that path along with a file name 
 to the Sage's plot command, like this:

 plot(x).save('/path/to/directory/file.png')


 2. Use Sage to plot, but at the last step, take the matplotlib Figure 
 object out of sage. Then use some direct matplotlib calls to show this 
 figure (I don't know exactly what they should be), like this:

 p = plot(x) + plot(x^2) + list_plot(range(5))
 pm = p.matplotlib(pass other options as you see fit) # This is a 
 matplotlib Figure object
 from matplotlib import pyplot as plt
 # Some matplotlib commands which can incorporate this Figure object into 
 the plt object
 plt.show()


 On Friday, May 31, 2013 9:41:34 PM UTC+8, Jose Guzman wrote:

 Hi everyboydy! 


 Is there any way to display Sage plots in inline mode? I've tried sage 
 ipython notebook -pylab=inline but It did not work. 


 Declaring %pylab inline does not help, for example: 

   from sage.all import* 
   t = var('t') 
   plot(sin(t), 0, 2*pi) 

 n _plot_args(self, tup, kwargs) 
  290 tup = tup[:-1] 
  291 elif len(tup) == 3: 
 -- 292 raise ValueError('third arg must be a format 
 string') 
  293 else: 
  294 linestyle, marker, color = None, None, None 

 ValueError: third arg must be a format string 

 Thanks! 

 Jose 

 -- 
 Jose Guzman 
 http://www.ist.ac.at/~jguzman/ 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Weird! OverflowError: cannot convert float infinity to integer

2014-09-19 Thread P Purkayastha
It is not F[0] it is F(0). :-) The example cited is definitely a bug, 
perhaps from sage. Note the following:

sage: M = matrix(F, [[1],[0]]) 
 
sage: type(M)
type 'sage.matrix.matrix_mod2e_dense.Matrix_mod2e_dense'
sage: M
repr(sage.matrix.matrix_mod2e_dense.Matrix_mod2e_dense at 0x7fbcf6f65e20) 
failed: OverflowError: cannot convert float infinity to integer

So, sage doesn't even realize that the underlying library m4rie(?) crashed. 
For larger powers, sage uses some other library (what?). Maybe we should 
switch to that from 2^16 onwards


sage: F = GF(2**17, 'a')
sage: M = matrix(F, [[1],[0]])
sage: type(M)
type 'sage.matrix.matrix_generic_dense.Matrix_generic_dense'



On Saturday, September 20, 2014 3:07:27 AM UTC+8, vdelecroix wrote:

 There is definitely something wrong, but what would you expect from the 
 command 

 sage: F[0] 

 Vincent 

 2014-09-19 6:25 UTC+02:00, Michiel Kosters kos...@gmail.com javascript:: 

  I have a similar bug with the following code: 
  
  n=16 
  F.a=GF(2^n) 
  print Matrix([a]), F(0) 
  print Matrix([F(0)]) 
  
  The last print statement gives an error OverflowError: cannot convert 
 float 
  
  infinity to integer 
  For other n, the code does not give an error. 
  
  Yours, 
  Michiel 
  
  
  
  On Tuesday, July 8, 2014 10:21:06 PM UTC+8, David Hoo wrote: 
  
  I happened to meet a overflow error, I install sage 6.2 both on a 
 64-bit 
  macbook running MacOS 10.9 and 32-bit Dell Desktop running Ubuntu 
 12.04. 
  
  The error message goes like this: 
  
  OverflowError Traceback (most recent call 
  last) 
  
  ipython-input-7-8d411648858e in module() 
  
   1 get_ipython().magic(u'runfile DataCollecctionScript.py') 
  
  
  
  
  
 /Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
  

  
  in magic(self, arg_s) 
  
  *   2163* magic_name, _, magic_arg_s = arg_s.partition(' ') 
  
  *   2164* magic_name = magic_name.lstrip(prefilter.ESC_MAGIC) 
  
  - 2165 return self.run_line_magic(magic_name, magic_arg_s) 
  
  *   2166* 
  
  *   2167* 
  
 #- 
  
  
  
  
  
 /Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
  

  
  in run_line_magic(self, magic_name, line) 
  
  *   2084* kwargs['local_ns'] = 
  sys._getframe(stack_depth). 
  f_locals 
  
  *   2085* with self.builtin_trap: 
  
  - 2086 result = fn(*args,**kwargs) 
  
  *   2087* return result 
  
  *   2088* 
  
  
  
  
  
 /Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc
  

  
  in runfile(self, s) 
  
  
  
  
  
 /Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/magic.pyc
  

  
  in lambda(f, *a, **k) 
  
  *189* # but it's overkill for just that one bit of state. 
  
  *190* def magic_deco(arg): 
  
  -- 191 call = lambda f, *a, **k: f(*a, **k) 
  
  *span style=font-size:14.0pt; font-family:quot* 
  ... 
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  sage-support group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to sage-support...@googlegroups.com javascript:. 
  To post to this group, send email to sage-s...@googlegroups.com 
 javascript:. 
  Visit this group at http://groups.google.com/group/sage-support. 
  For more options, visit https://groups.google.com/d/optout. 
  


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Is Sage help system available in sage-cell?

2014-07-23 Thread P Purkayastha
The link is not a formatted html link. It's just a code dump more or less.

On Thursday, July 24, 2014 12:43:33 PM UTC+8, Ivan Andrus wrote:

 On Jul 23, 2014, at 2:03 PM, Kwankyu ekwa...@gmail.com javascript: 
 wrote:

 Hi,

 It seems that no sage help is available in sage-cell. For example

 ?floor
  
 does not work. Is this intended or a missing feature?


 I think it used to work, but perhaps not.  What does work (sort of) is

 help(plot)

 which gives a link to the documentation.

 -Ivan



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Typo in Documentation of Eigenmatrix

2014-07-19 Thread P Purkayastha
Is putting patches on github a new experimental unsupported development 
feature?

On Friday, July 18, 2014 1:42:56 PM UTC+8, Robert Bradshaw wrote:

 https://github.com/sagemath/sage/pull/21 aka 
 http://trac.sagemath.org/ticket/16672 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Simplifying combinations of atomic inequalities

2014-07-17 Thread P Purkayastha
http://trac.sagemath.org/ticket/14229

On Friday, July 18, 2014 12:28:18 AM UTC+8, Robert Pollak wrote:


 Also, why do I need two steps here?:

 sage: solve([x==0, x!=1], x)
 [[x == 0, -1 != 0]]
 solve([x == 0, -1 != 0], x)
 [x == 0]



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Got sagenb running, need help

2014-07-14 Thread P Purkayastha
You should look at sagecell instead for this kind of thing:

https://sagecell.sagemath.org/
https://github.com/sagemath/sagecell

On Tuesday, July 15, 2014 4:12:14 AM UTC+8, Jole Bradbury wrote:

 I take it this is impossible?

 On Saturday, July 12, 2014 5:10:09 PM UTC-4, Jole Bradbury wrote:

 Ran 

 sage: import sagenb.notebook.notebook_object as nb

 sage: nb.notebook(directory=mynotebook)

 And got the server running, I can log in on localhost.



 My problem is that for the past few weeks all I've been trying to do is 
 set up a server *where data can be sent and evaluated and sent back,* my 
 users will be sending requests from a separate site. I have been trying curl 
 --data x http://localhost:8080/home/admin/0/


 But keep getting !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN

 title405 Method Not Allowed/title

 h1Method Not Allowed/h1

 pThe method is not allowed for the requested URL./p




 I really need to just send an http request and get it evaluated and get 
 an httpresponse. Can someone please help with that?



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Having Trouble Plotting My Superposition State

2014-06-24 Thread P Purkayastha
On Tuesday, June 24, 2014 8:51:18 PM UTC+8, kcrisman wrote:



 You, saw a plot?  I didn't see a plot. 



 Hmm.  Can you say more about *exactly* what version of Sage, setup, and so 
 forth you are using?The plot appears for me with Sage 5.12 but not in 
 Sage 6.3.beta3 (though that one may have had #13246 applied).  ppurka, do 
 you have a sense as to whether the stuff at #13246 would be responsible for 
 this?

 Thanks for reporting this - we'll have to track it down a bit more.


It works with 6.3.beta4. And it fails with #13246 applied to 6.3.beta4.

But there is a reason why it fails with #13246 applied and works without 
it. The plot has only three data points. So, #13246 is doing its job just 
as it was intended to I suppose :-)

sage: var('n,a')
sage: hbar, m = 1,1
sage: psi(x,t,n)=sqrt(2/a)*sin(n*pi*x/a)*e^(-i*n^2*pi^2*hbar*t/(2*m*a^2)); 
sage: print psi
sage: Psi(x,t)=1/sqrt(2)*psi(x,t,1)+1/sqrt(2)*psi(x,t,2); 
sage: print Psi
sage: P(x,t,a) = Psi.conjugate()*Psi
sage: print P.expand()
sage: p = plot(P(x,1,1),x,0,1)
sage: po = p._objects[0]; po.xdata
[0.0,0.5,1.0]

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Having Trouble Plotting My Superposition State

2014-06-24 Thread P Purkayastha


On Wednesday, June 25, 2014 12:39:30 PM UTC+8, P Purkayastha wrote:

 On Tuesday, June 24, 2014 8:51:18 PM UTC+8, kcrisman wrote:



 You, saw a plot?  I didn't see a plot. 



 Hmm.  Can you say more about *exactly* what version of Sage, setup, and 
 so forth you are using?The plot appears for me with Sage 5.12 but not 
 in Sage 6.3.beta3 (though that one may have had #13246 applied).  ppurka, 
 do you have a sense as to whether the stuff at #13246 would be responsible 
 for this?

 Thanks for reporting this - we'll have to track it down a bit more.


 It works with 6.3.beta4. And it fails with #13246 applied to 6.3.beta4.

 But there is a reason why it fails with #13246 applied and works without 
 it. The plot has only three data points. So, #13246 is doing its job just 
 as it was intended to I suppose :-)

 sage: var('n,a')
 sage: hbar, m = 1,1
 sage: psi(x,t,n)=sqrt(2/a)*sin(n*pi*x/a)*e^(-i*n^2*pi^2*hbar*t/(2*m*a^2)); 
 sage: print psi
 sage: Psi(x,t)=1/sqrt(2)*psi(x,t,1)+1/sqrt(2)*psi(x,t,2); 
 sage: print Psi
 sage: P(x,t,a) = Psi.conjugate()*Psi
 sage: print P.expand()
 sage: p = plot(P(x,1,1),x,0,1)
 sage: po = p._objects[0]; po.xdata
 [0.0,0.5,1.0]


Here is a way to fix this problem. Since you know that the output of P() is 
always real, simply use the following:

plot(P(x,1,1).real(), x, 0, 1)

And you will get a plot like the one attached.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: problem with connecting in sage

2014-06-22 Thread P Purkayastha
1. If you are getting that login page, then there is probably a background 
sage notebook process still running. Quit that process and you will be 
fine. Alternatively, paste the output of the command notebook() here, so we 
know what is going on.

2. If no background sage process is running then you can reset the password 
using
notebook(reset=True)

On Saturday, June 21, 2014 9:53:26 PM UTC+8, William wrote:

 -- Forwarded message --
 From: Smail Addoune add...@gmail.com javascript:
 Date: Jun 21, 2014 2:05 AM
 Subject: problem with connecting in sage
 To: wst...@uw.edu javascript:
 Cc: 

 Hi

 I've installed sage on my computer months ago.

 I use the notebook normally (offline), but now when i run the notebook() 
 command, i get a page (localhost:8080/login) where
 i must use my id and a password, but i forget my password. Can you help 
 me. I'm very thankfull.


  

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: tutoriatutorial() tries to start wine under gnome-3.12

2014-06-21 Thread P Purkayastha
As Francois said, I think it might really be a sage-on-gentoo issue. I 
build and run sage from git, on gentoo linux (on two separate 
installations), and have not come across this issue. I do have the BROWSER 
variable set to my own (non-standard) script. And that is used by sage.

~» echo $BROWSER
/usr/local/bin/firox


On Friday, June 20, 2014 3:25:12 PM UTC+8, jue...@gmail.com wrote:

 I can't open notebook either in a gnome-session, it fails with Could not 
 find the Mozilla runtime.
 Setting SAGE_BROWSER=firefox does not change anything. Under xfce I can 
 open the notebook  without problems.
 Because my sage is a sage-on-gentoo install, I will report the details on 
 https://github.com/cschwan/sage-on-gentoo/issues 
 https://github.com/cschwan/sage-on-gentoo/issues  .

 On Thursday, June 19, 2014 11:13:00 AM UTC+2, Dima Pasechnik wrote:

 On 2014-06-19, jue...@gmail.com jue...@gmail.com wrote: 
  
  
  On Wednesday, June 18, 2014 5:51:02 PM UTC+2, jue...@gmail.com wrote: 
  
  Hi, 
  
  if I enter tutorial() at the sage prompt a short time a wine window is 
  opened and only warnings or errors are shown in the terminal window: 
  
  sage: help() 
  Welcome to Sage 6.2! 
  
  To view the Sagsage: help() 
  Welcome to Sage 6.2! 
  
  To view the Sage tutorial in your web browser, type tutorial(), and 
  ... 
  
  sage: tutorial() 
  sage: fixme:iphlpapi:NotifyAddrChange (Handle 0xd9e2c8, overlapped 
  0xd9e2e0): stub 
  fixme:iphlpapi:NotifyAddrChange (Handle 0xdbe880, overlapped 
 0xdbe88c): 
  stub 
  wine: configuration in '/home/rose/.wine' has been updated. 
  fixme:exec:SHELL_execute flags ignored: 0x0100 
  fixme:exec:SHELL_execute flags ignored: 0x0100 
  
  
  
  After removing /home/rose/.sage the start of wine disappeard. But I 
 still 
  get endless: 
  
  fixme:exec:SHELL_execute flags ignored: 0x0100 
  
  
  Even if I kill sage, the terminal continues to show this message. 
  I get it under xfce4-4.11.0 and gnome-3.12.  Under gnome this issue 
 seems 
  to lock after some time the whole desktop. Several existing terminal 
  windows 
  do no more respond and it is impossible to start new application with 
 the 
  application menu. 

 tutorial() merely opens up the default browser, and a local copy of 
 the tutorial HTML docs in it. 

 By the way, what is your default browser? 

 I never saw this reported as causing problems. 

 Could you try doing notebook() rather than tutorial() ? 
 (notebook() will also pop up your default browser, and then open Sage 
 notebooks in it). 
  



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: LaTeX rendering problem in a local installation of the sage notebook server

2014-06-14 Thread P Purkayastha
Latex in the notebook shouldn't be broken. It was completely broken for 6.1 
but was fixed in 6.1.1. There has been no (released) upgrades of the 
notebook since then. I just checked and inline equations work fine here in 
6.1.1 and 6.3.beta3. Sorry, I don't have 6.2 to test.


On Saturday, June 14, 2014 6:29:59 AM UTC+8, Keir Lockridge wrote:

 Hi,

 I have Sage v6.2 installed 'in the cloud' (Amazon). The OS is RHEL. I have 
 used Sage for a couple of years without incident, but I am suddenly having 
 a problem with LaTeX rendering in the notebook. When I enclose a formula in 
 double dollar signs, it renders just fine as a centered equation. When I 
 enclose a formula in single dollar signs, it does nothing (it just appears 
 as plain text; see attached screenshot). I didn't have this problem with 
 v6.0, but I am sorry to say I can't swear that's the only change that I've 
 made to the server.

 The server has a working local installation of MathJax. LaTeX 
 functionality in the locally installed wikis works fine.

 Anyone have advice for diagnosing the problem?

 Thanks in advance --

 Keir


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Defining a Variable so that its Conjugate always Equals Itself

2014-06-14 Thread P Purkayastha
sage: bool(x.conjugate() == x)
False
sage: assume(x, 'real')
sage: bool(x.conjugate() == x)
True




On Saturday, June 14, 2014 6:12:06 AM UTC+8, Chris Maness wrote:

 Is there a way that I can define my variables to be real, so that when I 
 take square the modulus, I don't get variables with bars over them when 
 they are assumed real.

 Thanks,
 Chris 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: LaTeX rendering problem in a local installation of the sage notebook server

2014-06-14 Thread P Purkayastha
Is your sagenb installation complete? This file is present and
distributed with the notebook:
https://github.com/sagemath/sagenb/blob/master/sagenb/data/sage/js/mathjax_sage.js

On Sat, Jun 14, 2014 at 10:14 PM, Keir Lockridge keirhar...@gmail.com wrote:
 I was finally quick enough to highlight and copy the MathJax error:

 File failed to load:
 https://sage.x.org/javascript/mathjax/config/../../dynamic/mathjax_sage.js


 But, I am having trouble actually finding this file.  When I load the URL in
 my browser, I get a blank page ('view source' leads to an empty document)
 and not an error.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: How to plot output of solve()?

2014-06-10 Thread P Purkayastha
I suppose you want to plot the complex numbers that are the roots. You can 
do the following:

list_plot([CDF(s.rhs()) for s in solve([mu^6==1],mu)])

Once #16378 ( http://trac.sagemath.org/ticket/16378 ) is fixed, you will 
not need to coerce to CDF, and so the following will also work (as long as 
there is at least one complex number in the list of solutions):

list_plot([s.rhs() for s in solve([mu^6==1],mu)])



On Tuesday, June 10, 2014 2:48:08 PM UTC+8, David Ingerman wrote:

  
  How to plot output of solve() on coordinate plane?
 For example: show((solve([mu^6==1],mu))) gives symbolic LaTex output

  Thank you...


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Cannot load .sws file into Sage; using windows and Oracle VirtualBox

2014-06-03 Thread P Purkayastha
sws file should be uploaded to the sage notebook. There is an Upload 
link towards the top of the notebook, when you open the notebook for the 
first time. It can not be opened from the command line (or maybe it can be, 
but you will need to write some extra python commands/script).

Can you check if Right-Ctrl + F1, or Right-Ctrl + Alt + F1 works, or if 
Right-Ctrl + Alt + F7 works to return you to the graphical sage window? In 
fact, you can try all the combinations F1 to F7!

On Tuesday, June 3, 2014 4:08:08 PM UTC+8, Dennis Eichhorn wrote:

 Running Windows 7, with Oracle VirtualBox as suggested.  I am trying to 
 take my notebook (worksheet?) from another computer and open it in Sage.  I 
 managed to get the file from the original computer using publish.  I put 
 the file onto my new computer, in a shared a folder I created following the 
 online instructions (http://wiki.sagemath.org/SageAppliance), and am at 
 the sage command line, in the directory of my shared folder 
 (/media/sf_blah), looking at the file that I think is a copy of my 
 notebook.  Now what?  load and attach both give error messages.  My 
 notebook is X.sws   .  When I try to load it, it seems to add a file 
 extension; I get  [Errno 2] No such file or directory: 'X.sws.sobj' . 
 When I try to attach, I get  ValueError: argument (='X.sws') to load or 
 attach must have extension py, pyx, sage, spyx, or m .

 Better would be, is there a way to load the .sws from the usual graphical 
 interface?

 Also, the instructions say that pressing *Right-Ctrl* and *F2* return me 
 to the graphical Sage window, but it doesn't.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] In Sage Notebook how to run a process in the background

2014-06-02 Thread P Purkayastha


On Monday, June 2, 2014 8:39:32 AM UTC+8, William wrote:

 On Sun, Jun 1, 2014 at 5:26 PM, Fred Gruber fgr...@gmail.com 
 javascript: wrote: 
  Hello 
  Is it possible to run a process in the background in a sage notebook? 
  
  I would like to run a process that takes a long time in the background 
 and 
  just print the status in a log file. This way I could continue working 
 on 
  the notebook  on other stuff and check the log file once in a while. 
  
  How to do this? 

 In SageMathCloud (https://cloud.sagemath.com) I figured out how to do 
 this (due to somebody else's request) and implemented it. You put 
 %fork at the top of a cell, and it will start running as a separate 
 forked off process in the background: 

 %fork 
 sleep(5) 
 a = 10 

 When that cell terminates, any global variables it set will get set in 
 your worksheet, as long as they are pickle-able.  In particular, the 
 above will set a to 10, after 5 seconds. 

 This functionality is not available in sagenb.org or the notebook that 
 comes with Sage, and very likely not with ipython.  It required some 
 nontrivial special UI support, so wouldn't be trivial to port. 



Why not? If I understand correctly, the OP wants to run a computation 
without having to keep the browser open (or wants to navigate away to a 
different worksheet).

 If you run the sagenb notebook as a server, then it will continue running 
until one explicitly quits the worksheet or server. Each worksheet has its 
own sage process. So, it is entirely possible to let a worksheet continue 
running (and computing something), while we close the browser or navigate 
away to a different worksheet.

For example, we can start the notebook in a screen session like this:
sage -n interface='' automatic_login=False

and then connect to localhost from the browser, start a worksheet and a 
computation in the worksheet. Then we can simply close the tab containing 
the worksheet. Later we can reconnect to the local server and access the 
worksheet again.

 

  
  thanks 
  Fred 
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  sage-support group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to sage-support...@googlegroups.com javascript:. 
  To post to this group, send email to sage-s...@googlegroups.com 
 javascript:. 
  Visit this group at http://groups.google.com/group/sage-support. 
  For more options, visit https://groups.google.com/d/optout. 



 -- 
 William Stein 
 Professor of Mathematics 
 University of Washington 
 http://wstein.org 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] In Sage Notebook how to run a process in the background

2014-06-02 Thread P Purkayastha
Oh Ok. Then William is right. It is not possible to do this in the sagenb 
notebook.

On Monday, June 2, 2014 7:38:10 PM UTC+8, Fred Gruber wrote:

 I actually would like to continue working in the same worksheet  while the 
 computation happens in the background. I remember trying somethign similar 
 in Ipython where I could use certain parallel libraries to do exactly that. 
 Every once in a while I could check the status of the run.

 On Monday, June 2, 2014 7:31:48 AM UTC-4, P Purkayastha wrote:



 On Monday, June 2, 2014 8:39:32 AM UTC+8, William wrote:

 On Sun, Jun 1, 2014 at 5:26 PM, Fred Gruber fgr...@gmail.com wrote: 
  Hello 
  Is it possible to run a process in the background in a sage notebook? 
  
  I would like to run a process that takes a long time in the background 
 and 
  just print the status in a log file. This way I could continue working 
 on 
  the notebook  on other stuff and check the log file once in a while. 
  
  How to do this? 

 In SageMathCloud (https://cloud.sagemath.com) I figured out how to do 
 this (due to somebody else's request) and implemented it. You put 
 %fork at the top of a cell, and it will start running as a separate 
 forked off process in the background: 

 %fork 
 sleep(5) 
 a = 10 

 When that cell terminates, any global variables it set will get set in 
 your worksheet, as long as they are pickle-able.  In particular, the 
 above will set a to 10, after 5 seconds. 

 This functionality is not available in sagenb.org or the notebook that 
 comes with Sage, and very likely not with ipython.  It required some 
 nontrivial special UI support, so wouldn't be trivial to port. 



 Why not? If I understand correctly, the OP wants to run a computation 
 without having to keep the browser open (or wants to navigate away to a 
 different worksheet).

  If you run the sagenb notebook as a server, then it will continue 
 running until one explicitly quits the worksheet or server. Each worksheet 
 has its own sage process. So, it is entirely possible to let a worksheet 
 continue running (and computing something), while we close the browser or 
 navigate away to a different worksheet.

 For example, we can start the notebook in a screen session like this:
 sage -n interface='' automatic_login=False

 and then connect to localhost from the browser, start a worksheet and a 
 computation in the worksheet. Then we can simply close the tab containing 
 the worksheet. Later we can reconnect to the local server and access the 
 worksheet again.

  

  
  thanks 
  Fred 
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  sage-support group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to sage-support...@googlegroups.com. 
  To post to this group, send email to sage-s...@googlegroups.com. 
  Visit this group at http://groups.google.com/group/sage-support. 
  For more options, visit https://groups.google.com/d/optout. 



 -- 
 William Stein 
 Professor of Mathematics 
 University of Washington 
 http://wstein.org 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Only dash some edges in a graph?

2014-06-01 Thread P Purkayastha
Created this ticket http://trac.sagemath.org/ticket/16421

On Saturday, May 31, 2014 11:07:20 PM UTC+8, Ursula Whitcher wrote:

 On 5/30/2014 11:47 PM, P Purkayastha wrote: 
  Perhaps you can try using different colors instead of different line 
  styles.  There is an option called 'color_by_label', where you can set a 
  label for some edges and color them accordingly. 

 I am aware of this option, but I want to be able to color AND dash lines. 

 --Ursula. 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Only dash some edges in a graph?

2014-05-31 Thread P Purkayastha
Perhaps you can try using different colors instead of different line 
styles.  There is an option called 'color_by_label', where you can set a 
label for some edges and color them accordingly.

On Wednesday, May 28, 2014 6:29:31 AM UTC+8, Ursula Whitcher wrote:

 Is it possible to display a directed graph in Sage so that only some of 
 the edges are dashed?  I found the edge_style option, but that seems to 
 apply to all of the edges simultaneously.

 UAW


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: defining custom 3d classes

2014-05-20 Thread P Purkayastha
Well, your Triad class also doesn't work with show(). So, there is no 
difference in behavior as such between your Triangle and Triad. Your Triad 
is working when combined with other graphics objects.

You can see what show implements by running

sage: show??

You will notice that it executes the .show() method if it exists. So, all 
you have to do is implement the .show() method. Since the graphics class 
has it implemented properly, all you need to do is call the one in the 
graphics class. So, your Triangle class (for example) can have this 
additional method:

class Triangle():
def __init__(self, points, edgeColor='black', faceColor='white'):
self.f1 = polygon3d(points, color=faceColor)
self.l123 = line3d(points, thickness=10, color=edgeColor)
   
def plot3d(self):
return self.f1 + self.l123

def show(self, *args, **kwds):
return self.plot3d().show(*args, **kwds)


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: sage 6.2

2014-05-19 Thread P Purkayastha
This:

https://groups.google.com/d/topic/sage-release/ZLmUArxZTd4/discussion

On Monday, May 19, 2014 3:52:35 AM UTC+8, nt.a@gmail.com wrote:

 Hi
 Is this software version 6.2 for Windows exist?
 Best


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: How to import a project

2014-05-19 Thread P Purkayastha
As far as I know, you can not import an html file.

On Monday, May 19, 2014 8:05:16 PM UTC+8, SiL588 . wrote:

 Hi, I just started using sage and I previoulsy saved a project in html 
 format. Now I want to import and edit it, but when i do it all i see is 
 html code, and that's not what i need. I'd like to have the standard sage 
 interface with the evaluate button and all the rest, i don't know if you 
 understand what i mean. How do i do that? I have no idea how to move in 
 this, please help me!
 Thank you very much!


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] installation from source failed on 6.2

2014-05-19 Thread P Purkayastha

On Tue 20 May 2014 03:00:06 AM SGT, Luis Finotti wrote:



On Friday, May 16, 2014 5:41:53 PM UTC-4, P Purkayastha wrote:

Actually, the problem in both cases could be that some directory,
maybe /usr/local/sage-6.2 or some directory inside it, was group
writable.


On Sat, May 17, 2014 at 5:39 AM, Montgomery-Smith, Stephen
ste...@missouri.edu javascript: wrote:

On 05/16/2014 04:29 PM, Luis Finotti wrote:
 Dear all,

 I tried to build from source (as usual for me) in Debian
unstable (64 bit).

 The install.log can be found here:
 http://www.math.utk.edu/~finotti/misc/install.log
http://www.math.utk.edu/~finotti/misc/install.log

 Any help would be greatly appreciated.

 Best to all,

 Luis

I got this error as well on FreeBSD when I tried to build sage
as root.

Building as non-root fixed the problem.


OK, I tried to continue the installation, and it failed again.  The
new log can be seen here:
http://www.math.utk.edu/~finotti/misc/install.log.2

I did find some directories with group write permissions.  I removed
these permissions and tried again, but this time it failed very
quickly.  I scraped it and now I am trying to build as a regular
user.  I will let you know if this fixes it.

Oddly enough, in my office computer, running Fedora, it installed
without problems...

Best to all,

Luis

--
You received this message because you are subscribed to a topic in the
Google Groups sage-support group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sage-support/H-SI3700rGc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
sage-support+unsubscr...@googlegroups.com
mailto:sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com
mailto:sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Your problem seems to be this:

checking dependency style of gcc... gcc3
checking for python... /usr/local/sage-6.2/local/bin/python
checking for a version of Python = '2.1.0'... sys:1: RuntimeWarning: 
not adding directory '' to sys.path since it's writable by an untrusted 
group.
Untrusted users could put files in this directory which might then be 
imported by your Python code. As a general precaution from similar 
exploits, you should not execute Python code from this directory

yes
checking for the distutils Python package... no
configure: error: cannot import Python module distutils.
Please check your Python installation. The error was:
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's 
writable by an untrusted group.
Untrusted users could put files in this directory which might then be 
imported by your Python code. As a general precaution from similar 
exploits, you should not execute Python code from this directory
make[3]: Entering directory 
'/usr/local/sage-6.2/local/var/tmp/sage/build/pynac-0.3.2/src'

make[3]: *** No targets specified and no makefile found.  Stop.
make[3]: Leaving directory 
'/usr/local/sage-6.2/local/var/tmp/sage/build/pynac-0.3.2/src'

Error building pynac.


I had seen this error before and for me

./sage -f pynac

worked. But this was on a development version of sage and already all 
the components from a previous beta version of sage were already 
present.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] installation from source failed on 6.2

2014-05-19 Thread P Purkayastha

On Tue 20 May 2014 03:00:06 AM SGT, Luis Finotti wrote:



On Friday, May 16, 2014 5:41:53 PM UTC-4, P Purkayastha wrote:

Actually, the problem in both cases could be that some directory,
maybe /usr/local/sage-6.2 or some directory inside it, was group
writable.


On Sat, May 17, 2014 at 5:39 AM, Montgomery-Smith, Stephen
ste...@missouri.edu javascript: wrote:

On 05/16/2014 04:29 PM, Luis Finotti wrote:
 Dear all,

 I tried to build from source (as usual for me) in Debian
unstable (64 bit).

 The install.log can be found here:
 http://www.math.utk.edu/~finotti/misc/install.log
http://www.math.utk.edu/~finotti/misc/install.log

 Any help would be greatly appreciated.

 Best to all,

 Luis

I got this error as well on FreeBSD when I tried to build sage
as root.

Building as non-root fixed the problem.


OK, I tried to continue the installation, and it failed again.  The
new log can be seen here:
http://www.math.utk.edu/~finotti/misc/install.log.2

I did find some directories with group write permissions.  I removed
these permissions and tried again, but this time it failed very
quickly.  I scraped it and now I am trying to build as a regular
user.  I will let you know if this fixes it.

Oddly enough, in my office computer, running Fedora, it installed
without problems...

Best to all,

Luis

--
You received this message because you are subscribed to a topic in the
Google Groups sage-support group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sage-support/H-SI3700rGc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
sage-support+unsubscr...@googlegroups.com
mailto:sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com
mailto:sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Sorry for the hurried email previously - this is the same error as 
earlier! Your pynac build is never finishing.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] installation from source failed on 6.2

2014-05-19 Thread P Purkayastha
On Tue, May 20, 2014 at 5:08 AM, P Purkayastha ppu...@gmail.com wrote:

 On Tue 20 May 2014 03:00:06 AM SGT, Luis Finotti wrote:



 On Friday, May 16, 2014 5:41:53 PM UTC-4, P Purkayastha wrote:

 Actually, the problem in both cases could be that some directory,
 maybe /usr/local/sage-6.2 or some directory inside it, was group
 writable.


 On Sat, May 17, 2014 at 5:39 AM, Montgomery-Smith, Stephen
 ste...@missouri.edu javascript: wrote:

 On 05/16/2014 04:29 PM, Luis Finotti wrote:
  Dear all,
 
  I tried to build from source (as usual for me) in Debian
 unstable (64 bit).
 
  The install.log can be found here:
  http://www.math.utk.edu/~finotti/misc/install.log
 http://www.math.utk.edu/~finotti/misc/install.log
 
  Any help would be greatly appreciated.
 
  Best to all,
 
  Luis

 I got this error as well on FreeBSD when I tried to build sage
 as root.

 Building as non-root fixed the problem.


 OK, I tried to continue the installation, and it failed again.  The
 new log can be seen here:
 http://www.math.utk.edu/~finotti/misc/install.log.2

 I did find some directories with group write permissions.  I removed
 these permissions and tried again, but this time it failed very
 quickly.  I scraped it and now I am trying to build as a regular
 user.  I will let you know if this fixes it.

 Oddly enough, in my office computer, running Fedora, it installed
 without problems...

 Best to all,

 Luis

 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/H-SI3700rGc/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com
 mailto:sage-support+unsubscr...@googlegroups.com.

 To post to this group, send email to sage-support@googlegroups.com
 mailto:sage-support@googlegroups.com.

 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


 Your problem seems to be this:


 checking dependency style of gcc... gcc3
 checking for python... /usr/local/sage-6.2/local/bin/python
 checking for a version of Python = '2.1.0'... sys:1: RuntimeWarning: not
 adding directory '' to sys.path since it's writable by an untrusted group.
 Untrusted users could put files in this directory which might then be
 imported by your Python code. As a general precaution from similar
 exploits, you should not execute Python code from this directory
 yes
 checking for the distutils Python package... no
 configure: error: cannot import Python module distutils.
 Please check your Python installation. The error was:
 sys:1: RuntimeWarning: not adding directory '' to sys.path since it's
 writable by an untrusted group.
 Untrusted users could put files in this directory which might then be
 imported by your Python code. As a general precaution from similar
 exploits, you should not execute Python code from this directory
 make[3]: Entering directory
 '/usr/local/sage-6.2/local/var/tmp/sage/build/pynac-0.3.2/src'
 make[3]: *** No targets specified and no makefile found.  Stop.
 make[3]: Leaving directory
 '/usr/local/sage-6.2/local/var/tmp/sage/build/pynac-0.3.2/src'
 Error building pynac.


 I had seen this error before and for me

 ./sage -f pynac

 worked. But this was on a development version of sage and already all the
 components from a previous beta version of sage were already present.


Can you check the permissions on SAGE_ROOT/local/lib/python2.7 and
SAGE_ROOT/local/lib/python/distutils and make sure they are not group
writable?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: installation from source failed on 6.2

2014-05-16 Thread P Purkayastha


Your main error is here:


checking dependency style of gcc... gcc3
checking for python... /usr/local/sage-6.2/local/bin/python
checking for a version of Python = '2.1.0'... sys:1: RuntimeWarning: not 
adding directory '' to sys.path since it's writable by an untrusted group.
Untrusted users could put files in this directory which might then be 
imported by your Python code. As a general precaution from similar 
exploits, you should not execute Python code from this directory
yes
checking for the distutils Python package... no
configure: error: cannot import Python module distutils.
Please check your Python installation. The error was:
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's 
writable by an untrusted group.
Untrusted users could put files in this directory which might then be 
imported by your Python code. As a general precaution from similar 
exploits, you should not execute Python code from this directory
make[3]: Entering directory 
'/usr/local/sage-6.2/local/var/tmp/sage/build/pynac-0.3.2/src'
make[3]: *** No targets specified and no makefile found. Stop.
make[3]: Leaving directory 
'/usr/local/sage-6.2/local/var/tmp/sage/build/pynac-0.3.2/src'
Error building pynac.


Try restarting the build process. It should pick up from where it stopped.

On Saturday, May 17, 2014 5:29:35 AM UTC+8, Luis Finotti wrote:

 Dear all,

 I tried to build from source (as usual for me) in Debian unstable (64 bit).

 The install.log can be found here: 
 http://www.math.utk.edu/~finotti/misc/install.log

 Any help would be greatly appreciated.

 Best to all,

 Luis


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] installation from source failed on 6.2

2014-05-16 Thread P Purkayastha
Actually, the problem in both cases could be that some directory, maybe
/usr/local/sage-6.2 or some directory inside it, was group writable.


On Sat, May 17, 2014 at 5:39 AM, Montgomery-Smith, Stephen 
step...@missouri.edu wrote:

 On 05/16/2014 04:29 PM, Luis Finotti wrote:
  Dear all,
 
  I tried to build from source (as usual for me) in Debian unstable (64
 bit).
 
  The install.log can be found here:
  http://www.math.utk.edu/~finotti/misc/install.log
 
  Any help would be greatly appreciated.
 
  Best to all,
 
  Luis

 I got this error as well on FreeBSD when I tried to build sage as root.

 Building as non-root fixed the problem.

 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/H-SI3700rGc/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Immutable HammingCode?

2014-05-13 Thread P Purkayastha


On Monday, May 12, 2014 11:12:19 PM UTC+8, Gerli Viikmaa wrote:

 Hi,

 Consider the following code (the field is arbitrary in this case)
 sage: code = codes.HammingCode(2, GF(4,'a'))

 The codewords (vectors) cannot be changed (note the absence of an error):
 sage: code[0]
 (0, 0, 0, 0, 0)
 sage: code[0][0] = 1
 sage: code[0]
 (0, 0, 0, 0, 0)


There is no error because code[0] regenerates the codeword every time you 
call it. The reason for doing so is in http://trac.sagemath.org/ticket/13694

The vector is indeed being changed when you write code[0][0]=1. If you want 
to create a set of immutable vectors, I suggest you simply run over the 
list of codewords and set them to be immutable, as shown below. Beware that 
this is good only for small codes. Running something like this over a 
larger code means you will quickly run out of memory.

sage: C = codes.HammingCode(3, GF(2))
sage: codevectors = C.list()
sage: for c in codevectors: c.set_immutable()
sage:
sage: D = {c: c.hamming_weight() for c in codevectors}

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Immutable HammingCode?

2014-05-12 Thread P Purkayastha
The reason why it behaves this way is because the code[0] command 
regenerates the codeword every time you call it. The reason for doing so is 
in http://trac.sagemath.org/ticket/13694

So, code[0][0]=1 is indeed changing the vector, but it is not changing the 
vector that is displayed by the next code[0] command. If you want a set of 
immutable vectors, then you can do something like this:

sage: C = codes.HammingCode(3, GF(2))
sage: codevectors = C.list()
sage: for c in codevectors: c.set_immutable()
sage:
sage: D = {c: c.hamming_weight() for c in codevectors}



On Monday, May 12, 2014 11:12:19 PM UTC+8, Gerli Viikmaa wrote:

 Hi,

 Consider the following code (the field is arbitrary in this case)
 sage: code = codes.HammingCode(2, GF(4,'a'))

 The codewords (vectors) cannot be changed (note the absence of an error):
 sage: code[0]
 (0, 0, 0, 0, 0)
 sage: code[0][0] = 1
 sage: code[0]
 (0, 0, 0, 0, 0)

 yet they are not immutable, even when trying to set them so:
 sage: code[0].is_immutable()
 False
 sage: code[0].set_immutable()
 sage: code[0].is_immutable()
 False

 Is there any particular reason why the codewords are not immutable if they 
 cannot be changed anyway?

 If they were, using them as dictionary keys would be less of a hassle:
 sage: {code[0]: element}
 TypeError: mutable vectors are unhashable

 I guess the current options are
 sage: v = code[0]
 sage: v.set_immutable()
 sage: {v: element}
 or 
 sage: {tuple(code[0]): element}
 neither of which is particularly elegant.

 Is there a way to set the all of the codewords as immutable?

 I'm using Sage version 6.1.1 on a Linux machine.

 Gerli


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Immutable HammingCode?

2014-05-12 Thread P Purkayastha
It may not be such a bad idea to return codevectors which are immutable. I 
have opened http://trac.sagemath.org/ticket/16338 to discuss this.

On Monday, May 12, 2014 11:12:19 PM UTC+8, Gerli Viikmaa wrote:

 Hi,

 Consider the following code (the field is arbitrary in this case)
 sage: code = codes.HammingCode(2, GF(4,'a'))

 The codewords (vectors) cannot be changed (note the absence of an error):
 sage: code[0]
 (0, 0, 0, 0, 0)
 sage: code[0][0] = 1
 sage: code[0]
 (0, 0, 0, 0, 0)

 yet they are not immutable, even when trying to set them so:
 sage: code[0].is_immutable()
 False
 sage: code[0].set_immutable()
 sage: code[0].is_immutable()
 False

 Is there any particular reason why the codewords are not immutable if they 
 cannot be changed anyway?

 If they were, using them as dictionary keys would be less of a hassle:
 sage: {code[0]: element}
 TypeError: mutable vectors are unhashable

 I guess the current options are
 sage: v = code[0]
 sage: v.set_immutable()
 sage: {v: element}
 or 
 sage: {tuple(code[0]): element}
 neither of which is particularly elegant.

 Is there a way to set the all of the codewords as immutable?

 I'm using Sage version 6.1.1 on a Linux machine.

 Gerli


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Color for implicit plot region

2014-05-11 Thread P Purkayastha
Seems to be a bug with implicit_plot which seems incomplete in the way it 
handles colors. For now, a workaround is the following (since your f1 and 
f2 are symbolic expressions):

t1 = implicit_plot(f1, (-3, 6), (-3, 3),fill=True,incol=red)

I have opened http://trac.sagemath.org/ticket/16325 to track this.

On Sunday, May 11, 2014 3:49:01 PM UTC+8, Dominique Laurain wrote:

 Implicit plot (2D) in cell sagews worksheet.

 Region of  first circle (function f1) is not red colored. Is there any 
 explanation I missed ? 

 I checked before posting in SAGE help (Contour plots) : parameter color 
 is for the plot color but in case of region (fill = true), I believed 
 color  would be applied to the plot (the border) or the region.

 f1(x,y) = x^2 + y^2 - 2
 f2(x,y) = (x-3)^2 + y^2 - 2
 t1 = implicit_plot(f1, (-3, 6), (-3, 3),fill=True,color=red)
 t2 = implicit_plot(f2, (-3, 6), (-3, 3),fill=False,color=red)
 (t1+t2).show()

 Dominique.

 PS: not to simple, to doctest  visual results (request for library of 
 bitmap files as doctest results ; use UNIX cmp to compare ; image results 
 can be displayed by toggle button in SAGE help webpages)


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Color for implicit plot region

2014-05-11 Thread P Purkayastha
Patch is up for review :)

On Sunday, May 11, 2014 6:02:17 PM UTC+8, Dominique Laurain wrote:

 Thanks for all (the answer and the track ticket)... :-) 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: pretty print question

2014-04-07 Thread P Purkayastha
It depends on how Sage presents the latex in the HTML code. Mathjax 
does not parse all latex code. It only parses those that are in a 
special span or div.


One way to get Sage to pass on the latex within the specific span or 
div is to make the string a LatexExpr string.



On Mon 07 Apr 2014 03:07:06 PM SGT, Dominique Laurain wrote:

I don't know so much about cell display in SAGE cloud...but I guess...
there are step s:
1. cell content in ASCII raw text is processed by Tex
2. tex content is then displayed by Mathjax

I am sure about Mathjax because I can  mouse right button click on the
displayed matrix in my browser (currently Chrome) and I get
one menu about Mathjax renderer (can be HTML-CSS, Mathml or SVG ; I
cannot use MathMl because my browser has not brwser extension to
display mathml ; SVG is my default display)

With the menu show math as / tex commands I get :

{x= \left(\begin{array}{rr}
1  2 \\
3  4
\end{array}\right)}

That means that default commands (set by new command) have been already parsed 
by Tex before send to Mathjax.

I can advice you to check is your browser can parse Mathjax commands : go to 
URL www.mathjax.org with your browser, to check if you have nice display

 of math upper right in the windo w. If not, check Javascript is ok.


If ok, then try to use various things in the SAGE cloud : first try to
process a TEX file ; second search in one terminal is tex working for
your projects; third, use the %latex tag in one cell

--
You received this message because you are subscribed to a topic in the
Google Groups sage-support group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sage-support/1vtfecpnDJ0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
sage-support+unsubscr...@googlegroups.com
mailto:sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com
mailto:sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: pretty print question

2014-04-07 Thread P Purkayastha

On Mon 07 Apr 2014 03:34:40 PM SGT, P Purkayastha wrote:

It depends on how Sage presents the latex in the HTML code. Mathjax
does not parse all latex code. It only parses those that are in a
special span or div.

One way to get Sage to pass on the latex within the specific span or
div is to make the string a LatexExpr string.



Sorry, I should have checked before mailing. Sage passes on the latex 
in a script tag. And MathJax generates the required span or div. 
You can look at methods and classes in the file sage.misc.latex?? to 
see what is generated.





On Mon 07 Apr 2014 03:07:06 PM SGT, Dominique Laurain wrote:

I don't know so much about cell display in SAGE cloud...but I guess...
there are step s:
1. cell content in ASCII raw text is processed by Tex
2. tex content is then displayed by Mathjax

I am sure about Mathjax because I can  mouse right button click on the
displayed matrix in my browser (currently Chrome) and I get
one menu about Mathjax renderer (can be HTML-CSS, Mathml or SVG ; I
cannot use MathMl because my browser has not brwser extension to
display mathml ; SVG is my default display)

With the menu show math as / tex commands I get :

{x= \left(\begin{array}{rr}
1  2 \\
3  4
\end{array}\right)}

That means that default commands (set by new command) have been
already parsed by Tex before send to Mathjax.

I can advice you to check is your browser can parse Mathjax commands
: go to URL www.mathjax.org with your browser, to check if you have
nice display

 of math upper right in the windo w. If not, check Javascript is ok.


If ok, then try to use various things in the SAGE cloud : first try to
process a TEX file ; second search in one terminal is tex working for
your projects; third, use the %latex tag in one cell

--
You received this message because you are subscribed to a topic in the
Google Groups sage-support group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sage-support/1vtfecpnDJ0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
sage-support+unsubscr...@googlegroups.com
mailto:sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com
mailto:sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.






--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: pretty print question

2014-04-02 Thread P Purkayastha
pretty_print('x = ', matrix([[1,2], [3,4]]))



On Tuesday, April 1, 2014 9:25:30 PM UTC+8, juaninf wrote:

 Dears members,

 I want make a pretty_print in the follow code but I get false, and I want 
 get the pretty expression of

 $$x=\left(\begin{array}{rr}
 1  2 \\
 3  4
 \end{array}\right)$$

 var('x')
 A=matrix([[1,2],[3,4]])
 pretty_print(x==A)

 How I will be able to fix that?


 -- 
 -
 MSc. Juan del Carmen Grados Vásquez
 Laboratório Nacional de Computação Científica 
 Tel: +55 24 2233-6260
 (http://www.lncc.br/)
 http://juaninf.blogspot.com
 -
  

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: pretty print question

2014-04-02 Thread P Purkayastha
If you want x to be typeset normally, then you can do the following:
pretty_print(LatexExpr('x = '), matrix([[1,2], [3,4]]))



On Wednesday, April 2, 2014 8:51:56 PM UTC+8, P Purkayastha wrote:

 pretty_print('x = ', matrix([[1,2], [3,4]]))



 On Tuesday, April 1, 2014 9:25:30 PM UTC+8, juaninf wrote:

 Dears members,

 I want make a pretty_print in the follow code but I get false, and I want 
 get the pretty expression of

 $$x=\left(\begin{array}{rr}
 1  2 \\
 3  4
 \end{array}\right)$$

 var('x')
 A=matrix([[1,2],[3,4]])
 pretty_print(x==A)

 How I will be able to fix that?


 -- 
 -
 MSc. Juan del Carmen Grados Vásquez
 Laboratório Nacional de Computação Científica 
 Tel: +55 24 2233-6260
 (http://www.lncc.br/)
 http://juaninf.blogspot.com
 -
  


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: sage notebook in other browser

2014-03-31 Thread P Purkayastha
Does the following work for you? It comes with a desktop file:

https://github.com/ppurka/run_sage



On Saturday, March 29, 2014 11:40:05 AM UTC+8, Prakash Dey wrote:


 Thank You Very much. 

 Now I will be able to make a unity launcher for sage.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: jmol on notebook blocked in firefox

2014-03-06 Thread P Purkayastha

This  should work:

sage.plot.plot.EMBEDDED_MODE=False  # show plot in jmol/other window
sphere().show()
sage.plot.plot.EMBEDDED_MODE=True   # show other plots in notebook again
plot(x)


On Friday, March 7, 2014 3:45:58 AM UTC+8, Luis Finotti wrote:


 Thanks for the reply! 

 That is too bad, as it will make it seem less user friendly to new users...

 Is it possible to tell the notebook to open jmol in its own window (like 
 if it were called from the command line)?

 Thanks again,

 Luis


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: plotting matrix transformations of unit ball in the p-norm

2014-03-03 Thread P Purkayastha


We used something like this for a class once. You can follow which point is 
transformed where


def vector_plotter(vec_list, points=False, **kwds):
pic = Graphics()
for c, v in zip(rainbow(len(vec_list), 'rgbtuple'), vec_list):
if points:
pic += point(v, rgbcolor=c, **kwds)
else:
pic += plot(v, rgbcolor=c, **kwds)
return pic

You can give it a list of points, and in another plot look at the list of 
transfrmed points.

#V is a list of vectuors
vector_plotter(V)

vector_plotter([M*v for v in V])



On Sunday, March 2, 2014 11:52:32 PM UTC+8, martyall wrote:

 I would like to plot the effects of an 2 by 2 matrix over the reals on 
 the unit sphere in the p-norm. By effects I mean I would like to plot the 
 unit sphere and it's image under a given matrix. In clearest case when p=2 
 I found the following code from trac #9728 which does exactly what I want. 

 @interact 
 def linear_transformation(
 theta = slider(0, 2*pi, .1), 
 r = slider(0.1,  2, .1, default=1),
 A = input_grid(2, 2, default = [[1,2],[0,2]],
  to_value=matrix)):
 An interact which illustrates ...
 
 v=vector([r*cos(theta), r*sin(theta)]) 
 w = A*v

 unit_sphere = circle((0,0), radius = 1, rgbcolor = (1,0,0))
 var('t')
 image_of_sphere = parametric_plot(A*vector([sin(t),cos(t)]), 
  (t, 0, 2*pi), rgbcolor=(0,0,1))
 
 html($v = %s,; %s w=%s$%(v.n(4),latex(A),w.n(4))) 
 show(v.plot(rgbcolor=(1,0,0)) +
  w.plot(rgbcolor=(0,0,1)) +
  unit_sphere + image_of_sphere,
  aspect_ratio=1)

 I'm a total newb when it comes to plotting in sage, so I would very much 
 appreciate the help.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Problem launching Sage 6.0

2014-02-24 Thread P Purkayastha

On 02/24/2014 06:38 PM, Topaze wrote:

Hello Sage team.

I can't launch Sage anymore, here is the command and its output :

--

/opt/sage-6.0/sage -c notebook(interface='localhost', secure=False) 

The notebook files are stored in: sage_notebook.sagenb
Traceback (most recent call last):
   File /opt/sage-6.0/src/bin/sage-eval, line 13, in module
 eval(compile(s,'cmdline','exec'))
   File cmdline, line 1, in module
   File 
/opt/sage-6.0/local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/notebook/notebook_object.py,
 line 228, in __call__
 return self.notebook(*args, **kwds)
   File 
/opt/sage-6.0/local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/notebook/run_notebook.py,
 line 613, in notebook_run
 cmd = command[server]().run_command(kw)
   File 
/opt/sage-6.0/local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/notebook/run_notebook.py,
 line 295, in run_command
 pid = int(open(kw['pidfile']).read())
ValueError: invalid literal for int() with base 10: ''

--

I used Sage all yesterday long with absolutely no problem and no crash 
happened. I didn't do any modification of any sort (upgrade, etc) ; and so this 
morning I've got this error message.

This message is somewhat terse for me. What's going on ?

Thank.



Can you check if you have the file 
~/.sage/sage_notebook.sagenb/sagenb.pid ? If so, then check the 
permissions on the file, or delete the file and see if you can get the 
notebook to start again.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: get_values() may fail on not-yet solved MIP using Coin (Unhandled SIGSEGV generated)

2014-02-23 Thread P Purkayastha

On 02/23/2014 09:29 PM, Dima Pasechnik wrote:

On 2014-02-23, Dima Pasechnik dimp...@gmail.com wrote:

On 2014-02-23, Dima Pasechnik dimp...@gmail.com wrote:

On 2014-02-21, Benoît Darties benoit.dart...@gmail.com wrote:

Here is the code I run

sage: p = MixedIntegerLinearProgram(Coin)
sage: x=p.new_variable(binary=True,dim=1)
sage: p.set_min(x[0], 0.0)
sage:
sage: result=p.get_values(x);


works for me in Sage 6.1.1 on OSX 10.6.8.

oops, in fact, this does crash in the latter case, too.
(I did get_values() instead of get_values(x)...)

As well as it does crash on Linux x86_64.


the remedy is very simple: Coin's getColSolution() returns NULL
in this case, and thus
return solution[variable]
in get_variable_value() produces this crash.
So one has to check for NULL and so something meaningful if it is
NULL, e.g.
if solution == NULL:
return []
 else:
return solution[variable]


Not sure whether [] is the right value, perhaps 0 might be more
uniform accross different backends...














ideally, one should simply use if solution or if not solution. In 
this case, the following patch fixes the segv:


diff --git a/src/sage/numerical/backends/coin_backend.pyx 
b/src/sage/numerical/backends/coin_backend.pyx

index 4083c79..96e47d3 100644
--- a/src/sage/numerical/backends/coin_backend.pyx
+++ b/src/sage/numerical/backends/coin_backend.pyx
@@ -826,7 +826,10 @@ cdef class CoinBackend(GenericBackend):

 cdef double * solution
 solution = double* self.model.solver().getColSolution()
-return solution[variable]
+if solution:
+return solution[variable]
+else:
+return []

 cpdef int ncols(self):
 r


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: someone lost all their info in sagenb.org

2014-01-24 Thread P Purkayastha

On 01/23/2014 02:04 AM, kcrisman wrote:

However, there are lots and lots of things on that spreadsheet (I
thought it was no longer operational, but I guess old Sage installations
still go there ... including sagenb.org)


The google doc should still be operational for now. The switch to 
ask.sagemath has not been made - this switch will happen when #15569 is 
merged with sagenb-0.10.8.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] someone lost all their info in sagenb.org

2014-01-22 Thread P Purkayastha


Hi!I have a problem with my account of sage. I don't know why, but I 
have ost all my job. I don't understand.


Thanks, Maria


- from the google notebook bug reports.
https://spreadsheets.google.com/pub?key=pCwvGVwSMxTzT6E2xNdo5fA

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: someone lost all their info in sagenb.org

2014-01-22 Thread P Purkayastha

On 01/23/2014 06:13 AM, Jason Grout wrote:

On 1/22/14 10:59 AM, William Stein wrote:

This usually happens when somebody logs into
https://cloud.sagemath.com  instead ofhttp://sagenb.org.


Or it also can happen if someone is using google authentication and goes
to http://www.sagenb.org instead of http://sagenb.org (or vice versa).

Thanks,

Jason


I see that sagenb.org has a bit older notebook. Perhaps you can apply 
this patch manually: https://github.com/sagemath/sagenb/pull/139


You won't need to restart the server.

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: README.txt build-from-source buries fact -j8 in make -j8 ignored -- need export MAKE=make -j8

2014-01-03 Thread P Purkayastha

On 01/03/2014 03:28 PM, Jeroen Demeyer wrote:

On 2014-01-03 01:44, P Purkayastha wrote:

The parallel build in sage compiles
different packages in parallel, but each package still compiles as -j1.

That statement is completely not true. Sage uses both, it compiles
different packages in parallel and also builds the packages itself in
parallel (if the package supports it).

Jeroen.



Then I am very surprised; for two reasons - I have never seen more than 
one gcc process on htop while running a sage compilation with -j2 or -j4 
-- maybe it has always just so happened that every time I looked at 
htop, it was a package without support for -j. Secondly, it is nowhere 
mentioned in the README that both sage packages and compilation within 
each individual package are launched as -j.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: README.txt build-from-source buries fact -j8 in make -j8 ignored -- need export MAKE=make -j8

2014-01-02 Thread P Purkayastha
It should not be enabled in the top-level make, in my opinion. 
Typically, make -jN makes parallel compiles within the same package 
(if the package supports it). The parallel build in sage compiles 
different packages in parallel, but each package still compiles as -j1.



On 01/03/2014 02:48 AM, Robert Bradshaw wrote:

How hard would it be to let make -jN actually work from the top-level make?

On Tue, Dec 31, 2013 at 4:57 PM, Joseph P. Skudlarek jsku...@gmail.com wrote:

This is a request to update the README.txt file used when building from
sources -- the README.txt buries the fact that -jN in make -jN is
effectively ignored -- but it does make claar, in the details below,
that you need export MAKE=make -jN.

Since ignoring -jN is non-standard, and since it's important to avoid
surprises when building in parallel, I suggest changing README.txt (at
the top level of the source tree downloaded as sage-6.0.tar.gz) as
follows.

replace

 3. cd into the Sage directory and type make:

cd sage-*/
make

That's it! Everything is automatic and non-interactive. The build
should work fine on all fully supported platforms. If it does not, we
want to know!

with

 3. cd into the Sage directory and type make:

cd sage-*/
make

That's it! Everything is automatic and non-interactive. The build
should work fine on all fully supported platforms. If it does not, we
want to know!  If you want to build in parallel, see below.

[]

Thanks.  /J

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: I need a bit of git handholding...

2013-12-23 Thread P Purkayastha

We need a patch. http://trac.sagemath.org/ticket/15558 :)

I haven't been able to figure out where all the help strings are 
stored... maybe I haven't searched at the proper places.



On 12/23/2013 12:33 AM, Emmanuel Charpentier wrote:

Thank you. I missed that online help. Silly me...

--
Emmanuel Charpentier

Le dimanche 22 décembre 2013 16:39:27 UTC+1, Volker Braun a écrit :

The dev object in Sage is equivalent to the sage -dev command
line. Arguments are translated between Python to Shell calling
conventions, so

$ sage -dev diff --base master

is the same as

sage: dev.diff(base='master')


Help overview:

$ sage -dev help
usage: sage-dev [-h] subcommand ...

The developer interface for sage.

optional arguments:
   -h, --helpshow this help message and exit

subcommands:
 abandon Abandon a ticket or branch.
 checkoutCheckout another branch.
 clean   Restore the working directory to the most
recent commit.
 comment Add a comment to ticket on trac.
 commit  Create a commit from the pending changes on
the current branch.
 create-ticket   Create a new ticket on trac.
 diffShow how the current file system differs
from base.
 download-patch  Legacy support: Download a patch to a
temporary directory.
 edit-ticket Edit the description of ticket on trac.
 helpshow help message and exit
 import-patchLegacy support: Import a patch into the
current branch.
 merge   Merge changes from ticket_or_branch into
the current branch.
 needs-info  Set a ticket on trac to needs_info.
 needs-reviewSet a ticket on trac to needs_review.
 needs-work  Set a ticket on trac to needs_work.
 positive-review Set a ticket on trac to positive_review.
 prune-tickets   Remove branches for tickets that are
already merged into master.
 pullPull ticket_or_remote_branch to branch.
 pushPush the current branch to the Sage repository.
 remote-status   Show information about the status of ticket.
 set-remote  Set the remote branch to push to for
branch_or_ticket to remote_branch.
 show-dependencies   Show the dependencies of ticket.
 tickets Print the tickets currently being worked on
in your local repository.
 upload-ssh-key  Upload public_key to gitolite through the
trac interface.
 vanilla Return to a clean version of Sage.


Help for subcommands:


$ sage -dev diff -husage: sage-dev diff [-h] [--base BASE]

Show how the current file system differs from base.

optional arguments:
   -h, --help   show this help message and exit
   --base BASE  a string; show the differences against the latest
'commit' (the default), against the branch
'master' (or any other branch name), or the merge
of the 'dependencies' of the current ticket
(if the dependencies merge cleanly)


On Sunday, December 22, 2013 3:22:42 PM UTC, Emmanuel Charpentier wrote:

Thank you very much, Volker ! I definitely need to take some
time to **learn** git.

BTW : the -dev commands currently have no direct documentation
/per se/. There is a lot of examples in the developer's guide,
and the reference manual has a SageDev section, but neither is
clear as to what sage functions have a script counterpart, or
the possible differences between sage functions and scripts.

--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: plot returns an error when given a callable class

2013-12-18 Thread P Purkayastha

For now, perhaps the workaround is to use

plot(lambda x: h(x)).show(xmin=0, xmax=1)

Note that xmin, xmax work properly only with show when xmax  xmin. 
ymin, ymax work with both plot() and show() and is used to zoom in on 
the rendered graph. This is ticket

http://trac.sagemath.org/ticket/13368

If you ever intend to flip a graph, then use the usual format instead of 
xmin, xmax in the case xmax  xmin:

plot(lambda x: h(x), (x, 0, 1))
plot(lambda x: h(x), (x, 0, 1)).show(xmax=0, xmin=1)

 - basu.

On 12/19/2013 01:38 AM, Alden wrote:

Given what the patch is supposed to do, it seems like it should fix it.
  However, when I try to install the patch, I get the error abort:
failed to synchronize metadata for sage/plot/plot.py.  Anyway, not a
huge deal, so I guess I should just wait until the patch is integrated
in sage 6.1.

On Tuesday, December 17, 2013 5:36:34 PM UTC-6, P Purkayastha wrote:

Does the patch here help: http://trac.sagemath.org/ticket/15030
http://trac.sagemath.org/ticket/15030 ?

On 12/18/2013 06:48 AM, Alden wrote:
  I wrote a class with a __call__ method, and I want to plot an
instance
  of it using plot() in the sage notebook.  I run the commands:
 
  import circle_homeo
  import cyclic_order
  h = circle_homeo.PSL2R_action(cyclic_order.CyclicOrder('abAB'))[0]
 
  (this doesn't matter; all that should matter is that h is some
callable
  class)
 
  plot(h, xmin=0, xmax=1)
 
  returns the error:
 
  *
  Traceback (most recent call last):
 File stdin, line 1, in module
 File _sage_input_32.py, line 10, in module
   exec compile(u'open(___code___.py,w).write(# -*-
coding: utf-8
  -*-\\n +
 

_support_.preparse_worksheet_cell(base64.b64decode(cGxvdChoLCB4bWluPTAsIHhtYXg9MSk=),globals())+\\n);

  execfile(os.path.abspath(___code___.py))
 File , line 1, in module
 File /tmp/tmpnBGA3K/___code___.py, line 3, in module
   exec compile(u'plot(h, xmin=_sage_const_0 ,
xmax=_sage_const_1 )
 File , line 1, in module
 File
 

/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py,

  line 692, in wrapper
   return func(*args, **kwds)
 File
 

/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py,

  line 537, in wrapper
   return func(*args, **options)
 File
 

/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/plot.py,

  line 1130, in plot
   G = _plot(funcs, (xmin, xmax), **kwds)
 File
 

/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/plot.py,

  line 1236, in _plot
   funcs, ranges = setup_for_eval_on_grid(funcs, [xrange],
  options['plot_points'])
 File
 

/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/misc.py,

  line 148, in setup_for_eval_on_grid
   return fast_float(funcs, *vars,**options),
  [tuple(range+[range_step]) for range,range_step in zip(ranges,
range_steps)]
 File fast_eval.pyx, line 1377, in sage.ext.fast_eval.fast_float
  (sage/ext/fast_eval.c:9718)
  AttributeError: EquivariantRHomeo instance has no attribute
'__float__'
  ***
 
  However, if I do:
 
  f = lambda x:h(x)
  plot(f, xmin=0, xmax=1)
 
  That works fine.  Is there something I need to do to the class to
  convince plot() to call it?
 
 
  --
  You received this message because you are subscribed to the Google
  Groups sage-support group.
  To unsubscribe from this group and stop receiving emails from it,
send
  an email to sage-support...@googlegroups.com javascript:.
  To post to this group, send email to sage-s...@googlegroups.com
javascript:.
  Visit this group at http://groups.google.com/group/sage-support
http://groups.google.com/group/sage-support.
  For more options, visit https://groups.google.com/groups/opt_out
https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post

[sage-support] Re: plot returns an error when given a callable class

2013-12-17 Thread P Purkayastha

Does the patch here help: http://trac.sagemath.org/ticket/15030 ?

On 12/18/2013 06:48 AM, Alden wrote:

I wrote a class with a __call__ method, and I want to plot an instance
of it using plot() in the sage notebook.  I run the commands:

import circle_homeo
import cyclic_order
h = circle_homeo.PSL2R_action(cyclic_order.CyclicOrder('abAB'))[0]

(this doesn't matter; all that should matter is that h is some callable
class)

plot(h, xmin=0, xmax=1)

returns the error:

*
Traceback (most recent call last):
   File stdin, line 1, in module
   File _sage_input_32.py, line 10, in module
 exec compile(u'open(___code___.py,w).write(# -*- coding: utf-8
-*-\\n +
_support_.preparse_worksheet_cell(base64.b64decode(cGxvdChoLCB4bWluPTAsIHhtYXg9MSk=),globals())+\\n);
execfile(os.path.abspath(___code___.py))
   File , line 1, in module
   File /tmp/tmpnBGA3K/___code___.py, line 3, in module
 exec compile(u'plot(h, xmin=_sage_const_0 , xmax=_sage_const_1 )
   File , line 1, in module
   File
/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py,
line 692, in wrapper
 return func(*args, **kwds)
   File
/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py,
line 537, in wrapper
 return func(*args, **options)
   File
/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/plot.py,
line 1130, in plot
 G = _plot(funcs, (xmin, xmax), **kwds)
   File
/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/plot.py,
line 1236, in _plot
 funcs, ranges = setup_for_eval_on_grid(funcs, [xrange],
options['plot_points'])
   File
/home/akwalker/Documents/software/sage-5.3/local/lib/python2.7/site-packages/sage/plot/misc.py,
line 148, in setup_for_eval_on_grid
 return fast_float(funcs, *vars,**options),
[tuple(range+[range_step]) for range,range_step in zip(ranges, range_steps)]
   File fast_eval.pyx, line 1377, in sage.ext.fast_eval.fast_float
(sage/ext/fast_eval.c:9718)
AttributeError: EquivariantRHomeo instance has no attribute '__float__'
***

However, if I do:

f = lambda x:h(x)
plot(f, xmin=0, xmax=1)

That works fine.  Is there something I need to do to the class to
convince plot() to call it?


--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Possible problem in delsarte_bound_hamming_space

2013-12-15 Thread P Purkayastha

On 12/15/2013 03:01 PM, P Purkayastha wrote:

On 12/15/2013 06:46 AM, Peter Mueller wrote:

The function delsarte_bound_hamming_space(n, d, q, isinteger=False,
return_data=False, solver='PPL') offers the option isinteger=True. As
the doc doesn't tell it, I got a little curious what is assumed to be
integral. Looking at the implementation it turns out that the distance
distribution is assumed to consist of integers. However, for non-linear
codes these numbers rarely are integral!


I think isinteger probably makes sense for the
delsarte_bound_additive_hamming_space() function.


Checking the bounds obtained by this didn't produce anything which
contradicts known lower bounds, but it improves quite a few known upper
bounds in Agrell's and Brouwer's tables (modulo the fact that the MIP
solvers are based on floating point LP solvers and thus don't give
proven results.)


The LP solver used should give exact results and not have any floating
point problems. See http://trac.sagemath.org/ticket/12533


So I seriously doubt that the isinteger=True is based on a valid
mathematical theorem, or is there some extension of Delsarte's Theorem
which allows to assume that the distance distribution in an optimal code
consists of integers?
-- Peter Mueller



I am not sure why there would be improvements to the tables. Someone
would have noticed such improvements earlier, right? The result obtaind
from allowing isinteger=True should be an upper bound to the actual
maximization problem. This is because putting isinteger=True imposes
more constraints on the variables (the distance distribution) and so the
result obtained from setting this to true should be at least as large as
the result obtained from setting this to false (since the constraint
space is larger in the latter case).

Can you perhaps give an example where setting isinteger=True gives a
bigger number than when setting isinteger=False?


Sorry, my question was (obviously) the opposite - when does 
isinteger=True give a *smaller* number compared to isinteger=False.



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Possible problem in delsarte_bound_hamming_space

2013-12-15 Thread P Purkayastha

On 12/15/2013 08:10 PM, Peter Mueller wrote:

I think isinteger probably makes sense for the
delsarte_bound_additive_hamming_space() function.

Of course it does. But this function is dedicated to codes which are
abelian groups, so the weight distribution coincides with the distance
distribution. I didn't say that I have concerns with this function.


Well, what I meant is exactly what you stated in your mail below - that 
the usual delsarte_bound should not contain the isinteger keyword. Maybe 
Dima has some input on it. (CC'd)



The LP solver used should give exact results and not have any floating
point problems. See http://trac.sagemath.org/ticket/12533
http://trac.sagemath.org/ticket/12533

  As far as I know, PPL is the only exact LP solver which Sage uses.
However, this backend doesn't have an IP solver. I see that the stand
alone solver glpsol  has the option --exact, but I do not know if this
is used in IP problems. And I do not know if Sage can use this in its
GLPK backend. As you apparently know more about the Sage capabilities to
exactly solve IP problems, it would be nice if you share your knowledge
here.


The PPL backend does not work with integer variables. The GLPK backend 
does. You can look at the documentation of the ppl backend, though I 
guess you already know this:

http://www.sagemath.org/doc/reference/numerical/sage/numerical/backends/ppl_backend.html


I am not sure why there would be improvements to the tables. Someone
would have noticed such improvements earlier, right?

What's that supposed to mean?


There has been quite a bit of work earlier on determining these bounds. 
I would be surprised if we started getting improved results for such 
low numbers as you have stated below.


 Here is an example: Let A(n,d) be the

largest size of a binary code of length n and minimal distance =d. The
best know upper bound according to Agrell's table
http://webfiles.portal.chalmers.se/s2/research/kit/bounds/unr.html for
A(17,3) is 6552, while delsarte_bound_hamming_space(17, 3, 2
,isinteger=True, solver=glpk) gives the *better* bound 6464! There are
many more examples like this.


I think there might be something funny going on with the GLPK backend.
This should hold true: A(17, 3) = A(18, 4), so let's compare the two.

sage: delsarte_bound_hamming_space(18, 4, 2, True, solver=GLPK)
6532.0
sage: delsarte_bound_hamming_space(17, 3, 2, True, solver=GLPK)
6464.0

These two are really very different results. Now, let us compare the 
values when isinteger is set to false.


sage: delsarte_bound_hamming_space(18, 4, 2, False, solver=glpk)
6553.6002
sage: delsarte_bound_hamming_space(17, 3, 2, False, solver=glpk)
6553.59985

That's pretty close, and it compares well with the PPL backend:

sage: delsarte_bound_hamming_space(18, 4, 2, False, solver=PPL).n()
6553.600
sage: delsarte_bound_hamming_space(17, 3, 2, False, solver=PPL).n()
6553.600




[...] Sorry, my question was (obviously) the opposite - when does
isinteger=True give a *smaller* number compared to isinteger=False.

In many cases! If that were not the case, there would be no point
offering the slow isinteger=True option at all. And indeed, for additive
codes it is nice to have these stronger bounds, even if they are only
correct up to numerical issues.

What I tried to say in my initial message was that I believe that for
non-additive codes, the option isinteger=True internally makes the
mathematically unjustified assumption that the distance distribution
consists of integers, or that the Delsarte inequalities do hold also for
the weight distribution. So if this function uses a false assumption,
this option should be removed.

-- Peter Mueller


--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Possible problem in delsarte_bound_hamming_space

2013-12-14 Thread P Purkayastha

On 12/15/2013 06:46 AM, Peter Mueller wrote:

The function delsarte_bound_hamming_space(n, d, q, isinteger=False,
return_data=False, solver='PPL') offers the option isinteger=True. As
the doc doesn't tell it, I got a little curious what is assumed to be
integral. Looking at the implementation it turns out that the distance
distribution is assumed to consist of integers. However, for non-linear
codes these numbers rarely are integral!


I think isinteger probably makes sense for the 
delsarte_bound_additive_hamming_space() function.



Checking the bounds obtained by this didn't produce anything which
contradicts known lower bounds, but it improves quite a few known upper
bounds in Agrell's and Brouwer's tables (modulo the fact that the MIP
solvers are based on floating point LP solvers and thus don't give
proven results.)


The LP solver used should give exact results and not have any floating 
point problems. See http://trac.sagemath.org/ticket/12533



So I seriously doubt that the isinteger=True is based on a valid
mathematical theorem, or is there some extension of Delsarte's Theorem
which allows to assume that the distance distribution in an optimal code
consists of integers?
-- Peter Mueller



I am not sure why there would be improvements to the tables. Someone 
would have noticed such improvements earlier, right? The result obtaind 
from allowing isinteger=True should be an upper bound to the actual 
maximization problem. This is because putting isinteger=True imposes 
more constraints on the variables (the distance distribution) and so the 
result obtained from setting this to true should be at least as large as 
the result obtained from setting this to false (since the constraint 
space is larger in the latter case).


Can you perhaps give an example where setting isinteger=True gives a 
bigger number than when setting isinteger=False?


 basu.

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Polynomial question.

2013-12-11 Thread P Purkayastha

On 12/11/2013 08:40 PM, Thierry Dumont wrote:

Hello, all,

I am going to manipulate Legendre (P) polynomials.
So I do something like this:

sage: P.x=QQ[]

sage: #generate de first Lagrange polynomial
sage: s=[legendre_P(i,x) for i in [0..2]]
sage: print s
[1, x, 3/2*x^2 - 1/2]

sage: #now, look at the parents
sage: s[0].parent()
Integer Ring
sage: s[1].parent()
Univariate Polynomial Ring in x over Rational Field

Ok, this is correct, and seems nice; but I want to evaluate these
polynomials for  different values of x, and you cannot evaluate a member
of Integer Ring at say, x=1/21... So I need to compute the parent of
polynomials (which possibly are scalars)  in all my functions, make test
and so on

I have found a work-around:
sage:  s=[P(legendre_P(i,x)) for i in [0..2]]

Then, I get:

sage: s[0].parent()
Univariate Polynomial Ring in x over Rational Field

Ok, but is there some other way to do this?

Yours
t.



IMHO, this should be treated as a bug.

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: how to format replies on ask.sagemath.org

2013-12-11 Thread P Purkayastha

On 12/11/2013 11:33 PM, John Cremona wrote:

My answers to questions on ask.sagemath.org would possibly be more
helpful if I could work out how to type stuff into the box so that it
ends up looking reasonable.  It's not wiki markup -- what is it?
Where is it explained?  Could there be an faq about it?

Please don't answer just by saying it's just the same as xxx or yyy
since I maybe don't know how they work either.  A link to a page
explaining the markup wold be useful!  I have already tried using the
preformatted text or blockquote buttons.  So far
http://ask.sagemath.org/question/3302/how-to-get-frobenius_element-in-numberfield?answer=4419#4419
is my best effort.

John Cremona



That uses markdown syntax:
http://daringfireball.net/projects/markdown/syntax

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Not rebooting notebook server constantly leaves too many notebooks active?

2013-11-26 Thread P Purkayastha

On 11/26/2013 04:59 PM, Vincent Knight wrote:

Thanks P,

I have that setup as you suggested but I'm not entirely sure the sage
users are being limited (I seemed to be able to go over the limit):

Running:

import os
os.system('ulimit')

in the notebook returns:

unlimited
0

Assuming the username running Sage is 'vince' (it's not but I'm not sure
what info is safe to put out there) I have typed (just copying what you
had, at the top of the sage file just after comments about the license):

if [ ${vince/sage} != $vince ]; then
 # put a limit per user of 1.5G; you can change the other limits too.
 # 3D plots might need more than 1G iirc, otherwise for light
 # computation 1-1.2G should be ok.
 ulimit -u 100 -t 3600 -v 150
fi


Oh no! $USER is an environment variable. When you use server_pool, your 
ssh command is logging in as sage_ where _ is a number between 0 and 99. 
Depending on the number being used, USER will automatically take that 
value. Use the if line exactly as I have written and it will work 
fine. :-)


basu.

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Not rebooting notebook server constantly leaves too many notebooks active?

2013-11-25 Thread P Purkayastha

On 11/25/2013 09:36 PM, Vince wrote:

Apologies for bringing up an old question (very neat how the google
group pointed me to it before I asked my question). We have a sage
server that has been hanging a bit recently and I had to restart it for
the first time today (completely unresponsive until I did at which point
it was good as new). Has the command changed and it is now: timeout?
I.e. starting a server with below will timeout after 1200 seconds (20
minutes).

notebook(interface='localhost',
directory='./sage_notebook.sagenb',port=8000, accounts=True,
timeout=1200, server_pool=['sage%d@localhost'%i for i in range(100)],
ulimit='-u 100 -t 36000 -v 50', open_viewer=None)

I'm also pasting the whole command in there just in case there's
anything else we're doing that might not be quite right...


I suggest setting the ulimit from the terminal before starting sage. The 
ulimit command from inside the notebook() command doesn't work. See

http://trac.sagemath.org/ticket/11939

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Not rebooting notebook server constantly leaves too many notebooks active?

2013-11-25 Thread P Purkayastha

On 11/26/2013 02:04 AM, Vincent Knight wrote:

Thanks P,

That's very useful (it probably explains the problems we were having).
Just to clarify (before I restart our server again as I have quite a few
active users on right now), would the following in a bash script do the job:

ulimit -u 100 -t 36000 -v 50
sage notebook(interface='localhost',
directory='./sage_notebook.sagenb',port=8000, accounts=True,
timeout=1200, server_pool=['sage%d@localhost'%i for i in range(100)],
open_viewer=None)


This puts an overall limit on the parent sage process. Since you are 
running using a server pool, the way I typically run the server is put a 
limit on every child sage process. This needs something like the 
following at the top of the SAGE_ROOT/sage file:


# Adapting to your username
if [ ${USER/sage} != $USER ]; then
# put a limit per user of 1.5G; you can change the other limits too.
# 3D plots might need more than 1G iirc, otherwise for light
# computation 1-1.2G should be ok.
ulimit -u 100 -t 3600 -v 150
fi



Also, what is a reasonable limit on the memory, could I get away with
25? I realise that this is asking how long a piece of string is but
just checking what is a reasonable limit for student day to day use.



If I recall correctly, every new user takes up another 800M or so of 
virtual memory. So, a 4G system is a bit low if you want to have a 
couple of users. If you have 100 users, then 8G is definitely too low. 
You will need at least 20-25G of memory to run the server properly.



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Tensor products of vector spaces

2013-11-15 Thread P Purkayastha
Is there some way to take tensor products of vector spaces in Sage? I have 
been looking through the sources and I don't see anything similar. There is 
a very old message from 2009 where the command tensor_product is 
discussed, but this doesn't seem to exist in Sage any more (or maybe it was 
never merged from combinat): 
https://groups.google.com/forum/#!topic/sage-combinat-devel/8Vszh4PHDjM

Is there some other way to take the tensor product of vector spaces?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Installation of Sage in Linux

2013-10-24 Thread P Purkayastha

On 10/24/2013 03:41 PM, Eileen Ee wrote:

Hi,

In the midst of my Sage installation, it paused and showed Input archive name or . to quit pax. I keyed 
in . and it continued to process. At the end of the installation, it showed build succeeded and 
Build finished.

Can I confirm that my Sage installation is complete and has succeeded based on 
the completion messages above?

I googled about this problem and found that people who keyed in . usually 
cannot complete the installation as there were some problems with quitting pax.

But mine had no problem with quitting pax, so I would like to make sure that my 
Sage installation is complete and has succeeded.

Thanks,
Eileen.



Run a make ptestlong and if it completes without error, then your sage 
is probably fine.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: (unknown)

2013-10-23 Thread P Purkayastha

Exists in Sage:

sage: I6 = IntegerModRing(6)
sage: M = random_matrix(I6, 4, 4)
sage: v = random_vector(I6, 4)
sage: M \ v
(4, 0, 2, 1)


On 10/23/2013 09:11 PM, Juan Grados wrote:

Exists in python, any instruction to solve a linear system equations
module n (integer). In mathematica for example If exists
http://mathematica.stackexchange.com/questions/31696/solving-a-system-of-linear-equations-modulo-n.

thanks

--
-
MSc.Juan del Carmen Grados Vásquez
Laboratório Nacional de Computação Científica
Tel: +55 24 2233-6260 tel:%2B55%2024%202233-6260
(http://www.lncc.br/)
http://juaninf.blogspot.com
-

--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: __mod__ is not consistent between integers and reals

2013-10-15 Thread P Purkayastha

On 10/16/2013 12:45 AM, kcrisman wrote:

sage: 5 % 3
2
sage: 5. % 3.
-1.00


I view this as a problem - was trying to construct the Weierstrass
function for my students

http://sagecell.sagemath.org/?q=mufyfu

and it wouldn't plot right until I changed %2 to %2., but now I get
this.  Or is there some mathematical reason to be inconsistent here?
  It's not a bug, it works as documented...


Why do you say it is working as documented? It looks like a bug to me. 
FYI, you can work with RDF - the behavior is same as the integer case.


sage: aa = RDF(5.0)
sage: aa % 3
2



 luckily, I knew where the

documentation would hide for this!  Others might not.

 def __mod__(left, right):
 
 Return the value of ``left - n*right``, rounded according to the
 rounding mode of the parent, where ``n`` is the integer quotient of
 ``x`` divided by ``y``. The integer ``n`` is rounded toward the
 nearest integer (ties rounded to even).

--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: cloud.sagemath hiding code

2013-09-29 Thread P Purkayastha

On 09/29/2013 12:23 PM, William Stein wrote:

On Sat, Sep 28, 2013 at 9:07 PM, Narlin Beaty drdru...@gmail.com wrote:

I have a cloud.sagemath.com sagews file with 175 lines and i can tell from the 
output that it is working OK.
Lines 76 thru 175 are not displaying and i haven't  found a magic button to 
redisplay them.
i have played with the button Toggle display of output of selected files.  
But thus far to no avail.
Help please.
narlin


If they are input, just double click on the output to toggle display
of the input (and hence show your code again).  I've been planning to
add a button somewhere that does the same thing, but haven't figured
out where to put it (suggestions?).


► a solid triangle on the left of a cell?


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Latex in interact?

2013-09-12 Thread P Purkayastha

On 09/12/2013 10:14 PM, Jotace wrote:

Hi all,

I'm trying to do an interact to illustrate the curvature of a curve
given by y=f(x).
Here is the code, but at the end I cannot properly show the function
k(x). What's wrong? What should I do?


var('x')
f(x)=x^4-2*x^2
@interact
def  _(f=input_box(x^4-2*x^2, width=15, label=$f(x)=$),a=input_box(-2,
width=5, label=$a=$),b=input_box(2, width=5, label=$b=$)):
 Cf=plot(f,x,-2,2,color='blue', thickness=3)
 k(x)=abs(diff(f,x,2))/(1+(diff(f,x,1))^2)^(3/2)
 Ck=plot(k,x,-2,2,color='red', thickness=3)
 show(Cf+Ck,figsize=6)
 html('La fonction de courbure est', latex(k))


Thanks!

JC


Try pretty_print instead of html:

pretty_print('La fonction de courbure est', latex(k))



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Sage and Automatic Control

2013-09-11 Thread P Purkayastha

On 09/11/2013 03:38 PM, David Joyner wrote:

Cross posting

On Wednesday, September 11, 2013, wrote:

Sage can be used to automatic control arguments? Ie root locus,
diagrams bode, controllability observability matrices etc.. etc..


Ale



I don't know what you mean but sage-support is a better place to post
this question I think.


Control Theory material is not really implemented in Sage. Things like 
Laplace transforms can be performed, complex plots are possible, etc. 
But beyond that you will probably have to code everything yourself. I am 
not sure if matrix differential equations can be solved in Sage. Other 
than that, I suppose the basic math concepts are already implemented and 
present - they just need to be put together and presented in a more 
accessible way so that Control Theory can be done.


basu.


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Trouble saving graphics

2013-09-07 Thread P Purkayastha
It seems saving to pdf is broken on sage-5.10 onwards. Works till 
sage-5.9. The problem is only in graphs. Normal plots work fine.


I have opened http://trac.sagemath.org/ticket/15173 to track this.

On 09/07/2013 09:06 PM, Ed Scheinerman wrote:

I'm using Sage 5.11 on a Mac

I've been used to creating graphs and then saving them as PDF's for
inclusion in papers. Using code like this:

sage: g = graphs.PetersenGraph()
sage: pic = g.plot()
sage: pic.save('pete.pdf')

But now it just throws a bunch of errors:

---
AssertionErrorTraceback (most recent call last)
ipython-input-56-d63f9d409a56 in module()
 1 pic.save('pete.pdf')

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/sage/misc/decorators.pyc
in wrapper(*args, **kwds)
 456 kwds[self.name + options] = suboptions
 457
-- 458 return func(*args, **kwds)
 459
 460 #Add the options specified by @options to the signature
of the wrapped

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
in save(self, filename, **kwds)
2753 figure.savefig(filename, dpi=dpi,
bbox_inches='tight',
2754 bbox_extra_artists=self._bbox_extra_artists,
- 2755 transparent=transparent)
2756 else:
2757 figure.savefig(filename, dpi=dpi,

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/figure.pyc
in savefig(self, *args, **kwargs)
1368 kwargs.setdefault('edgecolor',
rcParams['savefig.edgecolor'])
1369
- 1370 self.canvas.print_figure(*args, **kwargs)
1371
1372 if transparent:

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc
in print_figure(self, filename, dpi, facecolor, edgecolor, orientation,
format, **kwargs)
2053 orientation=orientation,
2054 dryrun=True,
- 2055 **kwargs)
2056 renderer = self.figure._cachedRenderer
2057 bbox_inches = self.figure.get_tightbbox(renderer)

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc
in print_pdf(self, *args, **kwargs)
1846 from backends.backend_pdf import FigureCanvasPdf # lazy
import
1847 pdf = self.switch_backends(FigureCanvasPdf)
- 1848 return pdf.print_pdf(*args, **kwargs)
1849
1850 def print_pgf(self, *args, **kwargs):

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py
in print_pdf(self, filename, **kwargs)
2299  width, height,
image_dpi, RendererPdf(file, image_dpi),
2300
  bbox_inches_restore=_bbox_inches_restore)
- 2301 self.figure.draw(renderer)
2302 renderer.finalize()
2303 finally:

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
  52 def draw_wrapper(artist, renderer, *args, **kwargs):
  53 before(artist, renderer)
--- 54 draw(artist, renderer, *args, **kwargs)
  55 after(artist, renderer)
  56

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/figure.pyc
in draw(self, renderer)
1004 dsu.sort(key=itemgetter(0))
1005 for zorder, a, func, args in dsu:
- 1006 func(*args)
1007
1008 renderer.close_group('figure')

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
  52 def draw_wrapper(artist, renderer, *args, **kwargs):
  53 before(artist, renderer)
--- 54 draw(artist, renderer, *args, **kwargs)
  55 after(artist, renderer)
  56

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/axes.pyc
in draw(self, renderer, inframe)
2084
2085 for zorder, a in dsu:
- 2086 a.draw(renderer)
2087
2088 renderer.close_group('axes')

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
  52 def draw_wrapper(artist, renderer, *args, **kwargs):
  53 before(artist, renderer)
--- 54 draw(artist, renderer, *args, **kwargs)
  55 after(artist, renderer)
  56

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/collections.pyc
in draw(self, renderer)
 693 (np.sqrt(x) * self.figure.dpi / 72.0))
 694 for x in self._sizes]
-- 695 return Collection.draw(self, renderer)
 696
 697 class PolyCollection(Collection):


[sage-support] Re: Save session IOError: [Errno 2]

2013-08-09 Thread P Purkayastha

On 08/09/2013 09:53 PM, Stan Schymanski wrote:

I just stumbled over your post as I experienced the same error. There is
actually a ticket for it here: http://trac.sagemath.org/ticket/9805

It looks like a 5 minutes-job for someone familiar with creating
patches, but unfortunately, nobody has touched it for 3 years now...
Pity!

Cheers
Stan


There's a reason why it has not been fixed - the directory it writes to 
is not a constant. It differs by account name, and by worksheet - I 
don't see a way to get these at runtime. Although it gives an error, it 
does save the object into the directory corresponding to the cell.


A workaround is to save it by yourself in the data directory by using

save_session(DATA + 'sage_session.sobj')

At least for now, you will get an error message but the session will be 
saved alright.






On Tuesday, December 25, 2012 10:04:09 AM UTC+1, dann wrote:

Hi!

When i try to evolute code

a='qweqweq'
save_session('tst')

i get an error

Traceback (most recent call last):
   File stdin, line 1, in module
   File _sage_input_2.py, line 10, in module
 exec compile(u'open(___code___.py,w).write(# -*- coding:
utf-8 -*-\\n +

_support_.preparse_worksheet_cell(base64.b64decode(YT0ncXdlcXdlcScKc2F2ZV9zZXNzaW9uKCd0c3QnKQ==),globals())+\\n);
execfile(os.path.abspath(___code___.py))
   File , line 1, in module

   File /tmp/tmpLfbw46/___code___.py, line 3, in module
 exec compile(usave_session('tst') + '\n', '', 'single')
   File , line 1, in module

   File session.pyx, line 304, in sage.misc.session.save_session
(sage/misc/session.c:1710)
   File sage_object.pyx, line 863, in
sage.structure.sage_object.save (sage/structure/sage_object.c:9575)
IOError: [Errno 2] No such file or directory: '../../data/tst.sobj'
tst.sobj

What's the problem?
Thanks

--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.





--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Partial Fraction Expansion for Polynomials with complex factors

2013-08-01 Thread P Purkayastha
If the factors are complex conjugates then it is already in partial 
fraction form.

On Thursday, August 1, 2013 1:50:32 PM UTC+8, Rakhi Warriar wrote:

 I have the following function:

 f(x) = 1
  
  x^2 + 4*x + 13

 I need to find its partial fraction expansion. As the factors are complex 
 conjugates, I am not able to do using partial_fraction(). How can I find 
 this?

 Commands:
 x = CC['x'].0
 f = 1/(x^2 + 4*x+ 13)
 f.partial_fraction()
 this gives error:
 Traceback (click to the left of this block for traceback)
 ...
 AttributeError: 'FractionFieldElement_1poly_field' object has no
 attribute 'partial_fraction'

 System used: Ubuntu 12.04, 32 bit, Intel Core i5 procesor


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: width of lines in plot legend

2013-07-28 Thread P Purkayastha
It's not possible from sage. It is possible in matplotlib. You will need to 
get the lines from the legend using your_legend.get_lines(), which returns 
a list of line2d objects. See

http://matplotlib.org/api/legend_api.html#matplotlib.legend.Legend.get_lines

After you have extracted the lines, you can change the linewidth of a line 
by using something like
your_line.set_linewidth(some float)

On Sunday, July 28, 2013 3:02:38 AM UTC+8, davidp wrote:

 Is there a way to increase the linewidth of lines appearing in the legend 
 of a plot without changing the linewidth in the plot, itself?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: The bug in integrate function.

2013-07-22 Thread P Purkayastha
The code you provided does work. Maybe you inserted your method in the 
wrong place, or you have made other modifications to the sage library. 
Either way, apparently ticket http://trac.sagemath.org/ticket/14915 got 
created the last time I tried to create it, so this bug will be tracked 
there.

On Tuesday, July 23, 2013 12:19:27 AM UTC+8, Андрей Ширшов wrote:

 Hello!
 I use Sage Version 5.10, Release Date: 2013-06-17
 OS: Linux Mint 15 Cinnamon
 Installation method: I downloaded sage archive from Yandex mirror, 
 unpacked archive and then typed 'sage' in my terminal.
 I found the bug in integrate function:

 integrate(sin(x), x, 0.5, 5, algorithm='sympy')
 Traceback (click to the left of this block for traceback)
 ...
 AttributeError: 'module' object has no attribute 'symplify'

 I tried to modified the source code (please see 
 http://ask.sagemath.org/question/2835/error-while-integrate-using-algorithmsympy-bug)
  
 but when I typed 'sage -br' in my terminal, there are many mistakes(((
 At the end of all I added my own class in my Sage Notebook:

 class sf():
 def __init__(self, x):
 self._x = x
 
 def _sympy_(self):
 import sympy
 return(sympy.simplify(self._x))
 
 def __repr__(self):
 return(str(self._x))

 And I used integrate function as follows:

 integrate(sin(x), x, sf(0.5), sf(5), algorithm='sympy')

 It was helped to me, but all I want is that the bug I found will be fixed.
 Thanks.
 Sinersly yours, Andrei Shirshov.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: My local sage now asks for a user name and password, what to do?

2013-07-19 Thread P Purkayastha

On 07/18/2013 08:02 PM, jean delcourt wrote:

Same problem, and the solution of William does'nt work; when I open a
console window, one ask me login and password, 'sage' and 'sage' are not
accepted.
I have had no problem with ancient version of Virtual Machine and Sage...
(excuse my poor English), jean


If you are using the Virtual machine, then the notebook should start 
automatically in the browser. If you want to change the password or 
reset the password you can do it from the browser interface. If you want 
to do it from the console interface, then follow the instructions here 
to login as root and then start/stop the notebook manually:

http://wiki.sagemath.org/SageAppliance#Advanced_Options


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: How to view the new Trac as non-developer?

2013-07-19 Thread P Purkayastha

On 07/19/2013 02:53 PM, Rolandb wrote:

Hi,

Since mid 2007 I use Sage and often I look at Trac to learn about new
and handy routines / tricks. But Trac has changed
(http://trac.sagemath.org/report/33) :(

How can non-developers (as me) view the new Trac?

Roland


Are you asking whether it is viewable without login? It works for me 
even if I am not logged in. Another option for you would be to follow 
the google groups for the discussion (though patches are not visible there):


https://groups.google.com/forum/?hl=en#!forum/sage-trac


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Trouble with easy_install

2013-07-16 Thread P Purkayastha

On 07/16/2013 05:35 PM, Viviane Pons wrote:

Hi everyone,

I have installed sage-5.11-beta3 and for some reason, I cannot use use
easy_install anymore on the sage shell. It seems to be a problem with
https. When I do sage -sh and then easy_install -U mysql-python (for
example), I get this:

Reading http://pypi.python.org/simple/mysql-python/
Download error: unknown url type: https -- Some packages may not be found!

I don't remember if I had this error before. But I'm sure I was able to
install this package with easy_install on previous sage versions. Did
anyone have some similar issues?

Thank's a lot

Viviane



Make sure you have support for SSL installed. The details are present in 
the SSL section of the README.txt file in the Sage directory.



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: LDAP (again...) on version 5.10.

2013-07-05 Thread P Purkayastha

On 07/05/2013 06:58 PM, Dima Pasechnik wrote:

On 2013-07-04, P Purkayastha ppu...@gmail.com wrote:

--047d7b15a873f4617e04e0b0944a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Does only python-ldap work, or is there any other package needed (in the
system, for example)? Also, can you give some feedback on whether you have
been able to make LDAP actually work?

(pyhton)-openssl, it seems, is necessary to make easy_install working.


Thanks. I will add something to the README with this information.

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: LDAP (again...) on version 5.10.

2013-07-04 Thread P Purkayastha
Does only python-ldap work, or is there any other package needed (in the
system, for example)? Also, can you give some feedback on whether you have
been able to make LDAP actually work?

Thanks!
  basu.

On Thu, Jul 4, 2013 at 10:31 PM, Olalékan ABOU BAKAR amp...@gmail.comwrote:

 Confirmed.. It works!

 I didn't think an easy_install will work from sage shell but it did! Just
 install the development headers and you're good.
 Restart the nootebook server.. You will the LDAP UI under Settings 
 Notebook Settings.



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: math processing error in Sage-5.10 documentation

2013-07-03 Thread P Purkayastha
Can you try the following commands from the root of your sage 
installation (where the main sage script is present):


make doc-clean
make doc-html-mathjax


On 07/03/2013 02:34 PM, Kevin Halasz wrote:

hmm. This is quite perplexing. My browser was already rendering math as
HTML-CCS. I may be wrong, but it seems as though, as these documents are
auto-generated by Sphinx, the problem is not with anything in my sage
directory, but rather with Sphinx. If this is wrong, please let me know.
I'm going to explore Sphinx and how it is used in Sage, but if you or
anybody else has knowledge either of how Sphinx works or how it
interacts with Sage, and is capable of pointing me in the right
direction, or seeing a clear solution to the problem, I would be very
grateful.

Anyway, P Purkayastha, thanks for the helpful ideas you've given me so
far. All advice is greatly appreciated.


On Tuesday, July 2, 2013 12:29:32 AM UTC-7, Kevin Halasz wrote:

I built Sage from source in virtual machine running ubuntu 12.04 LTS.

When I try to build the reference manual and look at it, I get a
[Math Processing Error] everywhere that there should be text
formatted in tex math mode. I've tried doing a hard refresh (see

http://meta.math.stackexchange.com/questions/3627/why-is-math-processing-error-all-over-the-place-today

http://meta.math.stackexchange.com/questions/3627/why-is-math-processing-error-all-over-the-place-today)
to no avail.

I have noticed that a message flashes briefly on the bottom of the
screen as the documentation loads. It says:

  File failed to load:

file:///home/khalasz/sage-5.10/devel/sage-main/doc/output/html/en/reference/groups/_static/fonts/HTML-CSS/TeX/png/imagedata.js

I have looked, and noticed that no such file exists in my sage
directory.

I have tried the commands (from the directory ~/sage/devel/sage)

(1) ../../sage -docbuild --mathjax reference html
 ../../sage -docbuild --jsmath reference html
 ../../sage -docbuild -j reference html

all of which gave output that implied nothing was wrong

(2)  ../../sage -docbuild reference latex

the last three lines of output here were :
[reference] writing... done
[reference] copying TeX support files... done
[reference] build succeeded, 11 warnings.
the warnings worried me, but scrolling through the rest of the
output, it seemed that none of them were related to
.../reference/groups/_static

(3) ../../sage -docbuild
reference/groups/_static/fonts/HTML-CSS/TeX/png latex

which gave the output
[png  ] Error: Source directory doesn't contain conf.py file.
which I can't make sense of, as I found several files named conf.py
in the Sage-5.10 folder.

Any ideas about what could be wrong here would be much appreciated


--
You received this message because you are subscribed to a topic in the
Google Groups sage-support group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sage-support/do7WnJ3fScY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: LDAP (again...) on version 5.10.

2013-07-03 Thread P Purkayastha
I think you need to install python-ldap in order to see any UI. I have
opened https://github.com/sagemath/sagenb/issues/177 to track this.


On Wed, Jul 3, 2013 at 7:31 PM, Jori Mantysalo jori.mantys...@uta.fiwrote:

 On Tue, 2 Jul 2013, P Purkayastha wrote:

  If you mean enabling LDAP in sage, then you should try out the sagenb spkg
 from 
 http://trac.sagemath.org/sage_**trac/ticket/14330http://trac.sagemath.org/sage_trac/ticket/14330


 Thank you. I installed it by sage -i. But what now? After logging in as
 admin I don't see settings for ldap. Sage -b? Modifying some -py -file?

 Three weeks ago somebody has written Is there any documentation on LDAP
 functionality available, and/or any UI? How can a user find it? as a
 comment to trac entry. At least I am not only one wondering this.

 --
 Jori Mäntysalo

 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit https://groups.google.com/d/**
 topic/sage-support/NlfiJt-**OTpU/unsubscribehttps://groups.google.com/d/topic/sage-support/NlfiJt-OTpU/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscribe@**googlegroups.comsage-support%2bunsubscr...@googlegroups.com
 .
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at 
 http://groups.google.com/**group/sage-supporthttp://groups.google.com/group/sage-support
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: LDAP (again...) on version 5.10.

2013-07-02 Thread P Purkayastha
If you mean enabling LDAP in sage, then you should try out the sagenb spkg 
from http://trac.sagemath.org/sage_trac/ticket/14330

On Tuesday, July 2, 2013 8:41:57 PM UTC+8, jori.ma...@uta.fi wrote:

 Is there any step-by-step -manual for joining LDAP and Sage 5.10, or 
 should I just try to modify instructions given for older versions? 

 -- 
 Jori M�ntysalo 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: math processing error in Sage-5.10 documentation

2013-07-02 Thread P Purkayastha
You should ensure that nothing is blocking javascript in the notebook. In 
particular, the browser needs to be able to run mathjax in order to show 
the rendered math.

On Tuesday, July 2, 2013 3:29:32 PM UTC+8, Kevin Halasz wrote:

 I built Sage from source in virtual machine running ubuntu 12.04 LTS.

 When I try to build the reference manual and look at it, I get a [Math 
 Processing Error] everywhere that there should be text formatted in tex 
 math mode. I've tried doing a hard refresh (see 
 http://meta.math.stackexchange.com/questions/3627/why-is-math-processing-error-all-over-the-place-today)
  
 to no avail.

 I have noticed that a message flashes briefly on the bottom of the screen 
 as the documentation loads. It says:

  File failed to load: 
 file:///home/khalasz/sage-5.10/devel/sage-main/doc/output/html/en/reference/groups/_static/fonts/HTML-CSS/TeX/png/imagedata.js

 I have looked, and noticed that no such file exists in my sage directory. 

 I have tried the commands (from the directory ~/sage/devel/sage)

 (1) ../../sage -docbuild --mathjax reference html
 ../../sage -docbuild --jsmath reference html
 ../../sage -docbuild -j reference html

 all of which gave output that implied nothing was wrong

 (2)  ../../sage -docbuild reference latex

 the last three lines of output here were :
 [reference] writing... done
 [reference] copying TeX support files... done
 [reference] build succeeded, 11 warnings.
 the warnings worried me, but scrolling through the rest of the output, it 
 seemed that none of them were related to .../reference/groups/_static

 (3) ../../sage -docbuild reference/groups/_static/fonts/HTML-CSS/TeX/png 
 latex

 which gave the output
 [png  ] Error: Source directory doesn't contain conf.py file.
 which I can't make sense of, as I found several files named conf.py in the 
 Sage-5.10 folder.

 Any ideas about what could be wrong here would be much appreciated




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: math processing error in Sage-5.10 documentation

2013-07-02 Thread P Purkayastha
Maybe you can check what are the settings for mathjax in your browser. 
Sage doesn't use png fonts by default and in fact the png fonts are not 
shipped with the mathjax in Sage. It uses HTML+CSS by default. I don't 
understand why it is defaulting to png in your case.


Maybe go to mathjax.org, right click on the math on top right and change 
the renderer to HTML+CSS. Ideally, changing the preferences there 
shouldn't affect what is used on the notebook, but it is worth giving a try.


On 07/03/2013 01:01 PM, Kevin Halasz wrote:

mathjax works for most webpages in the same browser (Firefox 21.0), as
well as all of the sage documentation in 5.2 and 4.8.

I think the problem is that the
file 
///home/khalasz/sage-5.10/devel/sage-main/doc/output/html/en/reference/groups/_static/fonts/HTML-CSS/TeX/png/imagedata.js
is missing. Is there some way to acquire it? I ran make ptest again
overnight/today, to see if that would alleviate the problem. The final
line of output from this command was:

make: *** [ptest] Error 4

I'm not sure what to make of this. Regardless, I again tried to build
documentation after this, and still had the same problem.

On Tuesday, July 2, 2013 12:29:32 AM UTC-7, Kevin Halasz wrote:

I built Sage from source in virtual machine running ubuntu 12.04 LTS.

When I try to build the reference manual and look at it, I get a
[Math Processing Error] everywhere that there should be text
formatted in tex math mode. I've tried doing a hard refresh (see

http://meta.math.stackexchange.com/questions/3627/why-is-math-processing-error-all-over-the-place-today

http://meta.math.stackexchange.com/questions/3627/why-is-math-processing-error-all-over-the-place-today)
to no avail.

I have noticed that a message flashes briefly on the bottom of the
screen as the documentation loads. It says:

  File failed to load:

file:///home/khalasz/sage-5.10/devel/sage-main/doc/output/html/en/reference/groups/_static/fonts/HTML-CSS/TeX/png/imagedata.js

I have looked, and noticed that no such file exists in my sage
directory.

I have tried the commands (from the directory ~/sage/devel/sage)

(1) ../../sage -docbuild --mathjax reference html
 ../../sage -docbuild --jsmath reference html
 ../../sage -docbuild -j reference html

all of which gave output that implied nothing was wrong

(2)  ../../sage -docbuild reference latex

the last three lines of output here were :
[reference] writing... done
[reference] copying TeX support files... done
[reference] build succeeded, 11 warnings.
the warnings worried me, but scrolling through the rest of the
output, it seemed that none of them were related to
.../reference/groups/_static

(3) ../../sage -docbuild
reference/groups/_static/fonts/HTML-CSS/TeX/png latex

which gave the output
[png  ] Error: Source directory doesn't contain conf.py file.
which I can't make sense of, as I found several files named conf.py
in the Sage-5.10 folder.

Any ideas about what could be wrong here would be much appreciated


--
You received this message because you are subscribed to a topic in the
Google Groups sage-support group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sage-support/do7WnJ3fScY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: 3d plotting (iced-tea plugin)

2013-06-25 Thread P Purkayastha
The jmol is known to work reliably only with the oracle-java plugin. I 
don't even know if it is tested against icedtea.

On Tuesday, June 25, 2013 6:39:12 AM UTC+8, Luis Finotti wrote:

 Dear all,

 I have been having problems with 3d plotting on the notebook.  (It works 
 OK from the command line.)  It was working a couple of months ago, so I 
 assume it was caused by some update with the icedtea plugin.  I'm using 
 icedtea-7-plugin (1.4-1) from Debian unstable.

 I get a gray box, with no graph.  I can see the advanced controls (if I 
 click on the appropriate button), but no graph.  I can move it to its own 
 window, but the problem persists.

 Any ideas or suggestions?

 Thanks,

 Luis


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Can I display |implicit_plot| as a square no matter of the ranges?

2013-06-15 Thread P Purkayastha
Does aspect ratio work? Something like

implicit_plot(F, (0,1), (0,1000), aspect_ratio=1000)

On Saturday, June 15, 2013 6:13:35 PM UTC+8, Georgi Guninski wrote:

 Basically I am doing: 

 P=implicit_plot(F,(0,1),(0,1000)) 

 The result is a very thin rectangle extremely hard to interpret 
 and I want it displayed as a square or close to square. 
 P.show(figsize=[10,5]) doesn't seem to work? 

 Can I display the above example as a square plot? 

 Know that can use  x=(0,1000) and compute F(x/1000,y), 
 but this screws the labelling of x. 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Can I display |implicit_plot| as a square no matter of the ranges?

2013-06-15 Thread P Purkayastha
Depending on your plot you might have to use aspect_ratio=1/1000. You may 
also try aspect_ratio='automatic'.

On Saturday, June 15, 2013 7:16:48 PM UTC+8, P Purkayastha wrote:

 Does aspect ratio work? Something like

 implicit_plot(F, (0,1), (0,1000), aspect_ratio=1000)

 On Saturday, June 15, 2013 6:13:35 PM UTC+8, Georgi Guninski wrote:

 Basically I am doing: 

 P=implicit_plot(F,(0,1),(0,1000)) 

 The result is a very thin rectangle extremely hard to interpret 
 and I want it displayed as a square or close to square. 
 P.show(figsize=[10,5]) doesn't seem to work? 

 Can I display the above example as a square plot? 

 Know that can use  x=(0,1000) and compute F(x/1000,y), 
 but this screws the labelling of x. 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Displaying plots in inline mode for IPython notebook

2013-06-02 Thread P Purkayastha
In Sage the plots appear inline, but the plots are saved as files in a 
directory structure within the working worksheet directory. From my reading 
here:
http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html#the-notebook-format
it appears that the ipython notebook saves everything inside a single json 
file, which is probably also how one gets everything inline. I am just 
thinking out loud; not sure if this is exactly how it works - but it does 
look like it is not compatible with how the Sage plots work.

There are two possible solutions:
1. Find out how matplotlib plots are handled. They must be saved in some 
directory as png files before they are displayed in the ipython notebook. 
If you can find that directory, then give that path along with a file name 
to the Sage's plot command, like this:

plot(x).save('/path/to/directory/file.png')


2. Use Sage to plot, but at the last step, take the matplotlib Figure 
object out of sage. Then use some direct matplotlib calls to show this 
figure (I don't know exactly what they should be), like this:

p = plot(x) + plot(x^2) + list_plot(range(5))
pm = p.matplotlib(pass other options as you see fit) # This is a 
matplotlib Figure object
from matplotlib import pyplot as plt
# Some matplotlib commands which can incorporate this Figure object into 
the plt object
plt.show()


On Friday, May 31, 2013 9:41:34 PM UTC+8, Jose Guzman wrote:

 Hi everyboydy! 


 Is there any way to display Sage plots in inline mode? I've tried sage 
 ipython notebook -pylab=inline but It did not work. 


 Declaring %pylab inline does not help, for example: 

   from sage.all import* 
   t = var('t') 
   plot(sin(t), 0, 2*pi) 

 n _plot_args(self, tup, kwargs) 
  290 tup = tup[:-1] 
  291 elif len(tup) == 3: 
 -- 292 raise ValueError('third arg must be a format string') 
  293 else: 
  294 linestyle, marker, color = None, None, None 

 ValueError: third arg must be a format string 

 Thanks! 

 Jose 

 -- 
 Jose Guzman 
 http://www.ist.ac.at/~jguzman/ 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Storing user input from keyboard

2013-05-29 Thread P Purkayastha
Check this ask.sagemath question: 
http://ask.sagemath.org/question/2298/getting-user-imput-in-python-scripts

On Thursday, May 30, 2013 10:47:41 AM UTC+8, sea21 wrote:

 I would like to write a Sage program in a file, program.sage say, then 
 load it using attach /media/sf_Sage/program.sage. In the program, I would 
 like to prompt the user to key in some inputs from the keyboard and then 
 store it in some variable. Is there any Sage functionality for doing this, 
 something like scanf or getch in C programming?



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Array in Sage

2013-05-20 Thread P Purkayastha

On 05/20/2013 01:52 PM, Santanu Sarkar wrote:

Is the any way to write four dimensional array in Sage like C
int M[10][10][10][10]?  For two dimensional case I use Matrix.


How do you intend to use it? You can simply create a nested list.

sage: C = 1,2], [3]], [[3], [4]]], [[[1,2],[3]],[[3],[4
sage: C[0][1][1][0]
4


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: how to set figsize=[4,3]

2013-05-10 Thread P Purkayastha

On 05/11/2013 01:49 AM, Jose Guzman wrote:

Hi everybody!

When plotting in the sage notebook, I like using the argument figsize to
a smaller size than the default one, like here:

  p = plot(sin(x), 0, 2*pi)
  p.show(figsize=[4,3])

Is there any way to set the default figsize for notebooks? something
like editing a file as  matplotlibrc?

thanks!

Jose


Add the following to ~/.sage/init.sage

sage.plot.plot.Graphics.SHOW_OPTIONS['figsize']=[4,3]


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: plot3d using real-valued real-parameter functions but involving complex numbers as intermediates

2013-05-02 Thread P Purkayastha


On Friday, May 3, 2013 3:14:30 AM UTC+8, Gary McConnell wrote:

 hi Basu

 really sorry about this - I've just gotten around to trying this again - 
 but I am afraid I simply don't understand the most basic things of what I 
 have to do. You are right that indeed the patch file thingo seems to have 
 been created. So I went in search of these mysterious files and tried to 
 unpack the 5.8 stuff, but all it does is try to install it, which crashes 
 (please see attached screenshot) ... and obviously if I try to open the 
 .spkg thing itself inside an editor I just get utter gibberish ...


Oh. I never asked you to *install* it. I asked you to simply *unpack* it. 
Run the following command from outside your sage installation directory.

tar xvf /path/to/sage-5.8.spkg

Then you will see a sage-5.8 directory in the directory you are in.
 


 Also it has been over 20 years since I last used vi or emacs ... is there 
 a window-based OS X text editor for morons like me please? eg Can I just 
 use TextEdit? :)

 I hope I'm not depressing you with this as much as I am myself 

 Thanks again for all your kind help

 Gary


 On Sat, Apr 27, 2013 at 4:10 AM, P Purkayastha ppu...@gmail.comjavascript:
  wrote:

 On 04/26/2013 09:05 PM, Gary McConnell wrote:

 Hi

 OK I have successfully raised trac tkt 14493, but that's about it. I'm
 afraid I am so unused to this stuff that I cannot even follow the
 instructions above. I tried to download 5.8 from that link, but it
 failed to install. But I'm not even sure I was meant to install it! ie
 maybe I just need the code stored somewhere - not sure what you meant
 ... (I already have 5.7 working in this machine). I set up the file from
 step 2, and then from step 4 I changed directory to Applications/sage
 but Applications/sage/sage is a file not a directory. So I ran ./sage
 -hg qnew 14493_documentation.patch and it quietly blinked for a second
 and then gave me a new command line - apparently doing absolutely
 nothing! So when you say hack hack hack etc :) I am not sure what I am
 supposed to be hacking!!

 Sorry if this is moronic, but I'll get there eventually 


 Hello,
   No, I outlined the instructions below if you don't want to install the 
 sage source. After the step 4 ii) you will get no output. But you can check 
 that the patch file has been created by using the command

 /path/to/sage -hg qser

 Note that I wrote /path/to/sage because it is supposed to be the sage 
 script from your existing sage installation, NOT the unpacked sage-5.8 
 directory.

 By hack hack, I meant that you just carry on with the changes you want 
 to perform on the actual files. The hg will keep track of the changes. You 
 can see a diff of the changes when you run the command

 /path/to/sage -hg qdiff

 Hope that helps,
   basu.

  
 If you don't want to install the sage from source, you can download
 the sage spkg and work with that.  This is OK since you intend to do
 only documentation changes. In this case, follow the steps below:

 1. download the sage spkg from
 http://www.sagemath.org/__packages/standard/sage-5.8.__spkg

 http://www.sagemath.org/packages/standard/sage-5.8.spkg
 This contains the source code.

 2. Create a file in $HOME/.hgrc containing your name as mentioned 
 here:
 http://www.sagemath.org/doc/__developer/producing_patches.__html

 http://www.sagemath.org/doc/developer/producing_patches.html

 3. Open a ticket in trac so that you can get the ticket number.
 Let's say the number is 12345.

 4. Use the inbuilt mercurial inside Sage to create the patch.
   i) First change directory to the unpacked sage/sage directory
 ii) Next, run the command (where /path/to/sage is where the sage
 script is present and 12345 is the ticket number)
 /path/to/sage -hg qnew 12345_documentation.patch
 iii) Hack hack hack and make your changes :)
 You will need to follow the developer documentation for syntax and
 formatting.
 iv) Now that you are satisfied with your changes, run
 /path/to/sage -hg qref -m a one line description of your changes
 v) Make hg generate the patch:
 /path/to/sage -hg export qtip  ~/$(/path/to/sage -hg qtop)

 5. Go back to the ticket and upload the patch that is present at
 ~/12345_documentation.patch

 Hopefully, this procedure will become much simpler after the move to
 git, since trivial changes can be made directly in github (if the
 project remains hosted in github).


 --
 You received this message because you are subscribed to a topic in
 the Google Groups sage-support group.
 To unsubscribe from this topic, visit
 
 https://groups.google.com/d/__topic/sage-support/__3mekDq5Stvk/unsubscribe?hl=en
 
 https://groups.google.com/d/topic/sage-support/3mekDq5Stvk/unsubscribe?hl=en
 .

 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscribe@__googlegroups.com

[sage-support] Re: sage good gui

2013-05-01 Thread P Purkayastha
Both the cloud and sagecell don't work with pretty print. Here is an 
example on the cell:
http://goo.gl/fBez6

On Thursday, May 2, 2013 11:07:22 AM UTC+8, Jason Grout wrote:

 On 5/1/13 8:11 PM, William Stein wrote: 
  Inhttps://cloud.sagemath.com, displayed equation wrapping works now 
  and is enabled by default. 

 Likewise for the sage cell server, though the below shows some odd 
 linebreaks, likely a result of Sage representing multiplication by a 
 thin space \,: 


 http://sagecell.sagemath.org/?z=eJxLs9WoiDPSTs4v1qjQ1C7OzANSmnGmvFzFGfnlGml6qRUFiXkpGpqaAAkhDJU=lang=sage
  

 Thanks, 

 Jason 




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: plot3d using real-valued real-parameter functions but involving complex numbers as intermediates

2013-04-26 Thread P Purkayastha

On 04/26/2013 09:05 PM, Gary McConnell wrote:

Hi

OK I have successfully raised trac tkt 14493, but that's about it. I'm
afraid I am so unused to this stuff that I cannot even follow the
instructions above. I tried to download 5.8 from that link, but it
failed to install. But I'm not even sure I was meant to install it! ie
maybe I just need the code stored somewhere - not sure what you meant
... (I already have 5.7 working in this machine). I set up the file from
step 2, and then from step 4 I changed directory to Applications/sage
but Applications/sage/sage is a file not a directory. So I ran ./sage
-hg qnew 14493_documentation.patch and it quietly blinked for a second
and then gave me a new command line - apparently doing absolutely
nothing! So when you say hack hack hack etc :) I am not sure what I am
supposed to be hacking!!

Sorry if this is moronic, but I'll get there eventually 


Hello,
  No, I outlined the instructions below if you don't want to install 
the sage source. After the step 4 ii) you will get no output. But you 
can check that the patch file has been created by using the command


/path/to/sage -hg qser

Note that I wrote /path/to/sage because it is supposed to be the sage 
script from your existing sage installation, NOT the unpacked sage-5.8 
directory.


By hack hack, I meant that you just carry on with the changes you want 
to perform on the actual files. The hg will keep track of the changes. 
You can see a diff of the changes when you run the command


/path/to/sage -hg qdiff

Hope that helps,
  basu.



If you don't want to install the sage from source, you can download
the sage spkg and work with that.  This is OK since you intend to do
only documentation changes. In this case, follow the steps below:

1. download the sage spkg from
http://www.sagemath.org/__packages/standard/sage-5.8.__spkg
http://www.sagemath.org/packages/standard/sage-5.8.spkg
This contains the source code.

2. Create a file in $HOME/.hgrc containing your name as mentioned here:
http://www.sagemath.org/doc/__developer/producing_patches.__html
http://www.sagemath.org/doc/developer/producing_patches.html

3. Open a ticket in trac so that you can get the ticket number.
Let's say the number is 12345.

4. Use the inbuilt mercurial inside Sage to create the patch.
  i) First change directory to the unpacked sage/sage directory
ii) Next, run the command (where /path/to/sage is where the sage
script is present and 12345 is the ticket number)
/path/to/sage -hg qnew 12345_documentation.patch
iii) Hack hack hack and make your changes :)
You will need to follow the developer documentation for syntax and
formatting.
iv) Now that you are satisfied with your changes, run
/path/to/sage -hg qref -m a one line description of your changes
v) Make hg generate the patch:
/path/to/sage -hg export qtip  ~/$(/path/to/sage -hg qtop)

5. Go back to the ticket and upload the patch that is present at
~/12345_documentation.patch

Hopefully, this procedure will become much simpler after the move to
git, since trivial changes can be made directly in github (if the
project remains hosted in github).


--
You received this message because you are subscribed to a topic in
the Google Groups sage-support group.
To unsubscribe from this topic, visit

https://groups.google.com/d/__topic/sage-support/__3mekDq5Stvk/unsubscribe?hl=en

https://groups.google.com/d/topic/sage-support/3mekDq5Stvk/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to
sage-support+unsubscribe@__googlegroups.com
mailto:sage-support%2bunsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com
mailto:sage-support@googlegroups.com.
Visit this group at
http://groups.google.com/__group/sage-support?hl=en
http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/__groups/opt_out
https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.





--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: sage is filling up my directory with files

2013-04-24 Thread P Purkayastha

The workaround is: use sage's attach() function instead of the python one.

On 04/25/2013 05:53 AM, davidp wrote:

Yes!  This looks right.

Thanks,
Dave

On Wednesday, April 24, 2013 2:30:09 PM UTC-7, John H Palmieri wrote:



On Wednesday, April 24, 2013 8:53:56 AM UTC-7, davidp wrote:

I just installed Sage 5.8 and am running it from the command
line.  For some reason, it is filling up my directory with what
looks like temporary files, e.g., threshold.sageJmarTS.py
http://threshold.sageJmarTS.py,  threshold.sageR9Gfg9, and on
and on.  (I  attached code contained in a file called
'threshold.sage'.  I get the same behavior from other attached
files.)  These files remain in the directory after i quit Sage.
Could someone tell me what's wrong?

Thanks,
Dave


I think this is the problem reported here:
http://trac.sagemath.org/sage_trac/ticket/14149
http://trac.sagemath.org/sage_trac/ticket/14149. There does not
seem to be a fix right now.

--
John

--
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.





--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Numerical approximation of ceiling functions?

2013-04-23 Thread P Purkayastha

On 04/21/2013 09:50 AM, Kenneth Lin wrote:

Hi Sage,

I'm not sure if it's that I'm not doing this right, but I have this
function that has a ceiling in it. I defined it like so:

|
botrk(h0_prime,a0,s0,c0)=h0_prime /ceil(log(20*(a0 +25)/(h0_prime
+20*(a0 +25)),0.95))*(s0 +0.4)*(1+c0)
|

But it won't do approximations of the ceiling, only returning another
symbolic expression that can't be approximated.

|
sage: botrk(3000, 10, 1, 0.1)
4620.000/ceil(-19.4957257462237*log(7/37))
sage: botrk(3000, 10, 1, 0.1).n()
---
TypeError Traceback (most recent call last)
ipython-input-63-503406e1b435 in module()
 1 botrk(Integer(3000), Integer(10), Integer(1), RealNumber('0.1')).n()

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression._numerical_approx
(sage/symbolic/expression.cpp:21011)()

TypeError: cannot evaluate symbolic expression numerically

|

Does anyone know how to approximate ceilings? For my purpose, I could
just plug this in again and get a result, but I was hoping for a better,
cleaner way of doing it.


Don't know why it stumbles on the ceiling. A function works on the other 
hand, since it avoids symbolics.


sage: def botrk(h0_prime, a0, s0, c0): return  h0_prime / ceil(log(20 * 
(a0 + 25) / (h0_prime + 20 * (a0 + 25)), 0.95)) * (s0 + 0.4) * (1 + c0)

:
sage: botrk(3000, 10, 1, 0.1)
140.



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: plot3d using real-valued real-parameter functions but involving complex numbers as intermediates

2013-04-20 Thread P Purkayastha

On 04/18/2013 03:13 AM, Gary McConnell wrote:

I am very keen to help - my problem is utter incompetence at following
the high-level instructions in the manual for developers. Also I am on
the VM and I cannot access the sage directories directly. Is there a way
you could send me a manual file that I could modify and send back to
you? Sorry :( I promise I will learn this one day ...

the page I was referring to is
http://www.sagemath.org/doc/reference/numerical/sage/numerical/optimize.html#sage.numerical.optimize.minimize

Also there are presumably many functions to which this syntax difference
applies ... how can I find them?

Thanks!


I failed to notice this reply earlier.

I think it is better if you can submit a patch to trac. The patch is 
generated by mercurial and it can automatically populate the author 
attribution and other information. These information is used by a 
patchbot that automatically tests the patches for validity and performs 
other tests.


To generate the patch, you can either install the sage library code.

If you don't want to install the sage from source, you can download the 
sage spkg and work with that.  This is OK since you intend to do only 
documentation changes. In this case, follow the steps below:


1. download the sage spkg from 
http://www.sagemath.org/packages/standard/sage-5.8.spkg

This contains the source code.

2. Create a file in $HOME/.hgrc containing your name as mentioned here:
http://www.sagemath.org/doc/developer/producing_patches.html

3. Open a ticket in trac so that you can get the ticket number. Let's 
say the number is 12345.


4. Use the inbuilt mercurial inside Sage to create the patch.
 i) First change directory to the unpacked sage/sage directory
ii) Next, run the command (where /path/to/sage is where the sage script 
is present and 12345 is the ticket number)

/path/to/sage -hg qnew 12345_documentation.patch
iii) Hack hack hack and make your changes :)
You will need to follow the developer documentation for syntax and 
formatting.

iv) Now that you are satisfied with your changes, run
/path/to/sage -hg qref -m a one line description of your changes
v) Make hg generate the patch:
/path/to/sage -hg export qtip  ~/$(/path/to/sage -hg qtop)

5. Go back to the ticket and upload the patch that is present at 
~/12345_documentation.patch


Hopefully, this procedure will become much simpler after the move to 
git, since trivial changes can be made directly in github (if the 
project remains hosted in github).


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: plot3d using real-valued real-parameter functions but involving complex numbers as intermediates

2013-04-17 Thread P Purkayastha

On 04/17/2013 07:05 PM, Gary McConnell wrote:

OK I have now uncovered another weird sage-python problem. I think I
should be the go-to guy to wreck otherwise perfectly healthy code :).

If you try to use the function minimize() with the python function
@ppurka defined above then you get the error

TypeError: g() takes exactly 2 arguments (1 given)


whereas if I try to do the minimize using a SAGE function as per my
original message, we get back to the same coercion to real problem.
Here is some dumb code to show the problem:

vars = var('x y')
def gg(x,y): return sin(x) + cos(y)
minimize(gg,[0,0])

gives the above error; whereas:

vars = var('x y')
gg = sin(x) + cos(y)
minimize(gg,[0,0])

works fine  I cannot see anywhere in the reference manual where the
syntax for minimize() for python functions, should be different from
that for SAGE functions right?!

Kind regards

Gary


Hello Gary,

  The minimize function takes in a function which has only *one* 
argument. That argument itself can be tuple or list. So, this very 
simple modification to your code works:


sage: def gg(x): return sin(x[0]) + cos(x[1])
sage: minimize(gg,[0,0])
Optimization terminated successfully.
 Current function value: -2.00
 Iterations: 72
 Function evaluations: 139
(-1.5707636272, 3.14159570731)

  basu.

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: plot3d using real-valued real-parameter functions but involving complex numbers as intermediates

2013-04-17 Thread P Purkayastha

On 04/17/2013 07:16 PM, Gary McConnell wrote:

Ah I see now that this is implicit in the docs example ... thank you ...
should we perhaps point that out explicitly, since the very same
function takes two rather different syntaxes? I am happy to write a
small amendment to the page.


You are welcome to improve the docs. If it was confusing to you it will 
be confusing to someone else too in the future. So, if you have some 
ideas how to fix/enhance the documentation, please go ahead and submit a 
patch. :)



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: plot3d using real-valued real-parameter functions but involving complex numbers as intermediates

2013-04-17 Thread P Purkayastha

On 04/17/2013 09:59 AM, kcrisman wrote:


ppurka, can you try the patch at #13355 to see if that helps in this case?


No, that doesn't work either. :(


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: plot3d using real-valued real-parameter functions but involving complex numbers as intermediates

2013-04-16 Thread P Purkayastha

On 04/16/2013 09:57 PM, GaryMak wrote:

Hi

I am trying to use plot functions for the first time in sage - apologies
if this is a dumb question for a change.

I have a square matrix M of fixed complex numbers which are then all
multiplied by a different phase depending on which column they are in.
(In the 2x2 example below M=[a,b;c,d] and column 1 is multiplied by
exp(i*theta) and column 2 is multiplied by exp(i*phi) ). I then take
another fixed matrix A away from M and take f=det(M-A).abs() as my
output. I have explicitly written this formula for A = [1,1;0,0] below.
So the function I would like to plot is f as a function of theta and phi
(in this case).

a = 1/2
b = - i/3
c = 1/4
d = i/5
theta, phi = var('theta,phi')
f(theta,phi) = ( (a*exp(i*theta)-1)*d*exp(i*phi) -
(b*exp(i*phi)-1)*c*exp(i*theta) ) . abs()
plot3d(f, (theta,0,pi), (phi,0,pi))

No matter how I try to do this, even if I explicitly write out the
complex conjugates of each element, I get what for me is a record-length
screed of error stuff ending in 'TypeError: unable to coerce to a real
number', originating in the command 'plot3d(...etc...)'. I have attached
a text file with the full output of one of my attempts.

I can see that in a way I am asking a lot of the interpreter; but then
again I feel I have explicitly made the thing real by the time it gets
to be an input for the plot3d function.

Is there any way around this, or do I have to start writing complexes as
a+bi etc and do it the hard way?

Many thanks

Gary


The problem is actually in the conversion of your function to a 
fast_float() version of the function. Apparently, it fails for symbolic 
complex functions (which are not really complex) even in this trivial 
example:


f(theta, phi) = (theta + i * phi).abs()
ff = fast_float(f, 'theta', 'phi')

One trivial workaround is to define your function to be a python 
function. Somehow, it works. :)


def f(theta,phi): return ( (a*exp(i*theta)-1)*d*exp(i*phi) - 
(b*exp(i*phi)-1)*c*exp(i*theta) ) . abs()


plot3d(f, (theta, 0, pi), (phi, 0, phi))


--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




  1   2   3   >