[sage-support] Re: Mac OS X 10.4 32bit G4 Support

2009-06-11 Thread paramaniac

After 9 hours of hard work, my brave PowerBook G4 800MHz 1GB managed
to compile Sage 4.0.1 :-) The result can be found here:
http://n.ethz.ch/student/lukasre/download/
The process was much easier than I thought. Interestingly, Sage became
much bigger (1.5GB) and 680MB compressed.
Now I have a question for the next release of Sage:
Are there any specific "export" commands to optimize the build for a
ppc7450 machine?

Regards,
Lukas
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Mac OS X 10.4 32bit G4 Support

2009-06-11 Thread paramaniac

After 9 hours of hard work, my brave PowerBook G4 800MHz 1GB managed
to compile Sage 4.0.1 :-) The result can be found here:
http://n.ethz.ch/student/lukasre/download/
The process was much easier than I thought. Interestingly, Sage became
much bigger (1.5GB) and 680MB compressed.
Now I have a question for the next release of Sage:
Are there any specific "export" commands to optimize the build for a
ppc7450 machine?

Regards,
Lukas
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Dimensional Analysis or Unit Conversion capability?

2009-06-11 Thread Simon King

On 12 Jun., 04:53, lenient7  wrote:
> Does SAGE have functionality for the dimensional analysis or unit
> conversion? For example, identifying dimension of energy as MASS *
> LENGTH^2 * TIME^(-2) or converting inch into meter.

I don't know how experienced you are with Sage, so, let me add one
detail to Robert's reply: "There are Python packages that do this"
means that you can install them into Sage (being on a Linux command
line)  by first doing
 sage -sh
and then do whatever necessary to install that Python package
(probably "python setup.py install"). "sage -sh" means that you enter
a Sage shell, and hence "python" refers to the Python version of Sage.

Best regards,
   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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Dimensional Analysis or Unit Conversion capability?

2009-06-11 Thread Robert Bradshaw

No, but I believe there are several Python packages that do this that  
you could install into Sage. (There was talk about adding this at one  
point, what is needed is a good list of all the best open-source  
packages out there and a discussion of which one to choose and why).

On Jun 11, 2009, at 7:53 PM, lenient7 wrote:

>
> Does SAGE have functionality for the dimensional analysis or unit
> conversion? For example, identifying dimension of energy as MASS *
> LENGTH^2 * TIME^(-2) or converting inch into meter.
>
> >


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] show(integrate(sin(x^2))) does not format correctly

2009-06-11 Thread jon

I have just installed Sage Version 4.0.1 vmware image on windows XP.
I am using the Sage notebook.
Browser is firefox 3.0.6 (with the TeX fonts installed for jsMath)
Typeset is checked in the notebook.

When I evaluate the fields in the demo page the result for the show
(integrate(sin(x^2))) does not format correctly. The latex formatted
result should be as below.

\frac{{\sqrt{ \pi } \left( {\left( {\sqrt{ 2 } i} + \sqrt{ 2 } \right)
\text{erf} \left( \frac{{\left( {\sqrt{ 2 } i} + \sqrt{ 2 } \right) x}}
{2} \right)} + {\left( {\sqrt{ 2 } i} - \sqrt{ 2 } \right) \text{erf}
\left( \frac{{\left( {\sqrt{ 2 } i} - \sqrt{ 2 } \right) x}}{2}
\right)} \right)}}{8}

(This is in the html of the flat demo page included in the install)


But when I click on evaluate the formatted result changes to this:

\frac{1}{8} \, {(\left(I - 1\right) \, \sqrt{2} \mbox{\text{erf}}\left
(\left(\frac{1}{2} I - \frac{1}{2}\right) \, \sqrt{2} x\right) + \left
(I + 1\right) \, \sqrt{2} \mbox{\text{erf}}\left(\left(\frac{1}{2} I +
\frac{1}{2}\right) \, \sqrt{2} x\right))} \sqrt{\pi}

The latex formatting is different and the square root of -1 is being
returned as I (uppercase) and not as i (lowercase).

Is there a configuration change I have to make to get my installation
to behave the same as the installation the demo page was saved on?

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Dimensional Analysis or Unit Conversion capability?

2009-06-11 Thread lenient7

Does SAGE have functionality for the dimensional analysis or unit
conversion? For example, identifying dimension of energy as MASS *
LENGTH^2 * TIME^(-2) or converting inch into meter.

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Mac OS X 10.4 32bit G4 Support

2009-06-11 Thread kcrisman

I have a 4.0.1 binary for a OSX.4 G4 (for the same reason as the OP).
I think that gsw was also making some.  I would be happy to put it
somewhere but I haven't got a clue where, nor do I have a sage.math
account to do so anyway.  I don't have an extra gig of space on an ftp
server, unfortunately :)

- kcrisman

On Jun 11, 2:58 pm, Marshall Hampton  wrote:
> I used to occaisonally build a G4 10.4 binary, but that machine's hard-
> drive died a few months ago and I don't plan on repairing it.  I'm not
> sure if the folks in Seattle have one or not.
>
> You could build from source on your machine (probably would take 4
> hours or so), it really isn't very complicated (instructions are at

PS Depending on your processor and memory, allot up to 6 hours.

> the source download page).  If you do, consider donating the binary to
> spare others that effort...
>
> -M. Hampton
>
> On Jun 11, 11:38 am, paramaniac  wrote:
>
> > Please don't forget to release a OS X 10.4 / 32bit G4 version of sage
> > 4.0.1. There are poor students amongst the users who can not afford
> > new hardware every fortnight :-)
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Mac OS X 10.4 32bit G4 Support

2009-06-11 Thread Marshall Hampton

I used to occaisonally build a G4 10.4 binary, but that machine's hard-
drive died a few months ago and I don't plan on repairing it.  I'm not
sure if the folks in Seattle have one or not.

You could build from source on your machine (probably would take 4
hours or so), it really isn't very complicated (instructions are at
the source download page).  If you do, consider donating the binary to
spare others that effort...

-M. Hampton

On Jun 11, 11:38 am, paramaniac  wrote:
> Please don't forget to release a OS X 10.4 / 32bit G4 version of sage
> 4.0.1. There are poor students amongst the users who can not afford
> new hardware every fortnight :-)
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Mac OS X 10.4 32bit G4 Support

2009-06-11 Thread paramaniac

Please don't forget to release a OS X 10.4 / 32bit G4 version of sage
4.0.1. There are poor students amongst the users who can not afford
new hardware every fortnight :-)
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Inheritance from sage.symbolic.expression.Expression

2009-06-11 Thread Nicolas

Hi Burcin

I am still in sage-4.0... The 4.0.1 is currently building.
I am writing a piece of software whose purpose is to analyse a set of
given equations to transform them into Cellular Automata to solve
differential problems right from the formal expression. You can get
details there : http://intercell.metz.supelec.fr and there :
http://intercell.metz.supelec.fr/depot/InterCell/escapade2.handout.pdf

I have written in sage.3.4 a class that inherited from
SymbolicArithmetic (and used the __init__ as follows) :
_
if is_SymbolicExpression(eq):
eq=(eq==0)
#   SymbolicArithmetic.__init__(self,[eq,
0],operator.add)
SymbolicArithmetic.__init__(self,[eq.lhs
(),eq.rhs()],operator.sub)
elif is_SymbolicEquation(eq):
SymbolicArithmetic.__init__(self,[eq.lhs
(),eq.rhs()],operator.sub)
elif ((eq==0)|(type(eq)==bool)):# a special treatment
for the 0==0 equation
SymbolicArithmetic.__init__(self,
[x,x],operator.sub)
else:
print('arguments must be SymbolicExpression or
SymbolicEquation')


As you see, I have used a few dirty tricks to work around a few bugs
but it worked.

My purpose is to add to this inherited class a few methods that will
analyse this equation (count the functions in, determine their
arguments, translate them...), but I definitely need to use the base
functions of symbolic arithmetic. I must thus find a way to correctly
init a subclass of Expression.

By the way, I also found a few other things that did not work with
this __init__ method, see :

sage: a=(x==1)
sage: b=(x==2)
sage: a+b
2*x == 3
sage: a=test(x==1)
sage: b=test(x==2)
sage: a+b
2*x == 3
sage: a=(x==1)
sage: b=test(x==2)
sage: a+b
x == (x + 1 == 3)


strange, huh ?

I will try out your patch. Why do you say that does not solve my
problem ?

Thanks

Nicolas


On 11 juin, 17:12, Burcin Erocal  wrote:
> Hi Nicolas,
>
> On Thu, 11 Jun 2009 07:07:50 -0700 (PDT)
>
>
>
> Nicolas  wrote:
>
> > Hi all,
>
> > I am trying, in sage 4.0, to write a class that inherits from the new
> > sage.symbolic.expression.Expression class. I have not found any
> > precise signature for the __init__ method of that class so I suppose I
> > am doing something wrong : things seem to work, except for the
> > substitute stuff.
>
> > Here is an example of what I mean :
>
> > __
> > class test(Expression):
> >    def __init__(self,eq):
> >            Expression.__init__(self,SR,eq)
>
> > f=function("f")
> > g=function("g")
> > a=f(x)
> > b=test(f(x))
> > testa=a.substitute_function(f,g)
> > testb=b.substitute_function(f,g)
> > __
> > sage: testa
> > g(x)
> > sage: testb
> > f(x)
> > sage:
>
> > Anyone to help me out ?
>
> I don't think the __init__ function in Expression is usable as it is.
> Here is the code:
>
>     def __init__(self, SR, x=0):
>         cdef GEx exp
>         GEx_construct_pyobject(exp, x)
>         GEx_construct_ex(&self._gobj, exp)
>         self._parent = SR
>
> The line with GEx_construct_pyobject() coerces the symbolic expression
> you give it to a constant numeric object. Then, in your construction, b
> becomes a constant.
>
> sage: b.operator() # this returns None since it's a constant
> sage: t.operator()
> f
>
> After applying the patch below, the following works:
>
> --
> | Sage Version 4.0.1, Release Date: 2009-06-06                       |
> | Type notebook() for the GUI, and license() for information.        |
> --
> Loading Sage library. Current Mercurial branch is: la
> sage: from sage.symbolic.expression import Expression
> sage: class esub(Expression):
> :     def __init__(self, parent, val):
> :         Expression.__init__(self, parent, val)
> :        
> sage: f = function('f')
> sage: g = function('g')
> sage: t = f(x)
> sage: b = esub(SR, t)
> sage: b.substitute_function(f, g)
> g(x)
>
> This still doesn't solve your problem though, most methods of
> Expression will return Expression objects.
>
> sage: type(b.substitute_function(f, g))
> 
>
> Can you explain your application a little?
>
> Cheers,
> Burcin
>
> diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
> --- a/sage/symbolic/expression.pyx
> +++ b/sage/symbolic/expression.pyx
> @@ -212,9 +212,8 @@
>              sage: sage.symbolic.expression.Expression(SR, 5)
>              5
>          """
> -        cdef GEx exp
> -        GEx_construct_pyobject(exp, x)
> -        GEx_construct_ex(&self._gobj, exp)
> +        cdef Expression exp = self.coerce_in(x)
> +        GEx_construct_ex(&self._gobj, exp._gobj)
>          self._parent = SR
>
>      def __dealloc

[sage-support] Re: Inheritance from sage.symbolic.expression.Expression

2009-06-11 Thread Burcin Erocal

Hi Nicolas,

On Thu, 11 Jun 2009 07:07:50 -0700 (PDT)
Nicolas  wrote:

> 
> Hi all,
> 
> I am trying, in sage 4.0, to write a class that inherits from the new
> sage.symbolic.expression.Expression class. I have not found any
> precise signature for the __init__ method of that class so I suppose I
> am doing something wrong : things seem to work, except for the
> substitute stuff.
> 
> Here is an example of what I mean :
> 
> __
> class test(Expression):
>   def __init__(self,eq):
>   Expression.__init__(self,SR,eq)
> 
> f=function("f")
> g=function("g")
> a=f(x)
> b=test(f(x))
> testa=a.substitute_function(f,g)
> testb=b.substitute_function(f,g)
> __
> sage: testa
> g(x)
> sage: testb
> f(x)
> sage:
> 
> Anyone to help me out ?

I don't think the __init__ function in Expression is usable as it is.
Here is the code:

def __init__(self, SR, x=0):
cdef GEx exp
GEx_construct_pyobject(exp, x)
GEx_construct_ex(&self._gobj, exp)
self._parent = SR

The line with GEx_construct_pyobject() coerces the symbolic expression
you give it to a constant numeric object. Then, in your construction, b
becomes a constant.

sage: b.operator() # this returns None since it's a constant
sage: t.operator()
f


After applying the patch below, the following works:

--
| Sage Version 4.0.1, Release Date: 2009-06-06   |
| Type notebook() for the GUI, and license() for information.|
--
Loading Sage library. Current Mercurial branch is: la
sage: from sage.symbolic.expression import Expression
sage: class esub(Expression):
: def __init__(self, parent, val):
: Expression.__init__(self, parent, val)
: 
sage: f = function('f')
sage: g = function('g')
sage: t = f(x)
sage: b = esub(SR, t)
sage: b.substitute_function(f, g)
g(x)


This still doesn't solve your problem though, most methods of
Expression will return Expression objects.

sage: type(b.substitute_function(f, g))



Can you explain your application a little?

Cheers,
Burcin



diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
--- a/sage/symbolic/expression.pyx
+++ b/sage/symbolic/expression.pyx
@@ -212,9 +212,8 @@
 sage: sage.symbolic.expression.Expression(SR, 5)
 5
 """
-cdef GEx exp
-GEx_construct_pyobject(exp, x)
-GEx_construct_ex(&self._gobj, exp)
+cdef Expression exp = self.coerce_in(x)
+GEx_construct_ex(&self._gobj, exp._gobj)
 self._parent = SR
 
 def __dealloc__(self):

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Inheritance from sage.symbolic.expression.Expression

2009-06-11 Thread Nicolas

Hi all,

I am trying, in sage 4.0, to write a class that inherits from the new
sage.symbolic.expression.Expression class. I have not found any
precise signature for the __init__ method of that class so I suppose I
am doing something wrong : things seem to work, except for the
substitute stuff.

Here is an example of what I mean :

__
class test(Expression):
def __init__(self,eq):
Expression.__init__(self,SR,eq)

f=function("f")
g=function("g")
a=f(x)
b=test(f(x))
testa=a.substitute_function(f,g)
testb=b.substitute_function(f,g)
__
sage: testa
g(x)
sage: testb
f(x)
sage:

Anyone to help me out ?

Thanks to all
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: New symbolic bug?

2009-06-11 Thread Maurizio

Good point!

Honestly, I didn't catch I could use a symbolic variable as the left
hand side of the definition of an element in a dictionary, I thought
that should have always been a string

I don't know whether this has to be added in trac, and if so, where (I
imagine this should be related to new symbolic, or coercion or stuff
like that)

Thanks a lot

Regards

Maurizio

> Not sure, if it's not already onhttp://trac.sagemath.org/sage_trac/ 
> it should be. Probably due to the new symbolics. What you can do is  
> make your dictionary cicco = {x: 10}. Making strings work shouldn't  
> be too hard, that's what the a.subs(x=10) needs to handle.
>
> - 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: New symbolic bug?

2009-06-11 Thread Robert Bradshaw

On Jun 10, 2009, at 7:40 AM, Maurizio wrote:

>
> This used to work in SAGE 3.x
> I'm using SAGE 4.0.1 now
>
> sage: ciccio = {'x':10}
> sage: a = 2*x + 5
> sage: a
> 2*x + 5
> sage: a.subs(ciccio)
> -- 
> -
> TypeError Traceback (most recent call
> last)
>
> /home/nslabs/.sage/ in ()
>
> /home/nslabs/Desktop/sage-4.0.1-linux-Ubuntu_9.04-sse2-i686-Linux/
> local/lib/python2.5/site-packages/sage/symbolic/expression.so in
> sage.symbolic.expression.Expression.substitute (sage/symbolic/
> expression.cpp:13696)()
>
> /home/nslabs/Desktop/sage-4.0.1-linux-Ubuntu_9.04-sse2-i686-Linux/
> local/lib/python2.5/site-packages/sage/symbolic/expression.so in
> sage.symbolic.expression.Expression.coerce_in (sage/symbolic/
> expression.cpp:9740)()
>
> /home/nslabs/Desktop/sage-4.0.1-linux-Ubuntu_9.04-sse2-i686-Linux/
> local/lib/python2.5/site-packages/sage/structure/parent_old.so in
> sage.structure.parent_old.Parent._coerce_ (sage/structure/ 
> parent_old.c:
> 4632)()
>
> /home/nslabs/Desktop/sage-4.0.1-linux-Ubuntu_9.04-sse2-i686-Linux/
> local/lib/python2.5/site-packages/sage/structure/parent.so in
> sage.structure.parent.Parent.coerce (sage/structure/parent.c:4765)()
>
> TypeError: no canonical coercion from  to Symbolic Ring
>
> Is it a known bug?

Not sure, if it's not already on http://trac.sagemath.org/sage_trac/  
it should be. Probably due to the new symbolics. What you can do is  
make your dictionary cicco = {x: 10}. Making strings work shouldn't  
be too hard, that's what the a.subs(x=10) needs to handle.

- 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---