Re: [sage-support] Problem with load in sagemath 9.0 on ubuntu 20.04

2020-10-20 Thread Carl Eberhart
Oh.  Durn.  Thought I had corrected those.  Thanks

On Tuesday, October 20, 2020 at 2:02:35 PM UTC-5 Carl Eberhart wrote:

> Thanks, but the sage file I am trying to load is one I have loaded many 
> times before on the cloud and also on a local installation of Sagemath 
> 8.6.   It looks like it may be an instance of missing a change from <> to 
> != in the source code of preparse_file.
>
> On Monday, October 19, 2020 at 12:41:00 PM UTC-5 dim...@gmail.com wrote:
>
>> On Mon, Oct 19, 2020 at 6:36 PM Carl Eberhart  
>> wrote:
>> >
>> > I can't load a sage file in either the notebook or terminal version of 
>> Sage
>> > Here is my last (of many) attempts.
>> > sage: load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage")
>> > Traceback (most recent call last):
>> >
>> > File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", 
>> line 3331, in run_code
>> > exec(code_obj, self.user_global_ns, self.user_ns)
>> >
>> > File "", line 1, in 
>> > load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage")
>> >
>> > File "sage/misc/persist.pyx", line 144, in sage.misc.persist.load 
>> (build/cythonized/sage/misc/persist.c:2538)
>> > sage.repl.load.load(filename, globals())
>> >
>> > File "/usr/lib/python3/dist-packages/sage/repl/load.py", line 272, in 
>> load
>> > exec(preparse_file(f.read()) + "\n", globals)
>> >
>> > File "", line 121
>> > if s<>_sage_const_0 :
>> > ^
>> > SyntaxError: invalid syntax
>>
>> it is certainly possible to create a (broken) Sage file that would not
>> work. Perhaps it's one of such errors?
>> Could you reproduce this on a file you are willing to post here?
>> E.g. something very short, preferably.
>>
>>
>> >
>> > --
>> > 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/33b51a9f-ca07-4c03-9d68-25fb085d6d14n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/6742017b-7409-48a6-9f16-0335cf6eaaffn%40googlegroups.com.


Re: [sage-support] Problem with load in sagemath 9.0 on ubuntu 20.04

2020-10-20 Thread Carl Eberhart
Thanks, but the sage file I am trying to load is one I have loaded many 
times before on the cloud and also on a local installation of Sagemath 
8.6.   It looks like it may be an instance of missing a change from <> to 
!= in the source code of preparse_file.

On Monday, October 19, 2020 at 12:41:00 PM UTC-5 dim...@gmail.com wrote:

> On Mon, Oct 19, 2020 at 6:36 PM Carl Eberhart  wrote:
> >
> > I can't load a sage file in either the notebook or terminal version of 
> Sage
> > Here is my last (of many) attempts.
> > sage: load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage")
> > Traceback (most recent call last):
> >
> > File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", 
> line 3331, in run_code
> > exec(code_obj, self.user_global_ns, self.user_ns)
> >
> > File "", line 1, in 
> > load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage")
> >
> > File "sage/misc/persist.pyx", line 144, in sage.misc.persist.load 
> (build/cythonized/sage/misc/persist.c:2538)
> > sage.repl.load.load(filename, globals())
> >
> > File "/usr/lib/python3/dist-packages/sage/repl/load.py", line 272, in 
> load
> > exec(preparse_file(f.read()) + "\n", globals)
> >
> > File "", line 121
> > if s<>_sage_const_0 :
> > ^
> > SyntaxError: invalid syntax
>
> it is certainly possible to create a (broken) Sage file that would not
> work. Perhaps it's one of such errors?
> Could you reproduce this on a file you are willing to post here?
> E.g. something very short, preferably.
>
>
> >
> > --
> > 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/33b51a9f-ca07-4c03-9d68-25fb085d6d14n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/2c68aba5-e746-469f-9c4e-b71cef674550n%40googlegroups.com.


[sage-support] Re: Problem with load in sagemath 9.0 on ubuntu 20.04

2020-10-20 Thread Carl Eberhart
Thanks.   After looking for the definition of of preparse_file it appears 
that it is imported from a binary file.  Will I have to download the source 
and recompile to fix this?
Carl

On Monday, October 19, 2020 at 4:15:27 PM UTC-5 Matthias Koeppe wrote:

> On Monday, October 19, 2020 at 10:36:05 AM UTC-7, Carl Eberhart wrote:
>
>> I can't load a sage file in either the notebook or terminal version of 
>> Sage
>>
>   File "", line 121
>> if s<>_sage_const_0 :
>>  ^
>> SyntaxError: invalid syntax
>>
>
> The syntax <> for "not equal"  is no longer valid in Python 3. Use != 
> instead.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/11be8a16-7579-4454-975b-926fb4055de4n%40googlegroups.com.


[sage-support] Problems installing Sagemath 9.0

2020-10-20 Thread Carl Eberhart
I am running Ubuntu Mate 20.04 on a raspberry pi 4, and have installed 
Sagemath 9.0 using the Synaptic package manager.  I can open a python3 
notebook, but the sagemath 9.0 kernel refuses to start.  Can someone make a 
suggestion?
Here is a transcript of my last attempt.

## I have installed sagemath 9.0 on a Rasberry Pi 4 running Ubuntu Mate 
20.04 
## at 64 bits using the synaptic package manager
## Here is an attempt to use sagemath
carl@pi:~$ jupyter-notebook
[I 15:37:12.668 NotebookApp] Serving notebooks from local directory: 
/home/carl
[I 15:37:12.668 NotebookApp] The Jupyter Notebook is running at:
[I 15:37:12.668 NotebookApp] 
http://localhost:/?token=f1eca39609cf60e86905004caf9543e902ae4e61a6a7ca3a
[I 15:37:12.668 NotebookApp]  or 
http://127.0.0.1:/?token=f1eca39609cf60e86905004caf9543e902ae4e61a6a7ca3a
[I 15:37:12.668 NotebookApp] Use Control-C to stop this server and shut 
down all kernels (twice to skip confirmation).
[C 15:37:12.760 NotebookApp] 

To access the notebook, open this file in a browser:

file:///home/carl/.local/share/jupyter/runtime/nbserver-3527-open.html
Or copy and paste one of these URLs:

http://localhost:/?token=f1eca39609cf60e86905004caf9543e902ae4e61a6a7ca3a
 or 
http://127.0.0.1:/?token=f1eca39609cf60e86905004caf9543e902ae4e61a6a7ca3a

## Here I open a new python 3 notebook, make a small calculation and save
## the notebook as sample.ipnb

I 15:39:55.786 NotebookApp] Creating new notebook in 
[I 15:40:00.625 NotebookApp] Kernel started: 
23c8750f-bb85-4630-a70e-1cdd0cc62a4e
[IPKernelApp] ERROR | No such comm target registered: jupyter.widget.version
[IPKernelApp] ERROR | No such comm target registered: jupyter.widget.version
[I 15:42:00.649 NotebookApp] Saving file at /Untitled4.ipynb
[I 15:48:00.640 NotebookApp] Saving file at /Untitled4.ipynb
[W 15:48:52.363 NotebookApp] 404 GET 
/api/contents/sample.ipynb?type=notebook=0&_=1603053598159 
(127.0.0.1): No such file or directory: sample.ipynb
[W 15:48:52.364 NotebookApp] No such file or directory: sample.ipynb
[W 15:48:52.364 NotebookApp] 404 GET 
/api/contents/sample.ipynb?type=notebook=0&_=1603053598159 
(127.0.0.1) 2.84ms 
referer=http://localhost:/notebooks/Untitled4.ipynb?kernel_name=python3
[I 15:48:52.401 NotebookApp] Uploading file to /sample.ipynb
[I 15:50:41.579 NotebookApp] Saving file at /sample.ipynb

## Now I try to open a new Sagemath 9.0 notebook without success.  

[I 15:55:16.334 NotebookApp] Creating new notebook in 
[I 15:55:24.775 NotebookApp] Kernel started: 
05b0ee0a-8753-48f8-9651-bd69a60da129
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
  File 
"/usr/lib/python3/dist-packages/sage/repl/ipython_kernel/__main__.py", line 
3, in 
IPKernelApp.launch_instance(kernel_class=SageKernel)
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", 
line 663, in launch_instance
app.initialize(argv)
  File "", line 2, in initialize
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", 
line 87, in catch_config_error
return method(app, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/ipykernel/kernelapp.py", line 562, 
in initialize
self.init_kernel()
  File "/usr/lib/python3/dist-packages/ipykernel/kernelapp.py", line 439, 
in init_kernel
kernel = kernel_factory(parent=self, session=self.session,
  File "/usr/lib/python3/dist-packages/traitlets/config/configurable.py", 
line 412, in instance
inst = cls(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/sage/repl/ipython_kernel/kernel.py", 
line 52, in __init__
SageJupyterCustomizations(self.shell)
  File "/usr/lib/python3/dist-packages/sage/repl/ipython_extension.py", 
line 435, in __init__
import sage.all # until sage's import hell is fixed
  File "/usr/lib/python3/dist-packages/sage/all.py", line 106, in 
from sage.matrix.all import *
  File "/usr/lib/python3/dist-packages/sage/matrix/__init__.py", line 2, in 

import sage.matrix.args
  File "sage/matrix/args.pyx", line 23, in init sage.matrix.args 
(build/cythonized/sage/matrix/args.c:21273)
from .matrix_space import MatrixSpace
  File "/usr/lib/python3/dist-packages/sage/matrix/matrix_space.py", line 
46, in 
from . import matrix_modn_sparse
ImportError: /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in 
static TLS block
[I 15:55:30.768 NotebookApp] KernelRestarter: restarting kernel (1/5), keep 
random ports
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
  File 
"/usr/lib/python3/dist-packages/sage/repl/ipython_kernel/__main__.py", line 
3, in 

[sage-support] Problem with load in sagemath 9.0 on ubuntu 20.04

2020-10-19 Thread Carl Eberhart
I can't load a sage file in either the notebook or terminal version of Sage
Here is my last (of many) attempts.
sage: 
load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage") 
Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", 
line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

  File "", line 1, in 
load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage")

  File "sage/misc/persist.pyx", line 144, in sage.misc.persist.load 
(build/cythonized/sage/misc/persist.c:2538)
sage.repl.load.load(filename, globals())

  File "/usr/lib/python3/dist-packages/sage/repl/load.py", line 272, in load
exec(preparse_file(f.read()) + "\n", globals)

  File "", line 121
if s<>_sage_const_0 :
 ^
SyntaxError: invalid 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/33b51a9f-ca07-4c03-9d68-25fb085d6d14n%40googlegroups.com.


[sage-support] Re: differentiation of combinations of functions of t, some of which are unknown

2019-08-29 Thread Carl Eberhart


On Thursday, August 29, 2019 at 2:18:30 PM UTC-5, Carl Eberhart wrote:
>
> derivative treats all parameters in the definition of a function as 
> constant.  Suppose some of them are themselves unknown functions of the 
> variable.
> I would like a procedure Derivative which accepts a list of these 
> parameters and returns an appropriate expression.
> For example,  if f(t)=a(t)*b(t)*c where a and b are unknown functions of 
> t, I want Derivative(f(t),t,[a,b]) to return (da(t)*b(t)+a(t)*db(t))*c
> I have tried various things using the existing derivative procedure, but 
> nothing that works
> Any suggestions would be welcome.
> Thanks
>
> *Thanks to Aaron Tresam and Harald Schilly for the rapid response, and 
> simple solution.*
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/62302b76-59e2-4cdf-8080-4c8d67c4039f%40googlegroups.com.


[sage-support] differentiation of combinations of functions of t, some of which are unknown

2019-08-29 Thread Carl Eberhart
derivative treats all parameters in the definition of a function as 
constant.  Suppose some of them are themselves unknown functions of the 
variable.
I would like a procedure Derivative which accepts a list of these 
parameters and returns an appropriate expression.
For example,  if f(t)=a(t)*b(t)*c where a and b are unknown functions of t, 
I want Derivative(f(t),t,[a,b]) to return (da(t)*b(t)+a(t)*db(t))*c
I have tried various things using the existing derivative procedure, but 
nothing that works
Any suggestions would be welcome.
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/52cb4ab6-e77d-42d2-9ea2-605ccc9bb6b8%40googlegroups.com.


[sage-support] Re: Function defined with matrices won't plug in values for function

2018-12-01 Thread Carl Eberhart


On Friday, November 30, 2018 at 3:59:40 PM UTC-6, saad khalid wrote:
>
> Hi all, 
>
> I'm not sure what is happening, but I defined some matrices:
> Mz = matrix([[0,1],[1,0]])
> Mx = matrix([[1,0],[0,-1]])
>




 

> M1 = matrix([[1,0],[0,1]])
>
> And then I tried defining a function where I multiply these matrices by 
> some variable and add them together:
>
> h(s) = M1 + s*Mx
> h(.1)
> However, when I try to compute this h(.1), the function doesn't plug in .1 
> in for s in the function, and it returns:
>
> [ s + 1  0]
> [ 0 -s + 1]
>
>
> What exactly is happening?
>

I am using the lambda notation for matrix functions.  It works very well

m1=matrix([[2,3],[1,6]]);m2=matrix([[3,6],[9,1]])
f=lambda s:m1+s*m2
f(.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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Sage or Mathemathica. Which one is correct?

2016-04-21 Thread Carl Eberhart
Try checking the value at zero.

On Thursday, April 21, 2016 at 12:15:51 PM UTC-5, Rui Paulo wrote:
>
> In my Phd thesis, I'm having some trouble to calculating some tricky 
> integrals, Sage and Mathematica show different results. To understand what 
> goes I have calculated a simple integral.
>
>
>
> At Sage:
>
>
> 
>
>
>
>
>
>
>
>
> At Mathematica:
>
>
>
> 
>
>
>
>
>
> I'm making any mistake? 
>
> Why this happens? 
>
> Which one should I believe? 
>
>
>
>

-- 
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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Global variables called in a function

2015-12-21 Thread Carl Eberhart
Thanks
I guess I don't understand the difference between a python variable and a 
symbolic variable.
I know that var is part of Sage but not defined in python.  
I also know that the variables created inside a sage procedure using SR.var 
are local, but ones created by var are not.
So inside of procedures, use SR.var, not var, unless you want them to be 
available outside the procedure.
Is that correct Jeroen?




On Monday, December 21, 2015 at 5:09:05 PM UTC-6, vdelecroix wrote:
>
> No. You can try 
> Still
> def f(): 
>  var('whatever') 
> f() 
> print whatever StillThanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
>
> Nothing to do with the fact that 't' was globally available before. 
>
> By design the function var: 
>- creates a new symbolic variable (*not* a Python variable) 
>- makes it available in the global namespace as a Python variThanks.
> SR.var  does the trick for me inside of procedures.  var doesn'table 
> under the same namStille 
>
> Some more examples: 
>
> t = 5 Still
>   -> creates a Python variable named t which contains 5 
> Still
> t = SR.var('x') 
>   -> creates a Python variable named t which contains a symbolic 
> variable named x Still
>
> var('t') 
>   -> creates a Python variable named t which contains a symbolic 
> variable named t. 
>
> Indeed the latter should really be thought as 
>
> t = SR.var('t') StillThanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
>
> Vincent 
>
> On 21/12/15 14:35, Carl Eberhart wrote: Thanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
> > Ah.  Thanks very much for that clarification. 
> > Actually, my snippet illustrates the dilemma I was in. 
> > t already has a value outside of f 
> > executing f changes the value of t outside of f 
> > that is what I would expect to happen if t were declared global in f, 
> but I 
> > thought t was local in f 
> > I still love var, but now I know when to use SR.var instead 
> > Carl Thanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
> > 
> > On Mon, Dec 21, 2015 at 9:49 AM, Jeroen Demeyer <jdem...@cage.ugent.be 
> > 
> > wrote: 
> > 
> >> On 2015-12-21 16:38, Carl Eberhart wrote: 
> >> 
> >>> I admit I don't understand what is happening in the following snippit: 
> >>> 
> >>> def f(): 
> >>>   t=var('t') 
> >>>   t=5 
> >>>   a=2*t 
> >>>   return a 
> >>> 
> >> 
> >> Solution: never use var() in a function. If you do need a symbolic 
> >> variable in a function (note that you don't in the snippet above), you 
> can 
> >> use SR.var() instead of plain var(). That behaves like var(), except 
> that 
> >> it does not change any global. Example: 
> >> 
> >> sage: SR.var('y') 
> >> y 
> >> sage: y 
> >> NameError: name 'y' is not defined 
> >> 
> >> You can use it with explicit assignment: 
> >> 
> >> sage: y = SR.var('y') 
> >> sage: y 
> >> y 
> >> 
> >> 
> >> -- 
> >> 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/G0vP7kulENg/unsubscribe. 
>
> >> To unsubscribe from this group and all its topics, send an email to 
> >> sage-support...@googlegroups.com . 
> >> To post to this group, send email to sage-s...@googlegroups.com 
> . 
> >> Visit this group at https://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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Global variables called in a function

2015-12-21 Thread Carl Eberhart
Thanks
I guess I don't understand the difference between a python variable and a 
symbolic variable.
I know that var is part of Sage but not defined in python.  
I also know that the variables created inside a sage procedure using SR.var 
are local, but ones created by var are not.
So inside of procedures, use SR.var, not var, unless you want them to be 
available outside the procedure.
Is that correct Jeroen?




On Monday, December 21, 2015 at 5:09:05 PM UTC-6, vdelecroix wrote:
>
> No. You can try 
> Still
> def f(): 
>  var('whatever') 
> f() 
> print whatever StillThanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
>
> Nothing to do with the fact that 't' was globally available before. 
>
> By design the function var: 
>- creates a new symbolic variable (*not* a Python variable) 
>- makes it available in the global namespace as a Python variThanks.
> SR.var  does the trick for me inside of procedures.  var doesn'table 
> under the same namStille 
>
> Some more examples: 
>
> t = 5 Still
>   -> creates a Python variable named t which contains 5 
> Still
> t = SR.var('x') 
>   -> creates a Python variable named t which contains a symbolic 
> variable named x Still
>
> var('t') 
>   -> creates a Python variable named t which contains a symbolic 
> variable named t. 
>
> Indeed the latter should really be thought as 
>
> t = SR.var('t') StillThanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
>
> Vincent 
>
> On 21/12/15 14:35, Carl Eberhart wrote: Thanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
> > Ah.  Thanks very much for that clarification. 
> > Actually, my snippet illustrates the dilemma I was in. 
> > t already has a value outside of f 
> > executing f changes the value of t outside of f 
> > that is what I would expect to happen if t were declared global in f, 
> but I 
> > thought t was local in f 
> > I still love var, but now I know when to use SR.var instead 
> > Carl Thanks.
> SR.var  does the trick for me inside of procedures.  var doesn't
> > 
> > On Mon, Dec 21, 2015 at 9:49 AM, Jeroen Demeyer <jdem...@cage.ugent.be 
> > 
> > wrote: 
> > 
> >> On 2015-12-21 16:38, Carl Eberhart wrote: 
> >> 
> >>> I admit I don't understand what is happening in the following snippit: 
> >>> 
> >>> def f(): 
> >>>   t=var('t') 
> >>>   t=5 
> >>>   a=2*t 
> >>>   return a 
> >>> 
> >> 
> >> Solution: never use var() in a function. If you do need a symbolic 
> >> variable in a function (note that you don't in the snippet above), you 
> can 
> >> use SR.var() instead of plain var(). That behaves like var(), except 
> that 
> >> it does not change any global. Example: 
> >> 
> >> sage: SR.var('y') 
> >> y 
> >> sage: y 
> >> NameError: name 'y' is not defined 
> >> 
> >> You can use it with explicit assignment: 
> >> 
> >> sage: y = SR.var('y') 
> >> sage: y 
> >> y 
> >> 
> >> 
> >> -- 
> >> 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/G0vP7kulENg/unsubscribe. 
>
> >> To unsubscribe from this group and all its topics, send an email to 
> >> sage-support...@googlegroups.com . 
> >> To post to this group, send email to sage-s...@googlegroups.com 
> . 
> >> Visit this group at https://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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Global variables called in a function

2015-12-21 Thread Carl Eberhart
I admit I don't understand what is happening in the following snippit:

def f():
t=var('t')
t=5
a=2*t
return a
t=3;t;f();t
3
10
t

This was executed in a sagews cell
I think that the t which is referenced in f should be a local variable.
However the value of t outside of f is modified by the execution of f.
I know this happens because of the statement  t=var('t').
Apparently, varing a variable inside a procedure vars it outside the 
procedure too.
Is this behavior correct?
Thanks  Carl
On Thursday, September 30, 2010 at 11:06:21 AM UTC-5, Robert Bradshaw wrote:
>
> On Thu, Sep 30, 2010 at 3:07 AM, Walker  
> wrote:
> >> sage: x = "this is x"
> >> sage: y = "this is y"
> >> sage: z = "this is z"
> >> sage: def f():
> >> : print x
> >> : y = "new value"
> >> : print y
> >> : global z
> >> : z = "new value"
> >> : print z
> >> :
> >>
> >> sage: f()
> >> this is x
> >> new value
> >> new value
> >>
> >> sage: x, y, z
> >> ('this is x', 'this is y', 'new value')
> >
> > Yes it's true, that's the behavior I was referring to. My problem was
> > actually that I couldn't print a global variable inside a function
> > before I made an assignment to it; the error was something like
> > "Cannot istantiate a local variable before assigning it." and I didn't
> > understand why I had to assign locally a global variable which had
> > already been assigned globally. Anyway the keyword "global" solved my
> > problem.
>
> Yep, a variable is either local or global throughout the entire function.
>
> - Robert
>
>

-- 
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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Global variables called in a function

2015-12-21 Thread Carl Eberhart
Ah.  Thanks very much for that clarification.
Actually, my snippet illustrates the dilemma I was in.
t already has a value outside of f
executing f changes the value of t outside of f
that is what I would expect to happen if t were declared global in f, but I
thought t was local in f
I still love var, but now I know when to use SR.var instead
Carl

On Mon, Dec 21, 2015 at 9:49 AM, Jeroen Demeyer <jdeme...@cage.ugent.be>
wrote:

> On 2015-12-21 16:38, Carl Eberhart wrote:
>
>> I admit I don't understand what is happening in the following snippit:
>>
>> def f():
>>  t=var('t')
>>  t=5
>>  a=2*t
>>  return a
>>
>
> Solution: never use var() in a function. If you do need a symbolic
> variable in a function (note that you don't in the snippet above), you can
> use SR.var() instead of plain var(). That behaves like var(), except that
> it does not change any global. Example:
>
> sage: SR.var('y')
> y
> sage: y
> NameError: name 'y' is not defined
>
> You can use it with explicit assignment:
>
> sage: y = SR.var('y')
> sage: y
> y
>
>
> --
> 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/G0vP7kulENg/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 https://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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] sage notebook warning to rebuild with libgmp >= 5

2015-10-31 Thread Carl Eberhart
I get this warning when I start a sage notebook--

*InsecureWarning: Not using mpz_powm_sec.  You should rebuild using libgmp 
>= 5 to avoid timing attack vulnerability.*Haven't used a sage notebook for 
awhile, but seem to recall that I should ignore this warning.  Is this 
correct?
If not, how do I rebuild using libgmp >= 5?
Thanks, Carl

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

2013-09-16 Thread Carl Eberhart
thanks.  i'll try it.

On Sunday, September 15, 2013 2:20:45 PM UTC-5, Nils Bruin wrote:



 On Sunday, September 15, 2013 12:12:39 PM UTC-7, Carl Eberhart wrote:

 I would like to restrict a 3d plot to a certain box in space, say (x,0,1) 
 (y,0,1),(z,.5,1.5)
 This would be useful in many situations, say when you want to inspect the 
 part of a graph of z=f(x,y) 
 where  z is between a and b.
 It doesn't appear that is possible. Is there an option I am missing?


 A quick solution might be implicit_plot3d(f(x,y)-z, (x,0,1) 
 (y,0,1),(z,.5,1.5)). It's basically the wrong tool for the job (it does way 
 too much computation), but it probably gives acceptable results.


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

2013-09-15 Thread Carl Eberhart
I would like to restrict a 3d plot to a certain box in space, say (x,0,1) 
(y,0,1),(z,.5,1.5)
This would be useful in many situations, say when you want to inspect the 
part of a graph of z=f(x,y) 
where  z is between a and b.
It doesn't appear that is possible. Is there an option I am missing?
Thanks,
Carl

-- 
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] Digest for sage-support@googlegroups.com - 5 Messages in 3 Topics

2013-07-17 Thread Carl Eberhart
Hi Nathann
Here is a Wikipedia article with what looks very much like the python code
for a solution.
http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
Carl


On Wed, Jul 17, 2013 at 12:11 PM, sage-support@googlegroups.com wrote:

   Today's Topic Summary

 Group: http://groups.google.com/group/sage-support/topics

- Trouble with easy_install #13fed9de1076cc45_group_thread_0 [2
Updates]
- Random sum of functions #13fed9de1076cc45_group_thread_1 [2
Updates]
- Longest Common Subsequence #13fed9de1076cc45_group_thread_2 [1
Update]

   Trouble with 
 easy_installhttp://groups.google.com/group/sage-support/t/a269e0b629942f70

P Purkayastha ppu...@gmail.com Jul 17 01:22PM +0800

On 07/16/2013 05:35 PM, Viviane Pons wrote:
 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.




Viviane Pons vivianep...@gmail.com Jul 17 03:13PM +0200

Thank's, indeed I went thought the all thing and now it works!


2013/7/17 P Purkayastha ppu...@gmail.com




   Random sum of 
 functionshttp://groups.google.com/group/sage-support/t/15e2f9ba3e321f12

Laurent Decreusefond laurent.decreusef...@gmail.com Jul 17 02:07AM
-0700

Hi everyone,

say I have a function of both an integer n and a complex z

def f(n,z):
return z**n

For any tuple of integer (a_1,a_2, ..., a_k), (actually, k and a_i are
random), I want to form the function

z - sum_{i=1}^k |f(a_i, z)|^2

The result must still be a function. I guess it is something which can
be
done by redefining a new class but I'm a totally newbie at object
programming.
Can you help me ?




D. S. McNeil dsm...@gmail.com Jul 17 08:19AM -0400

I don't think you need to make an explicit class here. You can build a
function from within another function, and return that:

sage: def f(n, z):
: return z**n
:
sage: def maker(tup):
: def g(z):
: return sum(abs(f(a_i,z))**2 for a_i in tup)
: return g
:

After which

sage: f(1, 3+2*I)
2*I + 3
sage: maker((1,5,3))
function __main__.g
sage: g = maker((1,5,3))
sage: g(5)
9781275
sage: abs(f(1,5))**2 + abs(f(5,5))**2 + abs(f(3,5))**2
9781275

I used Python functions here because that's what you started with. A
similar approach would have worked if you were making a Sage function
instead, namely write a function which accepts a tuple and returns a
new
function.


Doug


On Wed, Jul 17, 2013 at 5:07 AM, Laurent Decreusefond 



   Longest Common 
 Subsequencehttp://groups.google.com/group/sage-support/t/89f9b8e98fbbfab7

Nathann Cohen nathann.co...@gmail.com Jul 17 12:29PM +0200

Helloo everybody !!!

Is there a way to compute the longest common subsequence of two
(binary) words in Sage ? I can't find how, but it looks like something
Sage should be able to do :-)

Thaanks !

Nathann



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




Re: [sage-support] Re: printing the string html

2011-12-21 Thread Carl Eberhart
That's weird.  I can't get it to print.  It's there, because it's in a
string that I write to a file.  I was just checking to see that the string
looked right before I wrote it.
This behaviour occurs for me in the notebooks at sagenb.org and
localhost:8000
Carl


On Wed, Dec 21, 2011 at 3:10 AM, Keshav Kini keshav.k...@gmail.com wrote:

 I'm not sure what your question is. ::

 print(html)

 seems to work fine for me (i.e. it prints out the string html).
 Generally telling Sage to print any particular string should do just that -
 print the string. What do you want it to do?

 -Keshav

 
 Join us in #sagemath on irc.freenode.net !

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


-- 
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: printing the string html

2011-12-21 Thread Carl Eberhart
So I see.  Thanks.
On Wed, Dec 21, 2011 at 10:31 AM, John H Palmieri jhpalmier...@gmail.comwrote:



 On Tuesday, December 20, 2011 9:24:08 PM UTC-8, Carl Eberhart wrote:

 Are there any other html tags that don't print in sage worksheet?
 Thanks.


 It's not that html doesn't print: instead, it is interpreted as html
 code, and so is processed by the web browser.  Try

print('htmlstronghello/strong/html')

 for example.  On the other hand,

   str('html')

 prints the string.

 --
 John

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


-- 
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] printing the string html

2011-12-20 Thread Carl Eberhart
Are there any other html tags that don't print in sage worksheet?
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] Re: Sage account cracked?

2011-12-19 Thread Carl Eberhart


On Dec 19, 4:00 pm, Jason Grout jason-s...@creativetrax.com wrote:
 On 12/19/11 3:41 PM, andres.ordonez wrote:

  Hi, I signed in today at 'Try Sage Online' and the first notebook was
  called 'Sagemath owned', the field 'Owner, collaborations' was
  'mathfux99 / *Mayra7*, 000Devin, 01sharpka, 0617, 091002107, ...', and
  the notebook was published.

  This was obviously not done by me, I doubt that someone got access to
  my account due to a 'mistake' I made, since I only use linux, my
  passwords are strong and the message suggests that the server was
  attacked.

  Should I worry about this?

 it looks like someone may have just shared their worksheet with everyone
 on the sage server.  You don't need to worry about this; nothing was
 compromised.

 However, it does highlight that we probably don't want any user being
 able to arbitrarily share a worksheet with any other arbitrary user.  It
 would be better if the recipient was asked if they wanted the shared
 worksheet.

 Thanks,

 Jason

It appears that if someone shares a worksheet with you, you cannot
delete it from your list.
At least I wasn't able to.
What does 'Sage Owned' mean?

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

2011-12-18 Thread Carl Eberhart
Hello,
Using sage4.7.2 in VirtualBox on windows xp.
Is there a way to install ImageMagic so that I can make and look at
animated plots?
Thanks
Carl

-- 
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: installing ImageMagic

2011-12-18 Thread Carl Eberhart
o good that works.  what about installing tex?  I notice there is a
texmf directory already

On Dec 18, 1:10 pm, Volker Braun vbraun.n...@gmail.com wrote:
 sudo yum install ImageMagick

 And no there is no typo ;-)

-- 
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: installing ImageMagic

2011-12-18 Thread Carl Eberhart

On Dec 18, 3:06 pm, Volker Braun vbraun.n...@gmail.com wrote:
 There is a subdirectory in the Sage tree where SageTeX lives, apart from
 that there is no texmf directory. You can install tex  latex with

 sudo yum install texlive-latex

My mistake. Just thought  I saw it. Thanks.
I'm afraid I may not have space on my laptop to install livetex-latex
Would it take more than 1 gig?


-- 
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: installing ImageMagic

2011-12-18 Thread Carl Eberhart
df tells me that /home is 51% used with 2926476 (1-k blocks) free
and /media is 86% used with 8003960 (1-k blocks) free
On VirtualBox the Sata Controller Sage4.7.2-disk1.vmdk
showing virtual size 7.81Gig and actual size  3.83gig
What would happen if I tried the yum and there wasn't enough
space?  Does it check in advance for space?

On Dec 18, 4:49 pm, Volker Braun vbraun.n...@gmail.com wrote:
 Its less than 1 gig, but the virtual disk might not be big enough. I think
 there is only ~100MB left.

-- 
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] How to open a second terminal on fedora

2011-12-17 Thread Carl Eberhart
I am using sage4.7.2 in VirtualBox on windows xp.
I would like to have a second fedora terminal open while the notebook
server is running.  Can this be
done?  Thanks.
Carl

-- 
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] How to open a second terminal on fedora

2011-12-17 Thread Carl Eberhart
Good. I will use that one, although it is nice to also know the su
password.  The alt-F2 escape provides me with a way to work in
the one window, without killing the notebook
Thanks.

On Sat, Dec 17, 2011 at 6:29 PM, Renan Birck Pinheiro 
renan.ee.u...@gmail.com wrote:



 2011/12/17 Volker Braun vbraun.n...@gmail.com

 For the record, there is already an unprivileged user account that you
 can use: login=sage, password=sage. This is the account that the sage
 notebook server is running under.



 Indeed. I forgot about this.



 --
 Renan Birck Pinheiro - Grupo de Microeletrônicahttp://www.ufsm.br/gmicro- 
 Engenharia
 Elétrica http://www.ufsm.br/cee/UFSM http://www.ufsm.br

 http://renanbirck.blogspot.com / skype: renan.ee.ufsm



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


-- 
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] Power series expansion

2011-12-02 Thread Carl Eberhart
Hi Julie,
I'm new here, but if I understood your question, something like works to
give the power series expansion of a nice function f
about x=a

def taylor(f,a,n):
tay=f(a)
g = diff(f(x),x)
for i in range(1,n):
tay=tay+g(a)/factorial(i)*(x-a)^i
return tay

#now get the first 4 terms of the expansion of .248244^x about a=0
y=var('y')
taylor((.248244)^x,0,4)(x=y)

Then in order to get the coefficients you want, you'll need to multiply out
and collect like terms

Carl



On Fri, Dec 2, 2011 at 7:24 AM, Julie juliewilliams...@googlemail.comwrote:

 Hi all,

 I am attempting to obtain coefficients of a generating function to
 obtain probabilites, but in order to obtain the coefficients, I first
 need to expand a power series, which is necessary for my paricular
 function.
 Is there a simple way to expand such a series in sage e.g. 2^x?

 (For my exact problem, the generating function contains 2 variables (p
 and y), and when expanded up to terms where p=1 for example, I have
 the formula:
 (0.030*0.248244^y)y+0.05721*(0.248244^y)p +0.08838*(0.248244^y)

 Thus, before being able to extract the coefficients of p^0*y^0, p1,
 y1,p*y etc, I need to expand 0.248244^y as a power series - will the
 same programming also hold for this problem?)

 Many thanks,
 Julie

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


-- 
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] Power series expansion

2011-12-02 Thread Carl Eberhart
Oops! I left out a line.  Sorry

def taylor(f,a,n):
tay=f(a)
g = diff(f(x),x)
for i in range(1,n):
tay=tay+g(a)/factorial(i)*(x-a)^i
g = diff(g(x),x)
return tay
y=var('y')
taylor((.324)^x,0,4)(x=y)

Carl

On Fri, Dec 2, 2011 at 7:24 AM, Julie juliewilliams...@googlemail.comwrote:

 Hi all,

 I am attempting to obtain coefficients of a generating function to
 obtain probabilites, but in order to obtain the coefficients, I first
 need to expand a power series, which is necessary for my paricular
 function.
 Is there a simple way to expand such a series in sage e.g. 2^x?

 (For my exact problem, the generating function contains 2 variables (p
 and y), and when expanded up to terms where p=1 for example, I have
 the formula:
 (0.030*0.248244^y)y+0.05721*(0.248244^y)p +0.08838*(0.248244^y)

 Thus, before being able to extract the coefficients of p^0*y^0, p1,
 y1,p*y etc, I need to expand 0.248244^y as a power series - will the
 same programming also hold for this problem?)

 Many thanks,
 Julie

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


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