[sage-support] Re: Problem doing symbolic computations (bug in Pynac ?)

2010-09-29 Thread Jean-Pierre Flori
Ok, I have finally looked at the comparison functions and exchanging :
cmpval = seq[0].coeff.compare(other.exponent);
by
cmpval = -seq[0].coeff.compare(other.exponent);
in mul::compare_pow (mul.cpp:1265) seems to prevent the above bug from
happening.
It seems to fit better with the change made by William Stein in
power::compare_same_type (power.cpp:951).
However it doesn't mean the problem is completely solved...
I'll try to take a deeper look at the comparison functions at some
point.

By the way I opened another thread on sage-devel:
http://groups.google.com/group/sage-devel/browse_thread/thread/41e3f276cdf8d08d#

Regards.
On 13 sep, 16:35, kcrisman kcris...@gmail.com wrote:
  When we move to new code in sage/symbolic/summation/* (which is not in
  the library yet), things will be much cleaner.

 Can you give a ticket # for this?  I would be interested in looking at
 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] Global variables called in a function

2010-09-29 Thread Walker
Hi everybody.
I'm experiencing problems with global variables in Sage. In
particular, I noticed that if I create a global variable, that one is
known everywhere and it's possible to call it everywhere. If I make an
assignment to a variable with the same name of the global one, but
inside a function in another file, it automatically creates a local
variable and makes the global one unknown inside the function itself,
but only outside it. My question is: is there a way to make Sage not
creating a global variable but assigning directly the global one?
Thanks a lot.

-- 
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: Global variables called in a function

2010-09-29 Thread Simon King
Hi Walker!

On 29 Sep., 16:42, Walker ebwal...@gmail.com wrote:
 ... My question is: is there a way to make Sage not
 creating a global variable but assigning directly the global one?

This is actually a Python question. It would of course be very
dangerous if variables defined outside a function would influence what
happens inside a function. So, unless you explicitly declare *inside
the function* that a variable is global, it won't be visible inside
the function.

So, you could do:
sage: def f():
: global x
: print x
:
sage: x=3
sage: f()
3
sage: x=5
sage: f()
5

Cheers,
Simon

-- 
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] Global variables called in a function

2010-09-29 Thread Justin C. Walker

On Sep 29, 2010, at 07:42 , Walker wrote:

 Hi everybody.
 I'm experiencing problems with global variables in Sage. In
 particular, I noticed that if I create a global variable, that one is
 known everywhere and it's possible to call it everywhere. If I make an
 assignment to a variable with the same name of the global one, but
 inside a function in another file, it automatically creates a local
 variable and makes the global one unknown inside the function itself,
 but only outside it. My question is: is there a way to make Sage not
 creating a global variable but assigning directly the global one?

Remember that Sage uses Python as its underlying language, so (most of) the 
rules of Python apply here.  For most programming questions, the Python 
documentation will give you a lot of help.

Also, in general, a small snippet of code, showing the problem you are having, 
along with your request for help can simplify our job in helping you.

In this case, you problem seems pretty clear, and is answered by the Python doc:

In the scope of a procedure, all variables are local, not global, unless 
explicitly specified.  The way to do this is with the 'global' statement, which 
should list the global variables that you want to access within the scope of 
your procedure.

Note that if you name a variable in a global statement, and one of that name is 
not in global scope, it will be created if you assign to it.

Thus the following:

sage: def xx(n):
   ...:global fred, ralph
   ...:fred = n
   ...:
sage: xx(3)
sage: fred
 3

However, if you don't assign to a non-existent global variable, and just refer 
to it, you will get a thrown exception:

sage: def xx(n):
   ...:global fred, ralph
   ...:print ralph
   ...:
sage: xx(3)
---
NameError Traceback (most recent call last)

/Volumes/Zeppo/SandBox/Justin/sb/Sage/ipython console in module()

/Volumes/Zeppo/SandBox/Justin/sb/Sage/string in xx(n)

NameError: global name 'ralph' is not defined

HTH

Justin

--
Justin C. Walker
Curmudgeon-at-large
Director
Institute for the Absorption of Federal Funds

186,000 Miles per Second
Not just a good idea:
  it's the law!


-- 
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: Problem doing symbolic computations (bug in Pynac ?)

2010-09-29 Thread Burcin Erocal
Hi,

On Wed, 29 Sep 2010 07:00:39 -0700 (PDT)
Jean-Pierre Flori jpfl...@gmail.com wrote:

 Ok, I have finally looked at the comparison functions and exchanging :
 cmpval = seq[0].coeff.compare(other.exponent);
 by
 cmpval = -seq[0].coeff.compare(other.exponent);
 in mul::compare_pow (mul.cpp:1265) seems to prevent the above bug from
 happening.
 It seems to fit better with the change made by William Stein in
 power::compare_same_type (power.cpp:951).
 However it doesn't mean the problem is completely solved...
 I'll try to take a deeper look at the comparison functions at some
 point.

Thank you for following up on this and taking the time to go through
the comparisons.

I was planning to build on the patch I posted before [1] to fix this
problem once and for all (perhaps rather optimistically). 

[1] http://sage.math.washington.edu/home/burcin/pynac/pynac_order.patch

Note that your suggestions fixes your bug (#9880), but doesn't effect
#9046. 


Cheers,
Burcin

-- 
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: Global variables called in a function

2010-09-29 Thread Walker
It seems it has solved my issue, many thanks all of you; I'll attach a
snipped of code next time.
I knew Sage is based on Pyton, but what I don't know is where the
first ends and the second begins, so I usually think my issue is a
Sage's one...
Anyway, thank you: it was helpful.

-- 
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: Global variables called in a function

2010-09-29 Thread Robert Bradshaw
On Wed, Sep 29, 2010 at 8:18 AM, Simon King simon.k...@nuigalway.ie wrote:
 Hi Walker!

 On 29 Sep., 16:42, Walker ebwal...@gmail.com wrote:
 ... My question is: is there a way to make Sage not
 creating a global variable but assigning directly the global one?

 This is actually a Python question.

Yes.

 It would of course be very
 dangerous if variables defined outside a function would influence what
 happens inside a function.

No, that's the expected and useful behavior. Otherwise you couldn't
even call other functions from your function (as they are just
variables).

 So, unless you explicitly declare *inside
 the function* that a variable is global, it won't be visible inside
 the function.

 So, you could do:
 sage: def f():
 :     global x
 :     print x
 :
 sage: x=3
 sage: f()
 3
 sage: x=5
 sage: f()
 5

Your f will have the same behavior even if x is not declared global.
It works just as it does in Python. Global variables are by default
readable but not writeable from the local scope, so if you do an
assignment and don't declare a variable to be global, then a local
shadow will be created. (Function arguments are considered assignments
as well.) In other words, variable declaration in Python is done by
assignment (as opposed to other languages where it is explicit). An
example is worth a thousand words:


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

- Robert

-- 
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: Problem doing symbolic computations (bug in Pynac ?)

2010-09-29 Thread Jean-Pierre Flori
Hi,

Maybe it is a good thing to keep the same order as ginac internally
and your more usual ordering for printing.
However if you'd better not duplicate code, I can look at the -
x^2+x^2 part of bug #9046.
Now I may understand a big enough part of pynac code to do that.
But if you'd better use the above patch, that won't be necessary.

Cheers,

On 29 sep, 17:33, Burcin Erocal bur...@erocal.org wrote:
 Hi,

 On Wed, 29 Sep 2010 07:00:39 -0700 (PDT)

 Jean-Pierre Flori jpfl...@gmail.com wrote:
  Ok, I have finally looked at the comparison functions and exchanging :
  cmpval = seq[0].coeff.compare(other.exponent);
  by
  cmpval = -seq[0].coeff.compare(other.exponent);
  in mul::compare_pow (mul.cpp:1265) seems to prevent the above bug from
  happening.
  It seems to fit better with the change made by William Stein in
  power::compare_same_type (power.cpp:951).
  However it doesn't mean the problem is completely solved...
  I'll try to take a deeper look at the comparison functions at some
  point.

 Thank you for following up on this and taking the time to go through
 the comparisons.

 I was planning to build on the patch I posted before [1] to fix this
 problem once and for all (perhaps rather optimistically).

 [1]http://sage.math.washington.edu/home/burcin/pynac/pynac_order.patch

 Note that your suggestions fixes your bug (#9880), but doesn't effect
 #9046.

 Cheers,
 Burcin

-- 
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: Problem doing symbolic computations (bug in Pynac ?)

2010-09-29 Thread Jean-Pierre Flori
My first guess for #9046 is that the problem is located within the
last line of collect : return x + (*this-x).expand();
In that case (*this-x).expand() should be zero but looks like:
-x^2 - 2*y^3 - y^2*z + x^2 + 2*y^3 + y^2*z
I think that whithin the call to expand(),
expairseq::combine_same_terms_sorted_seq() is called after
canonicalize(); but with the new order x^2 and -x^2, etc. are not
adjacent and do not get simplified... whence the above expression for
(*this-x).expand() and finally for p.collect(x).
I'll look at the ordering problem causing that tomorrow.

On 29 sep, 18:48, Jean-Pierre Flori jpfl...@gmail.com wrote:
 Hi,

 Maybe it is a good thing to keep the same order as ginac internally
 and your more usual ordering for printing.
 However if you'd better not duplicate code, I can look at the -
 x^2+x^2 part of bug #9046.
 Now I may understand a big enough part of pynac code to do that.
 But if you'd better use the above patch, that won't be necessary.

 Cheers,

 On 29 sep, 17:33, Burcin Erocal bur...@erocal.org wrote:

  Hi,

  On Wed, 29 Sep 2010 07:00:39 -0700 (PDT)

  Jean-Pierre Flori jpfl...@gmail.com wrote:
   Ok, I have finally looked at the comparison functions and exchanging :
   cmpval = seq[0].coeff.compare(other.exponent);
   by
   cmpval = -seq[0].coeff.compare(other.exponent);
   in mul::compare_pow (mul.cpp:1265) seems to prevent the above bug from
   happening.
   It seems to fit better with the change made by William Stein in
   power::compare_same_type (power.cpp:951).
   However it doesn't mean the problem is completely solved...
   I'll try to take a deeper look at the comparison functions at some
   point.

  Thank you for following up on this and taking the time to go through
  the comparisons.

  I was planning to build on the patch I posted before [1] to fix this
  problem once and for all (perhaps rather optimistically).

  [1]http://sage.math.washington.edu/home/burcin/pynac/pynac_order.patch

  Note that your suggestions fixes your bug (#9880), but doesn't effect
  #9046.

  Cheers,
  Burcin



-- 
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] creating a test environment

2010-09-29 Thread Johannes
Hi list,
is it possible to create in a given environment in sage a new one, which
know all in the parent defined variables and values, and i i leave it
again, ijust get back to my old values?
i'd like to have this, because i have to test and compare different
calculations based on the same data (polygons with variables in the
coordinates of the vertices).
I hope i could explain what i'm looking for, and for sure, i hope
something like this exists ;)

greatz Johanne

-- 
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: Problem doing symbolic computations (bug in Pynac ?)

2010-09-29 Thread Burcin Erocal
On Wed, 29 Sep 2010 09:48:25 -0700 (PDT)
Jean-Pierre Flori jpfl...@gmail.com wrote:

 Maybe it is a good thing to keep the same order as ginac internally
 and your more usual ordering for printing.

It is good to keep the ginac ordering internally. The user friendly
ordering is more expensive so it slows down computations, even when
you don't print intermediate expressions.

 However if you'd better not duplicate code, I can look at the -
 x^2+x^2 part of bug #9046.
 Now I may understand a big enough part of pynac code to do that.

That's right. You're one of the few people who spent so much time
staring at pynac code. :)

 But if you'd better use the above patch, that won't be necessary.

I would like to replace the orders completely. I wanted to attack
this problem for a long time. Now that we started, we might as
well finish. :)

Can you help put the patch in usable shape? At the moment the ordering
it defines is completely different from the one we use in Sage. This
must be because I changed some signs while I was copying code.

If you can make the ordering consistent, I can fix the other relevant
places (op(), etc.).


Thanks.

Burcin

-- 
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: Problem doing symbolic computations (bug in Pynac ?)

2010-09-29 Thread Jean-Pierre Flori


On 29 sep, 20:28, Burcin Erocal bur...@erocal.org wrote:
 On Wed, 29 Sep 2010 09:48:25 -0700 (PDT)

 Jean-Pierre Flori jpfl...@gmail.com wrote:
  Maybe it is a good thing to keep the same order as ginac internally
  and your more usual ordering for printing.

 It is good to keep the ginac ordering internally. The user friendly
 ordering is more expensive so it slows down computations, even when
 you don't print intermediate expressions.
My bad, I didn't read your previous post correctly, I thought that
patch reverted the change you made in the ordering, but in fact it put
these changes in separate functions and use them only for printing...
That is why I tried to fix the bug in the code without your patch...
So I guess I should work WITH the patch !

  However if you'd better not duplicate code, I can look at the -
  x^2+x^2 part of bug #9046.
  Now I may understand a big enough part of pynac code to do that.

 That's right. You're one of the few people who spent so much time
 staring at pynac code. :)

  But if you'd better use the above patch, that won't be necessary.

 I would like to replace the orders completely. I wanted to attack
 this problem for a long time. Now that we started, we might as
 well finish. :)
So once more I'm confused..
What do you mean by replace the orders completely ?
Having separate functions for internal use and printing as with what
your patch does ?
Or continue from the code before the above patch and make everything
back consistent so just one set of functions is present, even if it
can finally produce slower code ?
I guess that is because I was already confused before and what I said
may have seemed obscure..


 Can you help put the patch in usable shape? At the moment the ordering
 it defines is completely different from the one we use in Sage. This
 must be because I changed some signs while I was copying code.
I'll help with pleasure. Just want to be sure to take the right
direction !


 If you can make the ordering consistent, I can fix the other relevant
 places (op(), etc.).

 Thanks.

 Burcin

Cheers,

-- 
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: creating a test environment

2010-09-29 Thread Jason Bandlow
On 09/29/2010 01:47 PM, Johannes wrote:
 Hi list,
 is it possible to create in a given environment in sage a new one, which
 know all in the parent defined variables and values, and i i leave it
 again, ijust get back to my old values?

Is this what you're looking for?

http://www.sagemath.org/doc/tutorial/interactive_shell.html#section-save

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


Re: [sage-support] Re: Problem doing symbolic computations (bug in Pynac ?)

2010-09-29 Thread Burcin Erocal
On Wed, 29 Sep 2010 12:57:54 -0700 (PDT)
Jean-Pierre Flori jpfl...@gmail.com wrote:

 On 29 sep, 20:28, Burcin Erocal bur...@erocal.org wrote:
  On Wed, 29 Sep 2010 09:48:25 -0700 (PDT)
 
  Jean-Pierre Flori jpfl...@gmail.com wrote:
   Maybe it is a good thing to keep the same order as ginac
   internally and your more usual ordering for printing.
 
  It is good to keep the ginac ordering internally. The user friendly
  ordering is more expensive so it slows down computations, even when
  you don't print intermediate expressions.
 My bad, I didn't read your previous post correctly, I thought that
 patch reverted the change you made in the ordering, but in fact it put
 these changes in separate functions and use them only for printing...
 That is why I tried to fix the bug in the code without your patch...
 So I guess I should work WITH the patch !

Yes, please work with the patch. :)

snip
   But if you'd better use the above patch, that won't be necessary.
 
  I would like to replace the orders completely. I wanted to attack
  this problem for a long time. Now that we started, we might as
  well finish. :)
 So once more I'm confused..
 What do you mean by replace the orders completely ?
 Having separate functions for internal use and printing as with what
 your patch does ?
snip

I want to continue with the patch, to go back to using the original
comparison functions from ginac and use the new ones only for printing.


 
  Can you help put the patch in usable shape? At the moment the
  ordering it defines is completely different from the one we use in
  Sage. This must be because I changed some signs while I was copying
  code.
 I'll help with pleasure. Just want to be sure to take the right
 direction !

Thank you. Please don't hesitate to ask if you need any help.

Cheers,
Burcin

-- 
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: creating a test environment

2010-09-29 Thread Johannes
nearly, i work with save_session and load_session rigthn now, but i need
something like a fast switch between some environments like this:

do some stuff
create_snapshot(sshot1)
do some more stuff
create_snapshot(sshot2)
once again stuff
switch_snapshot(sshot1) #here sshot2 is saved in the last known stat
#here I can work with my bindings from the time i createt  sshot1
switch_snapshot(ssho2)
and once again continue with the last know state from sshot2

this could be done by writing own functions based on load/save_Session,
but i wonder if ther exists a build-in solution.

greatz Johannes


Am 29.09.2010 21:54, schrieb Jason Bandlow:
 On 09/29/2010 01:47 PM, Johannes wrote:
   
 Hi list,
 is it possible to create in a given environment in sage a new one, which
 know all in the parent defined variables and values, and i i leave it
 again, ijust get back to my old values?
 
 Is this what you're looking for?

 http://www.sagemath.org/doc/tutorial/interactive_shell.html#section-save

 Cheers,
 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] unable to start Sage notebook after VMware/Windows crash

2010-09-29 Thread Brian
Hi,

I'm using Sage in a commercial environment to perform physics
simulations of optical systems. As our computing environment is XP,
I'm running Sage on WinXP in VMware Player 3.1.0 build-261024.

This morning, after suspending my machine, the VMware player froze. I
had to either power down, or just end the VMware Player. I apologize -
I can't recall which. It was right before an important meeting, so
things were rather rushed. (What I did *not* do was end VMware Player
using the Task Manager).

When I restarted VMware Player/Sage, I was unable to access my Sage
notebook. If I run the Sage Notebook script, the window closes with
some error message to fast to read. If I start up Firefox, I can load
internet files. I can also load an HTML version of the notebook I had
saved (since I've had Sage clear out the notebook file when the server
hangss!). However, if I try to evaluate cells, I get a Searching for
Sage server message in a red box at the top of the page.

I am able to open up the notebook - which, on my system, is at /home/
sage/.sage/sage_notebook.sagenb/home/admin/10/worksheet.html. However,
it is now blank (it was not this morning - I've taken to checking
because server crashes have previously over-wrtten my running notebook
with a blank file: a bug for another day!).

However, Firefox cannot find the Sage server. If I start up Firefox, I
get a Service Temporarily Unavailable message. (The server is
temporarily unable to service your request due to maintenance downtime
or capacity problems. Please try again later. Apache/2.2.12 (Ubuntu)
Server at localhost Port 80)

The usual Point browser in MS Windows to http://xxx.xxx.xxx.xxx;
message appears.

If I start Sage from the command line, I get the following messages:


Please wait while the Sage Notebook server starts...
...
Traceback (most recent call last):
  File /home/sage/sage/local/bin/sage-notebook, line 36, in module
notebook(port=8000)
  File /home/sage/sage/local/lib/python2.6/site-packages/
sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/notebook_object.py, line
217, in __call__
return self.notebook(*args, **kwds)
  File /home/sage/sage/local/lib/python2.6/site-packages/
sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/run_notebook.py, line 174,
in notebook_twisted
nb = notebook.load_notebook(directory)
  File /home/sage/sage/local/lib/python2.6/site-packages/
sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/notebook.py, line 1706, in
load_notebook
nb = Notebook(dir)
  File /home/sage/sage/local/lib/python2.6/site-packages/
sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/notebook.py, line 88, in
__init__
self.__conf = S.load_server_conf()
  File /home/sage/sage/local/lib/python2.6/site-packages/
sagenb-0.7.5.3-py2.6.egg/sagenb/storage/filesystem_storage.py, line
183, in load_server_conf
return self._basic_to_server_conf(self._load('conf.pickle'))
  File /home/sage/sage/local/lib/python2.6/site-packages/
sagenb-0.7.5.3-py2.6.egg/sagenb/storage/filesystem_storage.py, line
134, in _load
return cPickle.load(open(self._abspath(filename)))
EOFError


Can anyone tell me how to get the Sage server running/functional/
accessible again?

On a related note, can anyone tell me how to execute Sage on my
stored HTML (produced by Firefox Save As rather than the notebook's
Save button)?

Any help would be greatly appreciated, as the project lumbers on in
desperate and immediate need of these optical simulations!

Regards,

Brian King

-- 
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: Matrices over FreeMonoid-linear combinations

2010-09-29 Thread mhs
Hi again,

in the meantime I made some progress on my problem:

I use FreeMonoid to generate the set of finite words, I use FormalSums
over the integers to get the linear combinations and I wrote a simple
method to multiply two such formal sums (should this go into the class
of FormalSums?).

The problem I am left with is that I can not just define matrices with
entries such formal sums, as SAGE can not find a ring containing them
(this should be the ring of formal sums I guess).

Is there any way to generate this ring or to tell SAGE how to handle/
generate those matrices?
(I would prefer this in order to avoid writing my own methods to
define and handle those matrices.)

Any ideas?

Best
M.


On Sep 28, 7:35 pm, mhs schraud...@math.uni-heidelberg.de wrote:
 Hi sage-support readers,

 I would like to know if there is any way to construct special matrices
 as follows:

 Start with a FreeMonoid on n generators a,b,c,
 Now (like in the case of a group ring) form linear combinations with
 NON-NEGATIVE integer coeffs of elements of this FreeMonoid, an example
 of such an element would be
 5*aa+2*ababba+ba
 (Is there a name for this algebraic structure?)

 What I would like to define in SAGE is the space of matrices with
 entries in those symbolic linear combinations, where the usual
 arithmetic operations for matrices like sum, product etc. are working.
 Is there any SAGE class which is close to doing this?
 If not (i.e. if I have to implement this algebraic construct), what
 base objects/classes should I use?

 Is it possible to define a class of matrices over algebraic structures
 which are not a ring (as in the case above)?

 Looking forward to any clues. Thanks.
 M.

-- 
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: unable to start Sage notebook after VMware/Windows crash

2010-09-29 Thread Brian
cont'd.
Oops. my apologies, I have Sage 4.4.alpha0 running on that VMware
player 3.1.0 build-261024...

Brian

On Sep 29, 1:31 pm, Brian brian.k...@fantasia.net wrote:
 Hi,

 I'm using Sage in a commercial environment to perform physics
 simulations of optical systems. As our computing environment is XP,
 I'm running Sage on WinXP in VMware Player 3.1.0 build-261024.

 This morning, after suspending my machine, the VMware player froze. I
 had to either power down, or just end the VMware Player. I apologize -
 I can't recall which. It was right before an important meeting, so
 things were rather rushed. (What I did *not* do was end VMware Player
 using the Task Manager).

 When I restarted VMware Player/Sage, I was unable to access my Sage
 notebook. If I run the Sage Notebook script, the window closes with
 some error message to fast to read. If I start up Firefox, I can load
 internet files. I can also load an HTML version of the notebook I had
 saved (since I've had Sage clear out the notebook file when the server
 hangss!). However, if I try to evaluate cells, I get a Searching for
 Sage server message in a red box at the top of the page.

 I am able to open up the notebook - which, on my system, is at /home/
 sage/.sage/sage_notebook.sagenb/home/admin/10/worksheet.html. However,
 it is now blank (it was not this morning - I've taken to checking
 because server crashes have previously over-wrtten my running notebook
 with a blank file: a bug for another day!).

 However, Firefox cannot find the Sage server. If I start up Firefox, I
 get a Service Temporarily Unavailable message. (The server is
 temporarily unable to service your request due to maintenance downtime
 or capacity problems. Please try again later. Apache/2.2.12 (Ubuntu)
 Server at localhost Port 80)

 The usual Point browser in MS Windows tohttp://xxx.xxx.xxx.xxx;
 message appears.

 If I start Sage from the command line, I get the following messages:

 
 Please wait while the Sage Notebook server starts...
 ...
 Traceback (most recent call last):
   File /home/sage/sage/local/bin/sage-notebook, line 36, in module
     notebook(port=8000)
   File /home/sage/sage/local/lib/python2.6/site-packages/
 sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/notebook_object.py, line
 217, in __call__
     return self.notebook(*args, **kwds)
   File /home/sage/sage/local/lib/python2.6/site-packages/
 sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/run_notebook.py, line 174,
 in notebook_twisted
     nb = notebook.load_notebook(directory)
   File /home/sage/sage/local/lib/python2.6/site-packages/
 sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/notebook.py, line 1706, in
 load_notebook
     nb = Notebook(dir)
   File /home/sage/sage/local/lib/python2.6/site-packages/
 sagenb-0.7.5.3-py2.6.egg/sagenb/notebook/notebook.py, line 88, in
 __init__
     self.__conf = S.load_server_conf()
   File /home/sage/sage/local/lib/python2.6/site-packages/
 sagenb-0.7.5.3-py2.6.egg/sagenb/storage/filesystem_storage.py, line
 183, in load_server_conf
     return self._basic_to_server_conf(self._load('conf.pickle'))
   File /home/sage/sage/local/lib/python2.6/site-packages/
 sagenb-0.7.5.3-py2.6.egg/sagenb/storage/filesystem_storage.py, line
 134, in _load
     return cPickle.load(open(self._abspath(filename)))
 EOFError
 

 Can anyone tell me how to get the Sage server running/functional/
 accessible again?

 On a related note, can anyone tell me how to execute Sage on my
 stored HTML (produced by Firefox Save As rather than the notebook's
 Save button)?

 Any help would be greatly appreciated, as the project lumbers on in
 desperate and immediate need of these optical simulations!

 Regards,

 Brian King

-- 
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] unable to start Sage notebook after VMware/Windows crash

2010-09-29 Thread Dan Drake
On Wed, 29 Sep 2010 at 01:31PM -0700, Brian wrote:
 If I start Sage from the command line, I get the following messages:

 
 Please wait while the Sage Notebook server starts...
 ...
 Traceback (most recent call last):
[...]
   File /home/sage/sage/local/lib/python2.6/site-packages/
 sagenb-0.7.5.3-py2.6.egg/sagenb/storage/filesystem_storage.py, line
 134, in _load
 return cPickle.load(open(self._abspath(filename)))
 EOFError

According to the Python documentation, EOFError is raised when Python
expects some data from a file, but doesn't get any. My guess is that the
virtual machine got shut down improperly, and some files didn't get
written to disk correctly (or not at all). I'm not sure what to do to
fix this. One guess is to edit the filesystem_storage.py file, and just
above line 134, put something like print self._abspath(filename) to
figure out what file it is looking for.

Dan

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


signature.asc
Description: Digital signature


[sage-support] [sage-newbie] 3d plotting doesn't work

2010-09-29 Thread Benjamin Parker
I'm assuming its supposed to run gnuplot...?

I have sage compiled from source code on one computer and am running
the Ubuntu version on another. Both computers are using Debian. The
command doesn't output any error messages; it just pauses and returns
to the prompt.

I've installed gnuplot through sage but this didn't fix it. Any help
would be appreciated.

-- 
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-newbie] 3d plotting doesn't work

2010-09-29 Thread Jason Grout

On 9/29/10 9:18 PM, Benjamin Parker wrote:

I'm assuming its supposed to run gnuplot...?

I have sage compiled from source code on one computer and am running
the Ubuntu version on another. Both computers are using Debian. The
command doesn't output any error messages; it just pauses and returns
to the prompt.

I've installed gnuplot through sage but this didn't fix it. Any help
would be appreciated.




Sage actually uses JMOL (a 3d java graphics viewer), not gnuplot.  So 
you need java installed.  Do you have it installed (the sun jdk seems to 
work best).


Also, it would probably be better to ask on the sage-support mailing 
list.  I don't know how many people read this list, and I think this is 
the first message I've seen on it in a long time.  I didn't even know it 
still existed until I just saw your message.


Jason

--
Jason Grout

--
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-newbie] 3d plotting doesn't work

2010-09-29 Thread Jason Grout

On 9/29/10 9:29 PM, Jason Grout wrote:


Also, it would probably be better to ask on the sage-support mailing
list. I don't know how many people read this list, and I think this is
the first message I've seen on it in a long time. I didn't even know it
still existed until I just saw your message.



My apologies.  I saw the [sage-newbie] in front of the subject, which 
looks like the normal mailing list name.  I forgot that I was actually 
reading the sage-support mailing list.  So please ignore the above 
paragraph.


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: unable to start Sage notebook after VMware/Windows crash

2010-09-29 Thread Brian
Thanks, Dan.
I'll give that a try. I had figured that was probably the case - but
had no way to efficiently figure out what had gotten chomped on by the
crash, as I'm very far from a Python guru.

Brian

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