Re: [sage-support] Sagetex fails to interpret input

2011-10-11 Thread Dan Drake
On Tue, 11 Oct 2011 at 11:09PM +0200, Jose Guzman wrote:
> AttributeError: 'sage.rings.integer.Integer' object has no attribute
> 'rstrip'
> 
>  Running Sage on example.sage failed! Fix example.tex and try again.
> 
> I moved $SAGEROOT/local/share/texmf/tex/ to /usr/local/share/texmf
> following the instructions to install sagetex.
> 
> Does anybody knows what's wrong here?

Your TeX installation is finding an old version of sagetex.sty. Do 

 kpsewhich sagetex.sty

If the result is inside your distribution's TeX installation, you
need to make TeX ignore that file. I would rename or delete the old
sagetex.sty and use the above command to make sure that TeX is finding
the sagetex.sty that comes with your current version of Sage.

Dan

--
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature


[sage-support] Re: Question about Kernel Matrix

2011-10-11 Thread Jason Grout

On 10/11/11 5:27 PM, juaninf wrote:

Hi everyone

I want know if exist a parallel implementation to kernels of matrices
with openmpi
in sage


I'm pretty sure that nothing in Sage uses openmpi by default (and 
probably not at all).  We don't include any mpi packages in the default 
Sage.


Thanks,

Jason



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


[sage-support] Question about Kernel Matrix

2011-10-11 Thread juaninf
Hi everyone

I want know if exist a parallel implementation to kernels of matrices
with openmpi
in sage


thanks

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


[sage-support] Sagetex fails to interpret input

2011-10-11 Thread Jose Guzman

I am trying a minimal example of Sage to start using it for my lectures:

When I try the following file (example.text)
\documentclass{article}
\usepackage{sagetex}

\begin{document}
 one plus two is $\sage{1+2}$

\end{document}

>>> pdflatex example.text
>>> sage example.sage

it gives me the following error:

Processing Sage code for example.tex...
Inline formula 0

 Error in Sage code on line 5 of example.tex! Traceback follows.
Traceback (most recent call last):
  File "example.py", line 7, in 
_st_.inline(_sage_const_0 , _sage_const_1 +_sage_const_2 )
  File 
"/home/nin/sage-4.7/local/lib/python2.6/site-packages/sagetex.py", line 
73, in inline

s.rstrip() + '}{}{}{}{}}\n')
  File "element.pyx", line 328, in 
sage.structure.element.Element.__getattr__ (sage/structure/element.c:2790)
  File "parent.pyx", line 277, in 
sage.structure.parent.getattr_from_other_class 
(sage/structure/parent.c:2930)
  File "parent.pyx", line 175, in 
sage.structure.parent.raise_attribute_error (sage/structure/parent.c:2699)
AttributeError: 'sage.rings.integer.Integer' object has no attribute 
'rstrip'


 Running Sage on example.sage failed! Fix example.tex and try again.

I moved $SAGEROOT/local/share/texmf/tex/ to /usr/local/share/texmf 
following the instructions to install sagetex.


Does anybody knows what's wrong here?

Thanks

Jose

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


[sage-support] Re: dumps() and loads() of symbolic functions problem

2011-10-11 Thread Nils Bruin
On Oct 11, 4:16 am, CDSousa  wrote:
> x = var('x'); f = function('f',x) ; s = dumps(f) ; loads(s)
> I get a  "RuntimeError: unknown function 'f' in archive".

Excellent example. That's definitely a bug. You must be the first
person who tries to pickle a formal function (i.e., one without a
defining expression). You should file a bug report with exactly this
example in there.

Some technical information from
sage.misc.explain_pickle.explain_pickle:
(indeed, pickle is not an opaque binary format when looked at with the
right tools. However, in this case it turns out it wraps another
format from Pynac which is probably also not opaque but needs an
expert to make sense of)

Things go wrong in sage.symbolic.expression.Expression , which
basically just wraps Pynac's GArchive. Apparently, this routine
handles free "variables" properly but not "free functions".

The bug will be immediately pushed upstream to Pynac developers, but
luckily those are actively involved in sage.

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


[sage-support] Re: Re Superimpose various region_plot's

2011-10-11 Thread Zheng
Wow it works perfect! Thank you so much! I should take more careful
look of the manual and help functions. Thank you.

On Oct 11, 11:10 am, Jason Grout  wrote:
> On 10/11/11 9:44 AM, Zheng Han wrote:
>
> > The points in the area of region_plot are covered by the region_plot.
> > I'm not sure whether I failed to patch it or the patch indeed fails to
> > work for points. Thx.
>
> Most of the patch failed to apply, as the messages said.  You could do
> this instead:
>
> r1+=point(f,rgbcolor=[1,0,0],zorder=1)+plot(c1)+plot(c2)+plot(c3)+point(g,z 
> order=1)
>
> (note the zorder arguments to point)
>
> Thanks,
>
> Jason

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


[sage-support] Question about sagenb.org

2011-10-11 Thread juaninf
Exist sagenb.org with openmpi module?

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


[sage-support] Re: Show intermediate steps for solve(), diff(), integral(), etc...

2011-10-11 Thread Jason Grout

On 10/11/11 10:13 AM, kcrisman wrote:

I'm looking for a way to show the intermediate steps Sage goes through
when evaluating an expression. To give a very simple example:

x=var('x')
solve(x*x+6x+8,x)

evaluates to:

[x == -2, x == -4]

However I would like the option to see the intermediate steps, thus
something like:

(x+2)(x+4)=0
[x == -2, x == -4]



Sage has a lot of tools in it, but it does not have this, nor is it
likely to have for some time, as I do not believe anyone is working on
this.   I suppose if one of the M's has it, adding such functionality
- which would probably *not* be the default - would fall under the
mission statement, though.

There do exist such programs, some of which are free (of charge, not
necessarily open-source), such as http://www.xyalgebra.org/.  I do not
know how good they are, but you might as well try them.  Good luck,
and sorry we cannot currently help with this!


Wolfram Alpha does a nice job of showing steps...

Jason


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


[sage-support] Re: Re Superimpose various region_plot's

2011-10-11 Thread Jason Grout

On 10/11/11 9:44 AM, Zheng Han wrote:


The points in the area of region_plot are covered by the region_plot.
I'm not sure whether I failed to patch it or the patch indeed fails to
work for points. Thx.


Most of the patch failed to apply, as the messages said.  You could do 
this instead:


r1+=point(f,rgbcolor=[1,0,0],zorder=1)+plot(c1)+plot(c2)+plot(c3)+point(g,zorder=1)


(note the zorder arguments to point)

Thanks,

Jason



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


[sage-support] Re: Show intermediate steps for solve(), diff(), integral(), etc...

2011-10-11 Thread kcrisman
> I'm looking for a way to show the intermediate steps Sage goes through
> when evaluating an expression. To give a very simple example:
>
>    x=var('x')
>    solve(x*x+6x+8,x)
>
> evaluates to:
>
>    [x == -2, x == -4]
>
> However I would like the option to see the intermediate steps, thus
> something like:
>
>    (x+2)(x+4)=0
>    [x == -2, x == -4]
>

Sage has a lot of tools in it, but it does not have this, nor is it
likely to have for some time, as I do not believe anyone is working on
this.   I suppose if one of the M's has it, adding such functionality
- which would probably *not* be the default - would fall under the
mission statement, though.

There do exist such programs, some of which are free (of charge, not
necessarily open-source), such as http://www.xyalgebra.org/.  I do not
know how good they are, but you might as well try them.  Good luck,
and sorry we cannot currently help with this!

- kcrisman

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


[sage-support] Re Superimpose various region_plot's

2011-10-11 Thread Zheng Han
(Sorry the previous email I forget to attach the plot file. I would
delete it in the google mailgroup.)
The original discussion is here:http://groups.google.com/group/sage-
support/browse_thread/thread/3f4ad882ba420693?hl=en. However, since
the discussion seems closed I can't reply to it so I just opened this
another discussion.
I'm using sage4.7.1 and running it on ubuntu 11.04. I tried to create
a branch for sage and patch this:
http://trac.sagemath.org/sage_trac/ticket/9491
and it seems worked since sagenb will not complain about the unknown
argument 'opacity' after that but patching procedure reported:
{{{
Hunk #1 FAILED at 119
Hunk #2 FAILED at 146
Hunk #3 FAILED at 167
Hunk #4 FAILED at 179
4 out of 4 hunks FAILED -- saving rejects to file sage/plot/
contour_plot.py.rej
abort: patch failed to apply
}}}

The region_plot works well to fill some area with color and
transparent to axis and lines but it fails for points. For my example:
{{{
c1 = line([[5,8],[7,0]])
c2 = line([[-1,7],[7,5]])
c3 = line([[-1,-2],[6,5]])
f = [()]
g = [()]
for i in range(8):
for j in range(8):
if (4*i+j<=28)&(i+4*j<=27)&(i-j<=1):
f.append((i,j))
else:
g.append((i,j))
f.pop(0)
g.pop(0)
c = line([[0,0],[2,5]])
var('x y')
r1=region_plot(max(x+4*y-28,x-y-1)<=-.5,(x,0,6),(y,
0,5),incol='lightblue',borderwidth=0,opacity=0.5)
r1+=point(f,rgbcolor=[1,0,0])+plot(c1)+plot(c2)+plot(c3)+point(g)
r1.show()
}}}

The points in the area of region_plot are covered by the region_plot.
I'm not sure whether I failed to patch it or the patch indeed fails to
work for points. Thx.

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


points.pdf
Description: Adobe PDF document


[sage-support] Re Superimpose various region_plot's

2011-10-11 Thread Zheng
The original discussion is here:http://groups.google.com/group/sage-
support/browse_thread/thread/3f4ad882ba420693?hl=en. However, since
the discussion seems closed I can't reply to it so I just opened this
another discussion.

I'm using sage4.7.1 and running it on ubuntu 11.04. I tried to create
a branch for sage and patch this: http://trac.sagemath.org/sage_trac/ticket/9491
and it seems worked since sagenb will not complain about the unknown
argument 'opacity' after that but patching procedure reported:
{{{
Hunk #1 FAILED at 119
Hunk #2 FAILED at 146
Hunk #3 FAILED at 167
Hunk #4 FAILED at 179
4 out of 4 hunks FAILED -- saving rejects to file sage/plot/
contour_plot.py.rej
abort: patch failed to apply
}}}
The region_plot works well to fill some area with color and
transparent to axis and lines but it fails for points. For my example:
{{{
c1 = line([[5,8],[7,0]])
c2 = line([[-1,7],[7,5]])
c3 = line([[-1,-2],[6,5]])
f = [()]
g = [()]
for i in range(8):
for j in range(8):
if (4*i+j<=28)&(i+4*j<=27)&(i-j<=1):
f.append((i,j))
else:
g.append((i,j))

f.pop(0)
g.pop(0)
c = line([[0,0],[2,5]])
var('x y')
r1=region_plot(max(x+4*y-28,x-y-1)<=-.5,(x,0,6),(y,
0,5),incol='lightblue',borderwidth=0,opacity=0.5)
r1+=point(f,rgbcolor=[1,0,0])+plot(c1)+plot(c2)+plot(c3)+point(g)
r1.show()
}}}
The points in the area of region_plot are covered by the region_plot.
I'm not sure whether I failed to patch it or the patch indeed fails to
work for points. Thx.

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


[sage-support] Re: memory leak in mixed integer programming?

2011-10-11 Thread Nathann Cohen

>
> This happens no matter if I use solver="GLPK" or solver="coin" (cbc is 
> installed), so it does not seem to be a problem of the underlying milp- 
> solver. 
>

Pompompom That's probably my fault :-D

I will try to deal with it today. I'll keep this thread updated :-)

Nathann 

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


Re: [sage-support] Re: fill between

2011-10-11 Thread daldrich
Yeah, that did it. Thanks!

# distribution function
f(x) = 1/sqrt(2*pi)*e^(.5*(-x^2))
s  = 1
p  = plot(f,(-pi,pi),ymax = .45, ticks=[1,[]])
p += line([(s,0),(s,f(s))],linestyle = 'dashed')
p += line([(-s,0),(-s,f(-s))],linestyle = 'dashed')
p += text("$\\mu$ = 0",(0.4,0.05))
p += plot(f,(-s,s),fill = 'axis')
show (p)


>> I'm trying to fill in the bell curve between two points, like plus and minus
>> 1 sigma.
>
>Maybe like this:
>
>p = plot(f,(-pi,pi),ymax = .4, ticks=[1,[]])
>p += plot(f,(-s,s),fill = 'axis')
>


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


Re: [sage-support] Re: fill between

2011-10-11 Thread Håkan Granath
> I'm trying to fill in the bell curve between two points, like plus and minus
> 1 sigma.

Maybe like this:

p = plot(f,(-pi,pi),ymax = .4, ticks=[1,[]])
p += plot(f,(-s,s),fill = 'axis')

/Håkan

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


[sage-support] memory leak in mixed integer programming?

2011-10-11 Thread Peter Mueller
The following code eats up several giga byte of memory within a few
minutes:

while True:
P=MixedIntegerLinearProgram()
x=P.new_variable(dim=1,integer=True)
P.add_constraint(x[0]+x[1]==1)
P.set_objective(x[0])
w=P.solve()
del P
del x

I'm using a self-compiled version of sage 4.7 on a 64bit Ubuntu 11.04
intel machine.

This happens no matter if I use solver="GLPK" or solver="coin" (cbc is
installed), so it does not seem to be a problem of the underlying milp-
solver.

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


[sage-support] dumps() and loads() of symbolic functions problem

2011-10-11 Thread CDSousa
Hi,

When doing

x = var('x'); f = function('f',x) ; s = dumps(f) ; loads(s)

I get a  "RuntimeError: unknown function 'f' in archive".

I have equal problem with save()/load() and db_save()/db().

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


Re: [sage-support] Re: fill between

2011-10-11 Thread Dan Aldrich
I'm trying to fill in the bell curve between two points, like plus 
and minus 1 sigma.


-d

At 09:19 PM 10/10/2011, you wrote:

What exactly are you trying to fill?  Can you find a picture showing 
an example of what you are trying to achieve?



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