[sage-support] Re: question on using integral() in sage. Fourier transform of unit step function.

2008-09-22 Thread David Joyner

It doesn't converge because in your first post you said

assume(f>0)

Its convergence is the same as

integral(  cos(2 * pi * f * t), t , 0 , Infinity)

(think about area under a curve...). By the way, sage gives:

sage: t = var("t")
sage: x = var("x")
sage: assume(x>0)
sage: integral(  cos(2 * pi * x * t), t , 0 , Infinity)
ind

What is "ind"?


On Mon, Sep 22, 2008 at 3:18 AM, Nasser Abbasi <[EMAIL PROTECTED]> wrote:
>
>
>
> On Sep 21, 10:34 pm, Nasser Abbasi <[EMAIL PROTECTED]> wrote:
>> Let me rewrite what I wrote in last post again, since it did not
>> format well.
>>
>
> I think it is still not clear, so I wrote it in latex via SW, here it
> is again as screen image and PDF file
>
> http://12000.org/tmp/092108/eq.gif
>
> http://12000.org/tmp/092108/eq.pdf
>
> I hope this is more clear.
>
> Nasser
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: question on using integral() in sage. Fourier transform of unit step function.

2008-09-21 Thread David Joyner

This integral doesn't converge. Why do you think Sage should return
what Mma does?


On Sat, Sep 20, 2008 at 11:58 PM, Nasser Abbasi <[EMAIL PROTECTED]> wrote:
>
> Hello;
> I am a sage  newbie. I'd like to find out how to make Sage give me
> this same result that I get in Mathematica.
>
> This is what I typed (I do not know how to cut/paste from the VMWare
> player console to her yet, so if there is a typo it is because of
> this).
>
> f=var('f')
> assume(f>0)
> integral(  e^(-I * 2 * pi * f * t), t , 0 , Infinity)
>
> The answer I get starts with
>
> limit(sin(2*pi*f*t),t,   etc...etc...
>
>
> Is there a way to tell Sage to give me this answer I get from
> Mathematica?
>
> Assuming[Im[f] < 0, Integrate[Exp[(-I)*2*Pi*f*t], {t, 0, Infinity}]]
> -(I/(2*f*Pi))
>
> Thanks,
> Nasser
>
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Python Imaging Library

2008-09-16 Thread David Joyner

Besides Timothy's suggestion, you might be able to install PIL on top of
Sage using

sage -i PIL-1.1.5

It is listed among Sage's experimental packages at
http://www.sagemath.org/packages/experimental/
(which means it might work and it might not:-).


On Tue, Sep 16, 2008 at 2:56 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have installed Python Imaging Library (PIL) on my Linux box, I can
> access it in python however I don't have access to PIL functions while
> working with Sage.
>
> My configuration: Sage 3.1.1, PIL 1.1.5, python 2.4.4
>
> Is there any command line parameter I can pass to Sage in order to use
> PIL in Sage ? Can you help me to find a solution please ?
>
> Thanks in advance for your nice reply, have a nice day,
>
> jerome.landre
> University of Reims
> France
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] bug in sage -clone for 3.1.2.rc4?

2008-09-15 Thread David Joyner

Hi:

After building 3.1.2.rc4 I got the following error when I tried to create a
clone:



SAGE build/upgrade complete!
[EMAIL PROTECTED]:~/sagefiles/sage-3.1.2.rc4$ ./sage -clone dbl-coset
  File "/home/wdj/sagefiles/sage-3.1.2.rc4/local/bin/sage-clone", line 71
echo 'Pbuild is currently broken -- defaulting to serial build.'
   ^
SyntaxError: invalid syntax

real0m0.043s
user0m0.018s
sys 0m0.006s


Does this make any sense?

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Integral problems

2008-09-15 Thread David Joyner

On Mon, Sep 15, 2008 at 1:06 PM, Sand Wraith <[EMAIL PROTECTED]> wrote:
>
> i've find anothe way to solve my problems with rect-function:
> rect=lambda x: Piecewise([
> [(-infinity,-1),(lambda x:0)],
> [(- 1, 1),(lambda x:1)],
> [( 1, infinity),(lambda x:0)]
> ])(x);
>
> now:
> plot(rect,-4,4)
> works, and:
> f=lambda x: rect(x)*x^2;
> plot(f,-4,4)
> works too :-)


Cool! I didn't know these would work. Thanks!


>
> but now if want to use my function again, i can not:
> g(x)=1+f(x)
> so i must use only:
> g=lambda x:1+f(x)
> (and show(plot(g,-4,4),ymin=0) or numerical_integral(g,-4,4) works
> fine).
>
> definition like "g(x)=1+f(x)" is more comfort for me (
>
> On Sep 15, 8:25 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>> On Mon, Sep 15, 2008 at 11:10 AM, Sand Wraith <[EMAIL PROTECTED]> wrote:
>>
>> > On Sep 13, 2:35 am, Jason Merrill <[EMAIL PROTECTED]> wrote:
>> >> On Sep 12, 4:48 pm, Sand Wraith <[EMAIL PROTECTED]> wrote:
>>
>> >> > Hi all! Help please again :-)
>>
>> >> > here is worksheet describes my problem:
>>
>> >> >http://75.75.6.176/home/pub/8/
>>
>> >> > so, at the last stem i have wrong result: 0 instead of 2/3.
>>
>> >> > what i am doing wrong?
>>
>> >> It looks like there are a few problems here, but the main thing is
>> >> that when you call myrect(x), it just returns 0.
>>
>> >> def rect(tau=0,t=0):
>> >>if (t==tau) or (t==-tau):
>> >>return 0.5
>> >>elif (t>-tau) and (t> >>return 1
>> >>else:
>> >>return 0;
>>
>> >> def myrect(x):
>> >>return rect(1,x);
>>
>> >> sage: myrect(x)
>> >> 0
>>
>> >> The reason is that when you compare a symbolic variable, x, to a
>> >> number, 1, and force sage to come up with a True or False answer, as
>> >> if and elif do, the answer is basically always False.
>>
>> >> sage: bool(x == 1)
>> >> False
>> >> sage: bool(x < 1)
>> >> False
>> >> sage: bool(x > 1)
>> >> False
>> >> sage: bool(x < -1)
>> >> False
>>
>> >> etc.
>>
>> >> Because of this, when you call myrect(x), things fall down to the last
>> >> branch of your definition.  When an expression appears as an argument
>> >> to a function, it is evaluated *before* the function is called.  For
>> >> instance, look at
>>
>> >> sage: plot(myrect(x),(x,-3,3)) # The line segment y == 0
>>
>> >> In this case, myrect(x) evaluates to 0 *before* plot has a chance to
>> >> pass in any values, and the same thing is happening to integral.
>>
>> >> I'd like to tell you that you can do what you want using piecewise, or
>> >> something like that, but actually I don't see any way at all to make
>> >> integral, which needs something that can act like a SymbolicExpression
>> >> as its first argument, do what you want.  Maybe someone else will
>> >> know.
>>
>> >> Regards,
>>
>> >> JM
>>
>> > I have redefine rect function:
>> > rect=Piecewise([
>> > [(-10,-1),(lambda x:0)],
>> > [(- 1, 1),(lambda x:1)],
>> > [( 1, 10),(lambda x:0)]
>> > ]);
>>
>> > and i have another two questions:
>>
>> > 1) rect.plot() - is it the only way of plotting? i'd like to use
>>
>> Yes, this is the only way to plot rect at the moment.
>>
>> > plot(rect,-4,4), but it leads to error:
>>
>> >>verbose 0 (3729: plot.py, __call__) there were 4 extra arguments
>> >>(besides  at 0xa9382cc>)
>> >>Traceback (click to the left for traceback)
>> >>...
>> >>UnboundLocalError: local variable 'G' referenced before assignment
>>
>> > 2)How can i define another function like rect*f(x) ? and plot it?
>>
>> For some reason, * is not working. You can just redefine your
>> function: for example,
>>
>> rect2 = Piecewise([[(-10,-1),(lambda x:0)], [(- 1, 1),(lambda
>> x:sin(x))], [( 1, 10),(lambda x:0)]])
>>
>>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Integral problems

2008-09-15 Thread David Joyner

On Mon, Sep 15, 2008 at 11:10 AM, Sand Wraith <[EMAIL PROTECTED]> wrote:
>
>
>
> On Sep 13, 2:35 am, Jason Merrill <[EMAIL PROTECTED]> wrote:
>> On Sep 12, 4:48 pm, Sand Wraith <[EMAIL PROTECTED]> wrote:
>>
>> > Hi all! Help please again :-)
>>
>> > here is worksheet describes my problem:
>>
>> >http://75.75.6.176/home/pub/8/
>>
>> > so, at the last stem i have wrong result: 0 instead of 2/3.
>>
>> > what i am doing wrong?
>>
>> It looks like there are a few problems here, but the main thing is
>> that when you call myrect(x), it just returns 0.
>>
>> def rect(tau=0,t=0):
>>if (t==tau) or (t==-tau):
>>return 0.5
>>elif (t>-tau) and (t>return 1
>>else:
>>return 0;
>>
>> def myrect(x):
>>return rect(1,x);
>>
>> sage: myrect(x)
>> 0
>>
>> The reason is that when you compare a symbolic variable, x, to a
>> number, 1, and force sage to come up with a True or False answer, as
>> if and elif do, the answer is basically always False.
>>
>> sage: bool(x == 1)
>> False
>> sage: bool(x < 1)
>> False
>> sage: bool(x > 1)
>> False
>> sage: bool(x < -1)
>> False
>>
>> etc.
>>
>> Because of this, when you call myrect(x), things fall down to the last
>> branch of your definition.  When an expression appears as an argument
>> to a function, it is evaluated *before* the function is called.  For
>> instance, look at
>>
>> sage: plot(myrect(x),(x,-3,3)) # The line segment y == 0
>>
>> In this case, myrect(x) evaluates to 0 *before* plot has a chance to
>> pass in any values, and the same thing is happening to integral.
>>
>> I'd like to tell you that you can do what you want using piecewise, or
>> something like that, but actually I don't see any way at all to make
>> integral, which needs something that can act like a SymbolicExpression
>> as its first argument, do what you want.  Maybe someone else will
>> know.
>>
>> Regards,
>>
>> JM
>
> I have redefine rect function:
> rect=Piecewise([
> [(-10,-1),(lambda x:0)],
> [(- 1, 1),(lambda x:1)],
> [( 1, 10),(lambda x:0)]
> ]);
>
> and i have another two questions:
>
> 1) rect.plot() - is it the only way of plotting? i'd like to use


Yes, this is the only way to plot rect at the moment.


> plot(rect,-4,4), but it leads to error:
>
>>verbose 0 (3729: plot.py, __call__) there were 4 extra arguments
>>(besides  at 0xa9382cc>)
>>Traceback (click to the left for traceback)
>>...
>>UnboundLocalError: local variable 'G' referenced before assignment
>
> 2)How can i define another function like rect*f(x) ? and plot it?


For some reason, * is not working. You can just redefine your
function: for example,

rect2 = Piecewise([[(-10,-1),(lambda x:0)], [(- 1, 1),(lambda
x:sin(x))], [( 1, 10),(lambda x:0)]])


> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: can't plot a Bessel function

2008-09-11 Thread David Joyner

I don't know what the problem is. Here is a workaround:

sage: list_plot([(t,bessel_J(1,1+9*t/100)) for t in range(100)],
plotjoined=True)


On Thu, Sep 11, 2008 at 4:25 AM, Dan Drake <[EMAIL PROTECTED]> wrote:
>
> Certainly I must be doing something dumb, but I can't figure out what. I do
>
>  t = var('t')
>  plot(bessel_J(1, t), (t, 1, 10))
>
> and I get:
>
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/Users/dan/.sage/sage_notebook/worksheets/admin/1/code/27.py",
> line 8, in 
>plot(bessel_J(Integer(1), t), (t, Integer(1), Integer(10)))
>  File 
> "/Applications/sage/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/",
> line 1, in 
>
>  File 
> "/Applications/sage/local/lib/python2.5/site-packages/sage/functions/special.py",
> line 527, in bessel_J
>b = K(nu.besselj(z))
>  File "real_mpfr.pyx", line 352, in
> sage.rings.real_mpfr.RealField.__call__ (sage/rings/real_mpfr.c:4046)
>  File "real_mpfr.pyx", line 819, in
> sage.rings.real_mpfr.RealNumber._set (sage/rings/real_mpfr.c:6834)
> TypeError: Unable to convert x
> (='1-1/8*t^2+1/192*t^4-1/9216*t^6+1/737280*t^8-1/88473600*t^10+1/14863564800*t^12-1/3329438515200*t^14+1/958878292377600*t^16+O(t^17)')
> to real number.
>
>
> This is with Sage 3.1.1 on OS X. I have no trouble evaluating
> bessel_J, so why can't it plot the function?
>
> Dan
>
> --
> --- Dan Drake <[EMAIL PROTECTED]>
> - KAIST Department of Mathematical Sciences
> --- http://math.kaist.ac.kr/~drake
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Trace of Hecke Operator with large integer

2008-09-10 Thread David Joyner

On Wed, Sep 10, 2008 at 4:25 PM, Raouf <[EMAIL PROTECTED]> wrote:
>
> Hello again,
>
> I want to compute the trace of Hecke operator with large integer but
> always i have the same error message
>
> "  Traceback (click to the left for traceback)
> ...
> TypeError: n must be an int"
>
> For example if i reduce the parameter in the hecke operator (13^8) , i
> have
>
> sage:
> M1 =  ModularSymbols(21,2)
> T1 =  M1.hecke_operator(13^8)
> trace1=T1.trace()
> print trace1
>
> evaluate result:
>  2651076189
>
> but if i  increase the parameter (13^9) :
>
> sage:
> M1 =  ModularSymbols(21,2)
> T1 =  M1.hecke_operator(13^9)
> trace1=T1.trace()
> print trace1

Works for me:

sage: M1 =  ModularSymbols(21,2)
sage: T1 =  M1.hecke_operator(13^8)
sage: trace1=T1.trace()
sage: print trace1
2651076189
sage: T1 =  M1.hecke_operator(13^9)
sage: trace1=T1.trace()
sage: print trace1
34464553246
sage:


What version of Sage and what operating system are you using?



>
> evaluate result:
>
> Traceback (most recent call last):print trace1
>  File "/usr/local/sage/local/lib/python2.5/site-packages/sage/modular/
> hecke/module.py", line 860, in hecke_operator
>return self.hecke_algebra().hecke_operator(n)
>  File "/usr/local/sage/local/lib/python2.5/site-packages/sage/modular/
> hecke/algebra.py", line 186, in hecke_operator
>T = hecke_operator.HeckeOperator(self, n)
>  File "/usr/local/sage/local/lib/python2.5/site-packages/sage/modular/
> hecke/hecke_operator.py", line 362, in __init__
>raise TypeError, "n must be an int"
> TypeError: n must be an int
>
>  there is any way to go over this?
> Thank u
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How to change PATH from Sage?

2008-09-08 Thread David Joyner

On Mon, Sep 8, 2008 at 7:57 AM, Simon King <[EMAIL PROTECTED]> wrote:
>
> Dear team,
>
> in some Sage/Cython program i am also using some executables. More
> precisely, it is a Gap sub-process that needs to run these
> executables.
>
> Now i wonder whether it is possible to change my PATH from within a
> Sage session.
>
> I know that i can get the PATH with
>  sage: os.environ['PATH']
> and so i tried to change os.environ. But it didn't help, apparently
> Sage did not tell the operating system where it should look for the
> executables that the Gap process needs.
>
> What can i do?
>

I haven't tried this but I would imagine you could run a bash script
which sets the environment variables like this:

sage: !/path/to/myscript

Any system command can be run like this:

sage: !date
Mon Sep  8 08:09:12 EDT 2008


> Yours
>  Simon
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: [GAP Forum] GAP console frozen

2008-08-29 Thread David Joyner

Let me get this straight. Please correct me if I am wrong.

You sarted GAP within Sage (using sage -gap?) and then
started a long computation, whcih caused you to run out of memory.
Then GAP and Sage froze, so you rebooted and restarted Sage.
(Since you rebooted, I guess you are using windows?)
Dis Sage freeze on restart? Or was the VMware program itself frozen?
(I don't use windows, so can't help you, but I think this information will
be helpful to whoever does.)

On Fri, Aug 29, 2008 at 10:31 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> My GAP console seems to be frozen.
>
> I received the following error:
> exceeded the permitted memory ('-o' command line option at
> B!.heads := gens.heads;
> called from
> BasisVectors(B) called from...
> Entering break read-eval-print loop...
> you can 'quit' to quit to outer loop, or
> you can 'return to continue
> brk>
>
> and I typed 'return' to see if perhaps with more time, I would get a result.
> I was checking if an element was in an ideal.  For those who read my previous 
> posting about "element in ideal (more specific)", I changed Integers to 
> Rationals, and was trying "gap>R4 in I;"  This is the command that led to the 
> error above.
> After leaving the program running overnight, it seems to be frozen.  I can't 
> Cntl C to quit, or Cntrl D to exit to the SAGE console, I can't do 
> anything I closed the program, restarted the computer, and reopened the 
> program with no change.  Can anyone help?
> -Becky
>
> 
> Click to find information on your credit score and your credit report.
> http://thirdpartyoffers.juno.com/TGL2131/fc/Ioyw6iifRxYPCB3t2fuc3AfAOjqmgjQDkKVG6xW0OOA4hyC2qDba57/
>
> ___
> Forum mailing list
> [EMAIL PROTECTED]
> http://mail.gap-system.org/mailman/listinfo/forum
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Inert Integrals and Derivatives?

2008-08-29 Thread David Joyner

On Fri, Aug 29, 2008 at 8:01 AM, Robert Bradshaw
<[EMAIL PROTECTED]> wrote:
>
...

> I like the concept, though I'm also -1 on the capital/lowercase
> syntax. Perhaps integral could take an extra argument, so one would have
>
> sage: integral(x,x,0,1)
> 1/2
> sage: Integral(x,x,0,1, evaluate=False)
> \int_0^1 x\, dx


I like this! (I assume you meant integral, not Integral?)
But could you implement it in such a way that

sage: A = integral(x,x,0,1, evaluate=False)
sage: eval(A)
1/2
sage: latex(A)
\int_0^1 x\, dx

works?


>
> Or maybe a new function formal_integral?
>
> - Robert
>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Hall-Senior number vs. Small Groups library

2008-08-29 Thread David Joyner

On Fri, Aug 29, 2008 at 7:56 AM, Simon King <[EMAIL PROTECTED]> wrote:
>
> Dear all,
>
> finite 2-groups of appropriate size can be identified either by their
> number in the Small Groups library or by their Hall-Senior number.
>
> The Small Groups library is an optional part of Sage (via gap). But is
> there also some function available in Sage that translates between
> Hall-Senior and Small Groups?


I doubt it - I've never even heard of the Hall-Senior number.
How hard would it be to write one?


>
> Cheers
>  Simon
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Inert Integrals and Derivatives?

2008-08-29 Thread David Joyner

On Fri, Aug 29, 2008 at 6:24 AM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Fri, Aug 29, 2008 at 2:46 AM, David Joyner <[EMAIL PROTECTED]> wrote:
>>
>> On Fri, Aug 29, 2008 at 3:07 AM, Burcin Erocal <[EMAIL PROTECTED]> wrote:
>>>
>>> On Thu, 28 Aug 2008 15:28:03 -0400
>>> Tim Lahey <[EMAIL PROTECTED]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Maple has a really useful feature of inert integrals
>>>> and derivatives. Basically, the integrals and derivatives
>>>> show up in the equations, but aren't evaluated until
>>>> a command to evaluate them is explicitly given. So,
>>>> you can delay the evaluation until after you've processed
>>>> the expression to the point where it can be evaluated.
>>>>
>>>> This feature comes in very handy during complicated
>>>> derivations because you can see which terms are integrals
>>>> or derivatives and manipulate them along side
>>>> non-integrals/derivatives.
>>>>
>>>> Is there a way to do this in Sage?
>>>
>>> This is not supported in Sage at the moment, but it is definitely
>>> planned. It should be fairly simple to implement this using the new
>>> symbolic function interface from ginac, which allows one to specify
>>> custom simplify/automatic evaluation functions.
>>>
>>> I am not familiar with the maple syntax. Can you give some examples of
>>> how to use these features so I can play with them without having to dig
>>> through documentation?
>>
>> I agree this would be a very useful feature. Basically, something like
>>
>> (1)
>> sage: integral(x,x,0,1)
>> 1/2
>> sage: Integral(x,x,0,1)
>> \int_0^1 x\, dx
>>
>> (not the upper case I), or maybe
>
> I'm not enthuisiastic about using
> Foo and foo to denote different commands.  If we have

Okay. I just tried to answer Burcin's question of what Maple does,
using Sage as an analogy.

> two cases of the exact same word in Sage, then they should
> be aliased.  Isn't (2) below identical to (1) above?
> Or did you not mean to distinguish case above?


I think you are right. I wasn't thinking that at the time but
now I can't see a way to implement (1) and (2) differently.


>
>>
>> (2)
>> sage: A = Integral(x,x,0,1)
>> sage. latex(A)
>> \int_0^1 x\, dx
>> sage: A
>> Integral(x,x,0,1)
>>
>>>
>>>
>>> Thanks.
>>>
>>> Burcin
>>>
>>> >
>>>
>>
>> >
>>
>
>
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washington
> http://wstein.org
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Inert Integrals and Derivatives?

2008-08-29 Thread David Joyner

On Fri, Aug 29, 2008 at 3:07 AM, Burcin Erocal <[EMAIL PROTECTED]> wrote:
>
> On Thu, 28 Aug 2008 15:28:03 -0400
> Tim Lahey <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>>
>> Maple has a really useful feature of inert integrals
>> and derivatives. Basically, the integrals and derivatives
>> show up in the equations, but aren't evaluated until
>> a command to evaluate them is explicitly given. So,
>> you can delay the evaluation until after you've processed
>> the expression to the point where it can be evaluated.
>>
>> This feature comes in very handy during complicated
>> derivations because you can see which terms are integrals
>> or derivatives and manipulate them along side
>> non-integrals/derivatives.
>>
>> Is there a way to do this in Sage?
>
> This is not supported in Sage at the moment, but it is definitely
> planned. It should be fairly simple to implement this using the new
> symbolic function interface from ginac, which allows one to specify
> custom simplify/automatic evaluation functions.
>
> I am not familiar with the maple syntax. Can you give some examples of
> how to use these features so I can play with them without having to dig
> through documentation?

I agree this would be a very useful feature. Basically, something like

(1)
sage: integral(x,x,0,1)
1/2
sage: Integral(x,x,0,1)
\int_0^1 x\, dx

(not the upper case I), or maybe

(2)
sage: A = Integral(x,x,0,1)
sage. latex(A)
\int_0^1 x\, dx
sage: A
Integral(x,x,0,1)

>
>
> Thanks.
>
> Burcin
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: simplifying complex matrices

2008-08-24 Thread David Joyner

On Sun, Aug 24, 2008 at 12:20 AM, Ryan <[EMAIL PROTECTED]> wrote:
>
> I have the symbolic complex matrix:
>
> M=matrix([[1/((-1)^(1/4)*(I - 1)), (1 - I)*I/((-1)^(1/4)*(-1*I-1)*(I -
> 1))],[1/((-1)^(1/4)*(I - 1)),I/((-1)^(1/4)*(-1*I - 1))]])
>
> This matrix should simplify to a real matrix with all entries plus or
> minus 1/sqrt(2), however when I use
>
> M.simplify()

What about

sage: M.apply_map(real)

[-1/sqrt(2)  1/sqrt(2)]
[-1/sqrt(2) -1/sqrt(2)]
sage: M.apply_map(imag)

[0 0]
[0 0]


Does that help any?

>
> it doesn't simplify much at all.  Any thoughts?  My temporary solution
> has been to change the base ring to CDF, but this results in some
> small imaginary parts in the entries due to roundoff error which is
> also undesirable.
>
> Thanks.
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Plotting jacobi function fails

2008-08-23 Thread David Joyner

I don't know the cause of your problem but the following works for me

sage: f1 = lambda x: jacobi("sn",x,1)
sage: f2 = lambda x: jacobi("sn",x,2)
sage: plot(f1,(x,-3,3))

sage: plot(f2,(x,-3,3))

and hopefully is at least a workaround.


On Fri, Aug 22, 2008 at 11:01 PM, Jason Merrill <[EMAIL PROTECTED]> wrote:
>
> Plotting jacobi("sn",x,2) doesn't work, although plotting
> jacobi("sn",x,1) does work.
>
> sage: parent(plot(jacobi("sn",x,1),(x,-3,3)))
> 
>
> sage: parent(plot(jacobi("sn",x,2),(x,-3,3)))
> Callable function ring with arguments (x,)
>
> Regards,
>
> JM
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Plotting and constant functions

2008-08-21 Thread David Joyner

On Thu, Aug 21, 2008 at 1:58 PM, Mike Witt <[EMAIL PROTECTED]> wrote:
>
> This is an attempt to ask my previous question more clearly :-)

I *conjecture* (and definitely could be wrong) that your problem is related
to the issue that Sage can plot symbolic functions but constants (rather,
numerical constants which have not been coerced to the symbolic expression
ring) don't mix well with symbolic expressions. I think this will be fixed soon
but don't know what, if any, active trac tickets are related to this. You might
try coercing the expressions to the symbolic expression ring (type
?SR for details), assuming the above conjecture is roughly correct.


>
> I'm looking for a work-around for the situation where I would normally
> call parametric_plot (or plot, for that matter) with a function, and in
> some particular case that function turns out to evaluate to a constant.
>
> For example:
>
> sage: def f(a,b): return e^(a+b*I)
> :
> sage: parametric_plot([real(f(x,1)),imag(f(x,1))], -pi, pi)
>
>  Works as expected
>
> sage: parametric_plot([real(f(x,-1)),imag(f(x,-1))], -pi, pi)
>
>  Works as expected
>
> sage: parametric_plot([real(f(x,0)),imag(f(x,0))], -pi, pi)
>
>  Gives a page full of errors, which I interpret to mean that there
>  was a problem plotting because imag(f(x,0)) evaluates to a constant.
>
> I believe that this is the same issue described in:
>
> http://trac.sagemath.org/sage_trac/ticket/2410
>
> But I'm not sure. I notice that:
>
> sage: type(imag(f(x,1)))
> 
>
> and:
>
> sage: type(imag(f(x,0)))
> 
>
> So, perhaps I could use this test (at least in this particular case) to
> avoid calling parametric_plot and simply draw a line instead. But
> I wonder if there is a more general strategy. For example, a single
> test that will tell if a function if going to evaluate to any kind
> of "constant" that plot or parametric_plot will have a problem with?
>
> I'm trying to be as clear as I can about this. I'm very new to Sage,
> and I realize that I could be missing something obvious.
>
> -Mike
>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Installing Sage on a usb key for the Asus Eee PC

2008-08-20 Thread David Joyner

Sorry fr so many replied. It's been several months since I did this and I forgot
the details. If you google "asus usb permissions" you'll probably get
to these links yourself but
I think the most useful one for me was
http://wiki.eeeuser.com/execute_apps_off_sd
However, http://wiki.eeeuser.com/howto:sd_permissions might also help.


On Wed, Aug 20, 2008 at 8:18 PM, hypermonkey2 <[EMAIL PROTECTED]> wrote:
>
> Hi again!
>
> I recently tried installing sage on a usb flash drive (2gig) to be
> able to run sage on an Eee pc. However i run into trouble with the
> file permissions.
> Throughout the unpacking of the sage.tar.gz, there is trouble changing
> ownership to uid 1000.
> In a nutshell, i do not have ownership of my usb drive. how can i fix
> this?
>
> Thanks a bunch!
> cheers
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Installing Sage on a usb key for the Asus Eee PC

2008-08-20 Thread David Joyner

On Wed, Aug 20, 2008 at 11:13 PM, David Joyner <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 20, 2008 at 8:18 PM, hypermonkey2 <[EMAIL PROTECTED]> wrote:
>>
>> Hi again!
>>
>> I recently tried installing sage on a usb flash drive (2gig) to be
>> able to run sage on an Eee pc. However i run into trouble with the
>> file permissions.
>> Throughout the unpacking of the sage.tar.gz, there is trouble changing
>> ownership to uid 1000.
>> In a nutshell, i do not have ownership of my usb drive. how can i fix
>> this?
>
> There is a way to fix this I think. Pasted below are some notes I
> wrote to myself over the summer
> when I tried something like this, which may or may not help.
>

Correction: I said I wrote the notes to myself. Now i can't
remember doing this, so probably most was copied from
somewhere or an email from someone.

>
>
> Description of installing Kubuntu Hardy on an external
> SD card in an Asus EEE PC.
>
> The main problem encountered is that the SD card
> is known as (hd2,0) /dev/sdc when booting from
> an external USB stick, and as (hd1,0) /dev/sdb
> when booting from HDD or SD card.
>
> Equipment:
> - Asus EEE PC Model 701
> - 8GB removable SD Card installed
> - 2GB USB stick
>
> Procedure:
>
> Followed instructions in
>
> http://ubuntu-eee.tuxfamily.org/index.php5?title=Install:_from_a_Live_Ubuntu_image_on_a_USB_stick
>
> to make a bootable USB stick and to install Kubuntu on
> the SD card.
>
> Notes:
> - during initial screen when eee is booting, press
> Esc to get a menu to allow you to select boot
> device. Select the USB stick, of course,
> but note that the SD card also shows up as
> a USB device, so select the correct one.
> - used manual partioning during installation
> to select the 8GB SD card, which shows up
> at that time as /dev/sdc. I partioned it
> into 3 parts:
> - 4000 Kbytes ext2 /
> - 500 Kbytes swap
> - rem ext2 /files
>
> Install was pretty uneventful, though a bit slower than
> expected. Perhaps took 1 hr or so.
>
> Symptom at end:
> ===
>
> - could only boot off external USB stick
>
> - if try to boot off internal hdd, would get
> grub error 21 (missing file, apparently).
>
> - if try to boot off 8GB SD card, would get
> only blank screen
>
> Besides the device renaming problem noted above, I
> think the MBR on the SD card was also pooched.
>
> At the end, I now have a system that will dual
> boot the original Asus distributed linux or
> Kubuntu hardy on the removable SD card. It will boot
> from either the internal hdd or the removable SD card.
> On each, I get a grub boot menu, with the installation
> on that device being the default, but with the
> ability to select the linux on the other device.
>
> Here is what I eventually ending up doing:
> ==
>
> 1. boot from USB stick. At this stage
> /dev/sda = internal hdd
> /dev/sdc = removable SD
>
> 2. open a console window
>
> 3. Copy and fix grub menu entries from removable SD to
> internal hdd:
>
> cd
> mkdir sda1
> mkdir sdc1
> sudo mount /dev/sda1 sda1
> sudo mount /dev/sdc1 sdc1
>
> sudo vi sda1/boot/grub/menu.lst # internal hdd
> - comment out 'hiddenmenu' (if you want)
> - set timeout to 10 (or so)
> - copy menu entries from
> ~/sdc1/boot/grub/menu.lst (on the removable SD)
> to the end and change all occurrences of
> (hd2,0) to (hd1,0)
>
> sudo vi sda1/boot/grub/device.map # internal hdd
> - it should read to be correct when you are NOT
> booting from USB stick:
> (hd0) /dev/sda
> (hd1) /dev/sdb
>
> sudo vi sdc1/boot/grub/menu.lst # removable SD
> - comment out 'hiddenmenu' (if you want)
> - set timeout to 10 (or so)
> - copy original menu entries from
> ~/sda1/boot/grub/menu.lst (on the internal hdd)
> to the end.
> - change all occurrences in the original part of
> (hd2,0) to (hd1,0)
>
> sudo vi sdc1/boot/grub/device.map # removable SD
> - it should read to be correct when you are NOT
> booting from USB stick:
> (hd0) /dev/sda
> (hd1) /dev/sdb
>
> # the above 4 edits allow you to boot off either
> # device and still get a boot menu to select
> # which install. Probably overkill, but its
> # what I ended up with after a lot of trial and error.
>
> sudo grub-install --root-directory=sda1 /dev/sda
> sudo grub-install --root-directory=sdc1 /dev/sdc
>
> 3. To fix the MBR on the removable SD, WHILE STILL BOOTED FROM USB STICK:
>
> su
> grub
> root (hd2,0)
> setup (hd2)
> exit (or quit?)
>
> Now it should work.
>
>
>
>
>>
>> Thanks a bunch!
>> cheers
>> >>
>>
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Installing Sage on a usb key for the Asus Eee PC

2008-08-20 Thread David Joyner

On Wed, Aug 20, 2008 at 8:18 PM, hypermonkey2 <[EMAIL PROTECTED]> wrote:
>
> Hi again!
>
> I recently tried installing sage on a usb flash drive (2gig) to be
> able to run sage on an Eee pc. However i run into trouble with the
> file permissions.
> Throughout the unpacking of the sage.tar.gz, there is trouble changing
> ownership to uid 1000.
> In a nutshell, i do not have ownership of my usb drive. how can i fix
> this?

There is a way to fix this I think. Pasted below are some notes I
wrote to myself over the summer
when I tried something like this, which may or may not help.



Description of installing Kubuntu Hardy on an external
SD card in an Asus EEE PC.

The main problem encountered is that the SD card
is known as (hd2,0) /dev/sdc when booting from
an external USB stick, and as (hd1,0) /dev/sdb
when booting from HDD or SD card.

Equipment:
- Asus EEE PC Model 701
- 8GB removable SD Card installed
- 2GB USB stick

Procedure:

Followed instructions in

http://ubuntu-eee.tuxfamily.org/index.php5?title=Install:_from_a_Live_Ubuntu_image_on_a_USB_stick

to make a bootable USB stick and to install Kubuntu on
the SD card.

Notes:
- during initial screen when eee is booting, press
Esc to get a menu to allow you to select boot
device. Select the USB stick, of course,
but note that the SD card also shows up as
a USB device, so select the correct one.
- used manual partioning during installation
to select the 8GB SD card, which shows up
at that time as /dev/sdc. I partioned it
into 3 parts:
- 4000 Kbytes ext2 /
- 500 Kbytes swap
- rem ext2 /files

Install was pretty uneventful, though a bit slower than
expected. Perhaps took 1 hr or so.

Symptom at end:
===

- could only boot off external USB stick

- if try to boot off internal hdd, would get
grub error 21 (missing file, apparently).

- if try to boot off 8GB SD card, would get
only blank screen

Besides the device renaming problem noted above, I
think the MBR on the SD card was also pooched.

At the end, I now have a system that will dual
boot the original Asus distributed linux or
Kubuntu hardy on the removable SD card. It will boot
from either the internal hdd or the removable SD card.
On each, I get a grub boot menu, with the installation
on that device being the default, but with the
ability to select the linux on the other device.

Here is what I eventually ending up doing:
==

1. boot from USB stick. At this stage
/dev/sda = internal hdd
/dev/sdc = removable SD

2. open a console window

3. Copy and fix grub menu entries from removable SD to
internal hdd:

cd
mkdir sda1
mkdir sdc1
sudo mount /dev/sda1 sda1
sudo mount /dev/sdc1 sdc1

sudo vi sda1/boot/grub/menu.lst # internal hdd
- comment out 'hiddenmenu' (if you want)
- set timeout to 10 (or so)
- copy menu entries from
~/sdc1/boot/grub/menu.lst (on the removable SD)
to the end and change all occurrences of
(hd2,0) to (hd1,0)

sudo vi sda1/boot/grub/device.map # internal hdd
- it should read to be correct when you are NOT
booting from USB stick:
(hd0) /dev/sda
(hd1) /dev/sdb

sudo vi sdc1/boot/grub/menu.lst # removable SD
- comment out 'hiddenmenu' (if you want)
- set timeout to 10 (or so)
- copy original menu entries from
~/sda1/boot/grub/menu.lst (on the internal hdd)
to the end.
- change all occurrences in the original part of
(hd2,0) to (hd1,0)

sudo vi sdc1/boot/grub/device.map # removable SD
- it should read to be correct when you are NOT
booting from USB stick:
(hd0) /dev/sda
(hd1) /dev/sdb

# the above 4 edits allow you to boot off either
# device and still get a boot menu to select
# which install. Probably overkill, but its
# what I ended up with after a lot of trial and error.

sudo grub-install --root-directory=sda1 /dev/sda
sudo grub-install --root-directory=sdc1 /dev/sdc

3. To fix the MBR on the removable SD, WHILE STILL BOOTED FROM USB STICK:

su
grub
root (hd2,0)
setup (hd2)
exit (or quit?)

Now it should work.




>
> Thanks a bunch!
> cheers
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: parametric_plot and constants? multiple plots?

2008-08-19 Thread David Joyner

On Tue, Aug 19, 2008 at 8:23 PM, Mike Witt <[EMAIL PROTECTED]> wrote:
>
> Hi, I'm a long time Mathematica user who just discovered Sage a couple
> of months ago, and I'm starting to warm up to it. I have a question
> about parametric_plot.
>
> It appears that if you've got a function that evaluates to zero, then
> parametric_plot won't accept it. For example, if z(a,b)=e^(I*b + a)
> then this seems to be OK:
>
> show(animate([parametric_plot((real(z(x,b)), imag(z(x,b))), 0, 1) for
> b in srange(pi/6, 2*pi/6, pi/24)]))
>
> But if I do this:
>
> show(animate([parametric_plot((real(z(x,b)), imag(z(x,b))), 0, 1) for
> b in srange(-pi/6, 2*pi/6, pi/24)]))
>
> I have a problem, which (I *think*) is because the imaginary part of
> z(x,b) evaluates to zero during the animation.

I don't understand the question. Are you saying for the commands

sage: z = var("z")
sage: z = lambda a,b: e^(I*b + a)
sage: show(animate([parametric_plot((real(z(x,b)), imag(z(x,b))), 0,
1) for b in srange(pi/6, 2*pi/6, pi/24)]))

you have a problem? What is it exactly?


>
> And so, perhaps, this is related to Ticket #2410. On the other hand,
> it could just be some misunderstanding on my part. In any event, if
> anyone can shed any light on this I'd appreciate it.
>
> As long as I'm here, a 2nd question. Using the command line interface,
> is there any way I can spawn more than one window to render different
> plots in them at the same time? (Of, if Ticket #2380 is likely to be
> worked on in the near future, that would be even better.)  Or, if
> there is some other way to get multiple plots (from the command line)

Sorry but I don't understand this question either. Do you want something like
this:?

sage: P = plot(sin(x),x,0,1)
sage: Q = plot(cos(x),x,0,1)
sage: show(P+Q)


>
> Thanks!
>
> -Mike
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: group cohomology errors

2008-07-22 Thread David Joyner

I think you found a bug in hap 1.8.5 (in gap_packages*) which seems to be
fixed in the recently released HAP 1.8.7 (the current version available at
http://www.gap-system.org/Packages/hap.html). I will report this to trac
(or you can). I was going to wait until I get confirmation from the HAP
author Graham Ellis that this was indeed fixed, so I could be specific about the
fix.

As a workaround, you can try deleting (or renaming) the hap1.8 directory in
sage*/local/lib/gap*/pkg/ and unpacking the hap1.8.7 tarball there.
Then you have to restart gap, LoadPackage hap, and rebuild the workspace.

If you would like I can post a preliminary gap_packages-4.4.10_5.spkg somewhere
with the fixes in it today or tomorrow. Just let me know.

Sorry for the inconvenience and thank you very much for your report!



On Tue, Jul 22, 2008 at 4:53 PM, Ursula Whitcher
<[EMAIL PROTECTED]> wrote:
>
> David Joyner wrote:
>> These require HAP to be installed. Was that installed?
>
> The optional package gap_packages-4.4.10_4 is installed for sagenb.org .
>  That includes HAP, right?
>
> UAW
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: group cohomology errors

2008-07-22 Thread David Joyner

These require HAP to be installed. Was that installed?


On 7/22/08, Ursula Whitcher <[EMAIL PROTECTED]> wrote:
>
> I've been getting some errors when trying to compute H^1(G,A) for
> various groups G and finite abelian groups A.
>
> I ran these commands using a notebook at sagenb.org :
>
> G = SymmetricGroup(4)
>
> G.cohomology(1,2)
>
> and had the following error message:
>
> ***
>
> Traceback (click to the left for traceback)
> ...
>executing GroupCohomology(SymmetricGroup(4),1,2);
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/server2/sage_notebook/worksheets/Ursula/2/code/10.py",
> line 6, in 
> G.cohomology(Integer(1),Integer(2))
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sympy/
> plotting/", line 1, in 
>
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/groups/
> perm_gps/permgroup.py", line 1058, in cohomology
> L = eval(gap.eval("GroupCohomology(%s,%s,%s)"%(GG,n,p)))
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> interfaces/gap.py", line 309, in eval
> s = Expect.eval(self, x)
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> interfaces/expect.py", line 917, in eval
> return '\n'.join([self._eval_line(L, **kwds) for L in
> code.split('\n') if L != ''])
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> interfaces/gap.py", line 510, in _eval_line
> raise RuntimeError, message
> RuntimeError: Gap produced error output
> List Element:  must be a positive integer (not a integer)
>
>executing GroupCohomology(SymmetricGroup(4),1,2);
>
> ***
>
> Similarly, when I tried
>
> H = AlternatingGroup(5)
>
> H.cohomology(1,7)
>
> I received the error message:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/server2/sage_notebook/worksheets/Ursula/2/code/3.py",
> line 6, in 
> H.cohomology(Integer(1),Integer(7))
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sympy/
> plotting/", line 1, in 
>
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/groups/
> perm_gps/permgroup.py", line 1058, in cohomology
> L = eval(gap.eval("GroupCohomology(%s,%s,%s)"%(GG,n,p)))
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> interfaces/gap.py", line 309, in eval
> s = Expect.eval(self, x)
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> interfaces/expect.py", line 917, in eval
> return '\n'.join([self._eval_line(L, **kwds) for L in
> code.split('\n') if L != ''])
>   File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> interfaces/gap.py", line 510, in _eval_line
> raise RuntimeError, message
> RuntimeError: Gap produced error output
> List Element:  must be a positive integer (not a integer)
>
>executing GroupCohomology(AlternatingGroup(5),1,7);
>
> ***
>
> Some cohomology commands did work as expected:
>
> G.cohomology(2)
>
> Multiplicative Abelian Group isomorphic to C2
>
> G.cohomology(2,2)
>
> Multiplicative Abelian Group isomorphic to C2 x C2
>
> Thanks!
> Ursula.
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: No VMWare virtual machine at mirrors

2008-07-20 Thread David Joyner

They may have sync'd up by now. The mirror in Utah,
http://www.opensourcemath.org/sage/win/
seems to have it.

On Fri, Jul 18, 2008 at 11:22 PM, murray <[EMAIL PROTECTED]> wrote:
>
> I wanted to download the current VMWare virtual version from a local
> mirror, but neither of the closest two mirrors (Boston, Virginia)
> seems to have that.  They do have a link to a Windows binary
> distribution page, but of course there is not Windows binary yet.
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: CRT_vectors

2008-07-19 Thread David Joyner

I'm still not understanding what your program is trying to output.
Based on the name of the function, I'm guessing that you want
the "extended gcd", or some version of it. Type xgcd?? or XGCD??
for syntax. AFAIK, it only takes pairs, so you have to iterate it if
you want a triple, like this for the extended gcd of 56,44,12:

sage: xgcd(56, 44)
(4, 4, -5)
sage: 4*56 + (-5)*44
4
sage: xgcd(gcd(56, 44), 12)
(4, -2, 1)
sage: ((-2)*4)*56 + ((-2)*(-5))*44 + (1)*12
4

Hope this helps.



On Sat, Jul 19, 2008 at 9:45 AM, doctorantinfo <[EMAIL PROTECTED]> wrote:
>
> Ok, in input
> x is the column of a matrix(list of integers), alpha is integer , and
> i is also integer
> for example
> x= 2,5
> alpha =6
> i=1
>
> On Jul 19, 3:31 pm, "John Cremona" <[EMAIL PROTECTED]> wrote:
>> 2008/7/19 William Stein <[EMAIL PROTECTED]>:
>>
>>
>>
>>
>>
>> > On Sat, Jul 19, 2008 at 10:29 AM, doctorantinfo <[EMAIL PROTECTED]> wrote:
>>
>> >> Hello
>> >> I wrote this program in SAGE online, but i failed to find error,  I
>> >> need help
>>
>> >> def gcd_multipliers(x, alpha, i):
>> >>  fac=factor(alpha)
>> >> projections=[]
>> >> for p,v in fac:
>> >>  l=[0]*len(x);
>> >> if gcd(x[i],p)!= 1: l[i]=1;
>> >> for j in range(1, len(x)):
>> >> if gcd(x[j],p) == 1:
>> >> l[j]=1; break
>> >> projections.append(l)
>> >> return CRT_vectors(projections, [p^v for p,v in fac])
>>
>> >> Regards
>>
>> > In Python indentation is meaningful. So you have to post a program
>> > here that is correctly indendented or it isn't meaningful.
>>
>> >  -- William
>>
>> Also, if you want help debugging your program you should say what the
>> program is trying do do:  what is the input and what should be the
>> output.  Otherwise how can people help you?
>>
>> John
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Normalizing symbolic polynomial

2008-07-18 Thread David Joyner

One way:

sage: SR = SymbolicExpressionRing()
sage: a = var("a")
sage: R = LaurentPolynomialRing(SR,"t")
sage: t = R.gen()
sage: f = sqrt(a)*t+t^(-2)
sage: f.exponents()
[(1,), (-2,)]


On Sat, Jul 19, 2008 at 1:07 AM, Andrey Novoseltsev <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have a symbolic expression which is a polynomial in t and t^(-1). I
> want to multiply it by some power of t so that it is a polynomial of
> t. How can I determine this power? Coefficients are some symbolic
> expressions in other variables, e.g. sqrt(a)*t+1/t^2.
>
> Thank you,
> Andrey
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Fractional powers for polynomial variables

2008-07-18 Thread David Joyner

This looks like a bug to I reported it as
http://trac.sagemath.org/sage_trac/ticket/3678
As a work-around, maybe you could use the SymbolicExpressionRing?

On Sat, Jul 19, 2008 at 1:02 AM, Andrey Novoseltsev <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I need to substitute some variable in a polynomial ring with a
> fractional power of another one. I know that the result still will be
> a polynomial, however I have discovered the following behaviour (v.
> 3.0.5 on sage.math):
>
> sage: pr = PolynomialRing(QQ, "u,v")
> sage: pr.injvar()
> Defining u, v
> sage: u^(1/2)
> 1
> sage: pr = PolynomialRing(QQ, "w")
> sage: pr.injvar()
> Defining w
> sage: w^(1/2)
> ---
> TypeError Traceback (most recent call
> last)
>
> /home/novoselt/ in ()
>
> /home/novoselt/polynomial_element.pyx in
> sage.rings.polynomial.polynomial_element.Polynomial.__pow__ (sage/
> rings/polynomial/polynomial_element.c:8179)()
>
> /home/novoselt/element.pyx in
> sage.structure.element.RingElement.__mul__ (sage/structure/element.c:
> 8814)()
>
> /home/novoselt/coerce.pyx in
> sage.structure.coerce.CoercionModel_cache_maps.bin_op_c (sage/
> structure/coerce.c:5582)()
>
> TypeError: unsupported operand parent(s) for '*': '' and
> 'Rational Field'
> sage: sqrt(w)
> sqrt(w)
>
> Is it how things were supposed to work for some reason or a bug?
>
> Thank you,
> Andrey
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Help-- bound a 3D plot

2008-07-18 Thread David Joyner

Could you be more specific? When I do something like

sage: u,v=var("u,v")
sage: parametric_plot3d((cos(u), sin(u) + cos(v), sin(v)), (u, 0,
2*pi), (v, -pi, pi), color='green', opacity=0.1, plot_points=[30,30])

I think get the [x,y,z] limits on the framed axes, which seems to be
what you are saying
you want.


On Thu, Jul 17, 2008 at 8:34 PM, Rose <[EMAIL PROTECTED]> wrote:
>
> Hi,
>   I asked this question 3 days ago, but got no answer. This problem
> hinder me in my project. I would appreciate an answer, even if what I
> want to do is impossible.
>
> On 14 juil, 10:37, Rose <[EMAIL PROTECTED]> wrote:
>>  Hi,
>>
>> I am drawing some parametric_plot3d, but when I display them, I would
>> prefer to see the result in a box centered at the origin of side of
>> length 4 instead of all my plot, because the plot can be too large.
>>
>> In other words, I want to bound the Cartesian coordinates [x,y,z] of
>> the plot, and not the parametric space.
>>
>> Is there a way to do that?
>>
>> Rose
>
> Rose
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: raw picture manipulation

2008-07-17 Thread David Joyner

Another guess is that the X server is not started and show doesn't
know how to identify it. With imagemagick installed, I got the same error
as you, even with Xwindows started. I'm guessing that we are
not interfacing properly with the X server. It appears display has an option
for naming the Xwindows server but I don't know how to use it.
In the case of linux, I can run "display" on the command line and
imagemagick will start. With an intel mac running OS10.4, I just get
a help screen printout.

On Thu, Jul 17, 2008 at 10:26 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> On Jul 17, 8:40 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>>
>> I would try
>> sage: im.show(command="/opt/local/bin/xv")
>> based on what you say below. Does this help?
>>
>
> Unfortunately not,
>
> im.show(command="/opt/local/bin/xv") and im.show(command="/opt/local/
> bin/display") both still result in the same traceback,
>
> Traceback (click to the left for traceback)
> ...
> IOError: decoder jpeg not available
>
> JM
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: raw picture manipulation

2008-07-17 Thread David Joyner

On Thu, Jul 17, 2008 at 8:02 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> I'm brand new to Sage, and would like to follow the path of least
> resistance to playing around with images.  I tried to follow these
> instructions, but got tripped up.
>
> On May 23, 7:55 am, "David Joyner" <[EMAIL PROTECTED]> wrote:
>> Harald:
>>
>> I know this is an old question but my feeling was in wasn't really
>> answered properly,
>> possibly because I inadvertantly took it off track with a response
>> which had an aside on
>> SAGE searching.
>>
>> Since PIL has come up a few times on SAGE lists in vague ways, I
>> thought I'd try to
>> be more detailed. Here is a way using SAGE which might help. First,
>> it requires some preparation.
>>
>> I'll assume you have installed sage in SAGEROOT (an absolute
>> pathname). (I'm going
>> to go into more detail that I know you need Harald since I hope to help 
>> others
>> who might know less about SAGE too).
>>
>> You must install PIL fromhttp://www.pythonware.com/products/pil/. Here's how:
>>
>> (a) download the tarball from a link on the URL mentioned above, 
>> sayhttp://effbot.org/downloads/Imaging-1.1.6.tar.gz;
>> (b) extract it to SAGEROOT/local/lib/python/site-packages
>> (c) cd SAGEROOT/local/lib/python2.5/site-packages/Imaging-1.1.6
>> (d) run  ../../../../bin/python setup.py install
>
> Instead of doing this, I ran
>
> sage -i PIL-1.1.5.spkg
>
> per the instructions of Simon King.  So far so good.
>
>> (e) install ImageMagick (unless you have xv installed, which you
>> probably don't);
>> in ubuntu, it's
>> sudo apt-get install imagemagick (or sudo apt-cache search
>> imagemagick, and install
>> a bunch of related packages too);
>> (f) in sage, type
>> sage: from PIL import Image
>> sage: im = Image.open("PATH/mypic.jpg")
>
> I'm good up to this point.  im is an object with a bunch of methods
> that I can look at with tab completion.
>
>> sage: im.show(command="display")

I would try
sage: im.show(command="/opt/local/bin/xv")
based on what you say below. Does this help?


>
> No dice.  I get the following Traceback:
>
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/Users/jm843/.sage/sage_notebook/worksheets/admin/0/code/
> 31.py", line 6, in 
>im.show(command="display")
>  File "/Applications/sage/local/lib/python2.5/site-packages/sympy/
> plotting/", line 1, in 
>
>  File "/Applications/sage/local/lib/python2.5/site-packages/PIL/
> Image.py", line 1349, in show
>_showxv(self, title, command)
>  File "/Applications/sage/local/lib/python2.5/site-packages/PIL/
> Image.py", line 1913, in _showxv
>file = image._dump(format=format)
>  File "/Applications/sage/local/lib/python2.5/site-packages/PIL/
> Image.py", line 429, in _dump
>self.load()
>  File "/Applications/sage/local/lib/python2.5/site-packages/PIL/
> ImageFile.py", line 180, in load
>d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
>  File "/Applications/sage/local/lib/python2.5/site-packages/PIL/
> Image.py", line 328, in _getdecoder
>raise IOError("decoder %s not available" % decoder_name)
> IOError: decoder jpeg not available
>
> I'm on a mac here, and I already had ImageMagick installed through
> MacPorts.  Since the above didn't work, so i also installed xv.
> Macports installs things into /opt/local/bin
>
> jmerrill:~ jm843$ which xv
> /opt/local/bin/xv
>
> I have /opt/local/bin on my searchpath when I open a terminal, but I
> suspect Sage just doesn't know where to find this stuff.  I tried
> running
>
> sys.path.append('/opt/local/bin')
>
> from within a notebook, but it doesn't seem to change anything.
>
>> Of course, im.[TAB] gives you more commands to play with and the online 
>> tutorialhttp://www.pythonware.com/library/pil/handbook/introduction.htm
>> helps too.
>>
>> Hope this is more helpful, even if it a little late.
>>
>> - David Joyner
>
> I'm grateful for any suggestions.  Is PIL the easiest route to playing
> around with images?  I'd really like to be able to get a grayscale
> image into an array of numbers so that I can play with convolutions
> and thresholding and the like.

I'm not sure what the best route is. Really, Sage (and Python) is
lacking in this
area, compared to (say) Matlab. Some references which use Python and GIMP are
www.estig.ipbeja.pt/~jasnau/VisaoComputador/pythonviip.pdf
http://www.mail-archive.com/[EMAIL PROTECTED]/msg14093.html
I'm not sure if PIL+GIMP is the way to go but maybe it's worth thinking about.

>
> Regards,
>
> Jason Merrill
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: abort: *.patch not under root error

2008-07-11 Thread David Joyner

I got them confused. Thanks!

On Fri, Jul 11, 2008 at 2:36 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Fri, Jul 11, 2008 at 9:42 AM, John Cremona <[EMAIL PROTECTED]> wrote:
>>
>> 2008/7/11 David Joyner <[EMAIL PROTECTED]>:
>>>
>>> Hi:
>>>
>>> The following gives a "patch not under root" abort error which I was 
>>> wondering
>>> if anyone could explain.
>>>
>>> (1) I create a clone
>>> (2) download a patch from trac (by clicking on the link at the bottom
>>> of the patch
>>> page and selecting download)
>>> (3) start the cloned sage and type
>>> sage: hg_sage.add("full-path-to/the.patch")
>>>
>>
>> When I do that I use hg_sage.apply() rather than add().  Are they different?
>
> Add and apply are totally different.
>   add -- add a new file to the repo
>   apply -- apply a patch or bundle to the repo.
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] abort: *.patch not under root error

2008-07-11 Thread David Joyner

Hi:

The following gives a "patch not under root" abort error which I was wondering
if anyone could explain.

(1) I create a clone
(2) download a patch from trac (by clicking on the link at the bottom
of the patch
page and selecting download)
(3) start the cloned sage and type
sage: hg_sage.add("full-path-to/the.patch")

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Can this butterfly curve routine be optimized?

2008-07-07 Thread David Joyner

Done. It is at http://wiki.sagemath.org/pics
(William: If you want changes, please just let me know.)


On Mon, Jul 7, 2008 at 10:21 AM, Matthew Miller
<[EMAIL PROTECTED]> wrote:
>
> David, that would be OK by me. :)
>
> Matthew
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Accessing terms in an expression

2008-07-03 Thread David Joyner

I was wondering about this myself. Maple has a command that does
exactly this (I think it is the "ops" command). Do you think SAGE should have
an "official" analog of that?

On Wed, Jul 2, 2008 at 11:33 PM, Mike Hansen <[EMAIL PROTECTED]> wrote:
>
> Hi Phil,
>
> I don't think there is an official way to get at the terms, but here
> is something that works:
>
> sage: var('x,y')
> (x, y)
> sage: t = x^2 + y^2
> sage: type(t)
> 
> sage: t._operator
> 
> sage: t._operands
> [x^2, y^2]
> sage: t._operands[0]
> x^2
>
> --Mike
>
> On Wed, Jul 2, 2008 at 7:49 PM, phil <[EMAIL PROTECTED]> wrote:
>>
>> I've looked around in the documentation but have not been able to
>> figure out how to access individual terms in an symbolic expression.
>> For example:
>> var('x,y')
>> t = x^2 + y^2
>>
>> How do I access the first term in t?  I want to assign it to another
>> variable, like first_term = t.extract_term(t,1) to get first_term to
>> be x^2.
>>
>> Thanks
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sign of a permutation

2008-06-30 Thread David Joyner

In that case, this might do it

sage: PermutationOptions(display='list')
sage: L1 = [5,3,8,6]
sage: L2 = copy(L1)
sage: L1.sort()
sage: L = [L2.index(x)+1 for x in L1]
sage: p = Permutation(L); p; p.to_cycles()
[2, 1, 4, 3]
[(1, 2), (3, 4)]
sage: p.signature()
1
sage: p.to_permutation_group_element().sign()
1


On Mon, Jun 30, 2008 at 9:12 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>
>
>
> On Jun 30, 5:16 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>> Do you mean the tuple is represented in the disjoint cycle notation and
>> is a cyclic permutation? In that case, you can use:
>>
>> sage: PermutationGroupElement('(3,6,4)').sign()
>> 1
>> sage: PermutationGroupElement('(5,3,6,4)').sign()
>> -1
>>
>
> No, by "one-line permutation notation", I mean that (3,6,4) means the
> permutation where 3 -> 3, 4 -> 6, and 6 -> 4, while (5,3,8,6) is the
> permutation of (3,5,8,6) in which 3 and 5 have been interchanged, as
> have 6 and 8.
>
>
>> On Mon, Jun 30, 2008 at 7:17 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> > Suppose I have a tuple x of distinct non-negative integers.  Is there
>> > a quick way to find the sign of this, as a permutation of Set(x)?  (I
>> > want to view x as the one-line permutation notation form, so (3,6,4)
>> > will have sign -1, while (5,3,8,6) will have sign 1.)
>>
>> > The things I can find in combinat/... don't quite seem to do what I
>> > want.  I can build something myself, but if there is a quick solution,
>> > I would prefer that.
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sign of a permutation

2008-06-30 Thread David Joyner

Do you mean the tuple is represented in the disjoint cycle notation and
is a cyclic permutation? In that case, you can use:

sage: PermutationGroupElement('(3,6,4)').sign()
1
sage: PermutationGroupElement('(5,3,6,4)').sign()
-1


On Mon, Jun 30, 2008 at 7:17 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>
> Suppose I have a tuple x of distinct non-negative integers.  Is there
> a quick way to find the sign of this, as a permutation of Set(x)?  (I
> want to view x as the one-line permutation notation form, so (3,6,4)
> will have sign -1, while (5,3,8,6) will have sign 1.)
>
> The things I can find in combinat/... don't quite seem to do what I
> want.  I can build something myself, but if there is a quick solution,
> I would prefer that.
>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: group rings question

2008-06-29 Thread David Joyner

On Sun, Jun 29, 2008 at 9:12 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Sat, Jun 28, 2008 at 11:47 AM, David Joyner <[EMAIL PROTECTED]> wrote:
>>
>> If you attach a file containing
>>
>> ##
>>
>> def PermutationGroupRing(R,G):
>>return PermutationGroupRing_generic(R,G)
>>
>> class PermutationGroupRing_generic(CombinatorialAlgebra):
>>def __init__(self, R, G):
>>self.group = G
>>self._combinatorial_class = G
>>self._one = G.identity()
>>self._name = 'Group ring of %s'%str(G)
>>self._prefix = ''
>>CombinatorialAlgebra.__init__(self, R)
>>def _multiply_basis(self, a, b):
>>c = a*b
>>return c
>>def group(self):
>>return self.group
>>
>>
>> ##
>>
>> then you get the following error:
>>
>> sage: F = GF(11)
>> sage: G = PermutationGroup([(1,2,3),(3,4,5)])
>> sage: attach "/home/wdj/sagefiles/codes/group_rings.sage"
>> sage: R = PermutationGroupRing(F,G)
>> sage: R.basis()
>> ---
>> TypeError Traceback (most recent call last)
>>
>> /home/wdj/sagefiles/sage-3.0.3.rc0/ in ()
>>
>> /home/wdj/sagefiles/sage-3.0.3.rc0/local/lib/python2.5/site-packages/sage/combinat/combinatorial_algebra.py
>> in basis(self)
>>701
>>702 """
>> --> 703 return [self(x) for x in self._combinatorial_class]
>>704
>>705 def __call__(self, x):
>>
>> /home/wdj/sagefiles/sage-3.0.3.rc0/local/lib/python2.5/site-packages/sage/combinat/combinatorial_algebra.py
>> in __call__(self, x)
>>738 return eclass(self, dict([ (e1,R(e2)) for
>> e1,e2 in x._monomial_coefficients.items()]))
>>739 #x is an element of the basis combinatorial class
>> --> 740 elif isinstance(x, self._combinatorial_class.object_class):
>>741 return eclass(self, {x:R(1)})
>>742 elif x in self._combinatorial_class:
>>
>> TypeError: isinstance() arg 2 must be a class, type, or tuple of
>> classes and types
>> sage:
>>
>> I added the method
>>
>>def object_class(self):
>>return PermutationGroup_generic
>>
>> to PermutationGroup_generic so now,
>>
>> sage: R._combinatorial_class.object_class
>> > Group with generators [(1,2,3), (3,4,5)]>
>> sage: R._combinatorial_class.object_class()
>> 
>> sage: isinstance(G,R._combinatorial_class.object_class())
>> True
>>
>> It seems to me the traceback error indicates I've defined object_class
>> incorrectly.
>> Does anyone have a hint as to the right way to go here?
>
> Maybe you should change
>
> elif isinstance(x, self._combinatorial_class.object_class):
>
> to
>
> elif isinstance(x, self._combinatorial_class.object_class()):
>
> William

Thanks but although that eliminated one traceback error, it created another.
Also, I'm worried that hacking Mike Hansen's combinatorial_algebra module
will create much more serious problems in other parts of SAGE.

I'm starting to think that either GroupRing should be written from scratch
(based closely on CombinatorialAlgebra) or else a GAP wrapper should be written.
I'm mostly interested in order to implement David Kohel's split group codes,
which generalize the duadic codes which have recently been implemented in
SAGE. Unfortunately, they rely heavily on abelian groups and their dual,
which is currently in a state of flux (I think David Roe is rewriting
it). So maybe
this should wait?

>
>>
>>
>>
>> On Sat, Jun 28, 2008 at 12:59 PM, David Joyner <[EMAIL PROTECTED]> wrote:
>>> On Sat, Jun 28, 2008 at 12:48 PM, Robert Bradshaw
>>> <[EMAIL PROTECTED]> wrote:
>>>>
>>>> On Jun 28, 2008, at 9:33 AM, David Joyner wrote:
>>>>
>>>>> On Sat, Jun 28, 2008 at 11:00 AM, John Cremona
>>>>> <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>> It seems that what Dan Bump's instructions did not specify is what
>>>>>> properties the class assigned to ._combinatorial_class must have.
>>>>>> And it needs something which PermutationGroupElement does not have.
>>>>>>
>>>>>> Does that help?
>

[sage-support] Re: group rings question

2008-06-28 Thread David Joyner

If you attach a file containing

##

def PermutationGroupRing(R,G):
return PermutationGroupRing_generic(R,G)

class PermutationGroupRing_generic(CombinatorialAlgebra):
def __init__(self, R, G):
self.group = G
self._combinatorial_class = G
self._one = G.identity()
self._name = 'Group ring of %s'%str(G)
self._prefix = ''
CombinatorialAlgebra.__init__(self, R)
def _multiply_basis(self, a, b):
c = a*b
return c
def group(self):
return self.group


##

then you get the following error:

sage: F = GF(11)
sage: G = PermutationGroup([(1,2,3),(3,4,5)])
sage: attach "/home/wdj/sagefiles/codes/group_rings.sage"
sage: R = PermutationGroupRing(F,G)
sage: R.basis()
---
TypeError Traceback (most recent call last)

/home/wdj/sagefiles/sage-3.0.3.rc0/ in ()

/home/wdj/sagefiles/sage-3.0.3.rc0/local/lib/python2.5/site-packages/sage/combinat/combinatorial_algebra.py
in basis(self)
701
702 """
--> 703 return [self(x) for x in self._combinatorial_class]
704
705 def __call__(self, x):

/home/wdj/sagefiles/sage-3.0.3.rc0/local/lib/python2.5/site-packages/sage/combinat/combinatorial_algebra.py
in __call__(self, x)
738 return eclass(self, dict([ (e1,R(e2)) for
e1,e2 in x._monomial_coefficients.items()]))
739 #x is an element of the basis combinatorial class
--> 740 elif isinstance(x, self._combinatorial_class.object_class):
741 return eclass(self, {x:R(1)})
742 elif x in self._combinatorial_class:

TypeError: isinstance() arg 2 must be a class, type, or tuple of
classes and types
sage:

I added the method

def object_class(self):
return PermutationGroup_generic

to PermutationGroup_generic so now,

sage: R._combinatorial_class.object_class

sage: R._combinatorial_class.object_class()

sage: isinstance(G,R._combinatorial_class.object_class())
True

It seems to me the traceback error indicates I've defined object_class
incorrectly.
Does anyone have a hint as to the right way to go here?



On Sat, Jun 28, 2008 at 12:59 PM, David Joyner <[EMAIL PROTECTED]> wrote:
> On Sat, Jun 28, 2008 at 12:48 PM, Robert Bradshaw
> <[EMAIL PROTECTED]> wrote:
>>
>> On Jun 28, 2008, at 9:33 AM, David Joyner wrote:
>>
>>> On Sat, Jun 28, 2008 at 11:00 AM, John Cremona
>>> <[EMAIL PROTECTED]> wrote:
>>>>
>>>> It seems that what Dan Bump's instructions did not specify is what
>>>> properties the class assigned to ._combinatorial_class must have.
>>>> And it needs something which PermutationGroupElement does not have.
>>>>
>>>> Does that help?
>>>
>>> Okay. Maybe the best thing is to write a wrapper to GAP's GroupRing
>>> function.
>>
>> I disagree, using CombinatorialAlgebra will be a much better option.
>>
>>>>> Can anyone explain "AttributeError: type object
>>>>> 'sage.groups.perm_gps.permgroup_element.Permutation' has no
>>>>> attribute
>>>>> 'count'"
>>>>> (in words of two syllables or less, if possible:-)?
>>
>> Sure. It means that it's trying to use a method called "count" but
>> the class "Permutation" found in sage/groups/perm_gps/
>> permgroup_element doesn't define one. What you need to do is make a
>> method called count.
>>
>> Actually, looking at the code (and someone more familiar with sage-
>> combinat should correct me) it looks like _combinatorial_class should
>> be the Parent (i.e. the group) rather than the element. It would
>> probably make sense to do something like
>>
>>> class PermutationGroupRing(CombinatorialAlgebra):
>>>def __init__(self, R, G):
>>>self.group = G
>>>self._combinatorial_class = G # NOTE the change
>>>self._one = G.identity()
>>>self._name = 'Group ring of %s'%str(G)
>>>self._prefix = ''
>>>CombinatorialAlgebra.__init__(self, R)
>>>def _multiply_basis(self, a, b):
>>>c = a*b
>>>return c
>>
>> and add a count method to the group class.
>
> That worked! Thank you!
>
>>
>> - Robert
>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: group rings question

2008-06-28 Thread David Joyner

On Sat, Jun 28, 2008 at 12:48 PM, Robert Bradshaw
<[EMAIL PROTECTED]> wrote:
>
> On Jun 28, 2008, at 9:33 AM, David Joyner wrote:
>
>> On Sat, Jun 28, 2008 at 11:00 AM, John Cremona
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> It seems that what Dan Bump's instructions did not specify is what
>>> properties the class assigned to ._combinatorial_class must have.
>>> And it needs something which PermutationGroupElement does not have.
>>>
>>> Does that help?
>>
>> Okay. Maybe the best thing is to write a wrapper to GAP's GroupRing
>> function.
>
> I disagree, using CombinatorialAlgebra will be a much better option.
>
>>>> Can anyone explain "AttributeError: type object
>>>> 'sage.groups.perm_gps.permgroup_element.Permutation' has no
>>>> attribute
>>>> 'count'"
>>>> (in words of two syllables or less, if possible:-)?
>
> Sure. It means that it's trying to use a method called "count" but
> the class "Permutation" found in sage/groups/perm_gps/
> permgroup_element doesn't define one. What you need to do is make a
> method called count.
>
> Actually, looking at the code (and someone more familiar with sage-
> combinat should correct me) it looks like _combinatorial_class should
> be the Parent (i.e. the group) rather than the element. It would
> probably make sense to do something like
>
>> class PermutationGroupRing(CombinatorialAlgebra):
>>def __init__(self, R, G):
>>self.group = G
>>self._combinatorial_class = G # NOTE the change
>>self._one = G.identity()
>>self._name = 'Group ring of %s'%str(G)
>>self._prefix = ''
>>CombinatorialAlgebra.__init__(self, R)
>>def _multiply_basis(self, a, b):
>>c = a*b
>>return c
>
> and add a count method to the group class.

That worked! Thank you!

>
> - Robert
>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: error in const.pdf (sage constructions manual)

2008-06-28 Thread David Joyner

Thanks for the report. There are so many problems with the
constructions document,
the plan is to replace it by a Cookbook, containing many chapters,
each authored by
a developer with interest in that topic.

On Sat, Jun 28, 2008 at 11:02 AM, Georg <[EMAIL PROTECTED]> wrote:
>
> On page 3:
> There is the following line:
> If you type view(f.diff('x')) another window ...
>
> f.diff('x') does not work, it works if f is of type
> 
> like in the example below, but it does not work if f is of type
> 
> in this case just f.diff(x) works...
>
> Georg
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: group rings question

2008-06-28 Thread David Joyner

On Sat, Jun 28, 2008 at 11:00 AM, John Cremona <[EMAIL PROTECTED]> wrote:
>
> It seems that what Dan Bump's instructions did not specify is what
> properties the class assigned to ._combinatorial_class must have.
> And it needs something which PermutationGroupElement does not have.
>
> Does that help?

Okay. Maybe the best thing is to write a wrapper to GAP's GroupRing function.

>
> John
>
> 2008/6/28 David Joyner <[EMAIL PROTECTED]>:
>>
>> Hi:
>>
>> Since there are some interesting error-correcting codes based on group
>> algebras over a finite field,
>> I'm making a stab at implementing group rings for permutation groups.
>> Dan Bump (offlist) suggested
>> looking at the CombinatorialAlgebra class in
>> sage.combinat.combinatorial_algebra.py. The docstring there
>> says, in part,
>>
>> The CombinatorialAlgebra base class makes it easy to define and work
>> with new combinatorial algebras in Sage.
>> ...
>> The important things to define are ._combinatorial_class which specifies
>> the combinatorial class that indexes the basis elements, ._one which
>> specifies the identity element in the algebra, ._name which specifies
>> the name of the algebra, ._prefix which is the string put in front of
>> each basis element, and finally a _multiply or _multiply basis method
>> that defines the multiplication in the algebra.
>>
>> Baed on that, I'd like to input
>>
>> class PermutationGroupRing(CombinatorialAlgebra):
>>def __init__(self, R, G):
>>self.group = G
>>self._combinatorial_class = PermutationGroupElement
>>self._one = G.identity()
>>self._name = 'Group ring of %s'%str(G)
>>self._prefix = ''
>>CombinatorialAlgebra.__init__(self, R)
>>def _multiply_basis(self, a, b):
>>c = a*b
>>return c
>>
>> and have a command like
>>
>> sage: PermutationGroupRing(ZZ,G)
>>
>> return a group ring. Instead, I get the traceback error
>>
>> {{{
>> ---
>> AttributeErrorTraceback (most recent call last)
>>
>> /home/wdj/sagefiles/sage-3.0.3.rc0/ in ()
>>
>> /home/wdj/.sage/temp/hera/7513/_home_wdj_sagefiles_codes_group_rings_sage_6.py
>> in __init__(self, R, G)
>> 27 self._name = 'Group ring of %s'%str(G)
>> 28 self._prefix = ''
>> ---> 29 CombinatorialAlgebra.__init__(self, R)
>> 30 def _multiply_basis(self, a, b):
>> 31 c = a*b
>>
>> /home/wdj/sagefiles/sage-3.0.3.rc0/local/lib/python2.5/site-packages/sage/combinat/combinatorial_algebra.py
>> in __init__(self, R, element_class)
>>679 #Set the dimension
>>680 try:
>> --> 681 self._dim = self._combinatorial_class.count()
>>682 except (ValueError, NotImplementedError):
>>683 self._dim = None
>>
>> AttributeError: type object
>> 'sage.groups.perm_gps.permgroup_element.Permutation' has no attribute
>> 'count'
>> }}}
>>
>> which I can't decipher.
>>
>> Can anyone explain "AttributeError: type object
>> 'sage.groups.perm_gps.permgroup_element.Permutation' has no attribute
>> 'count'"
>> (in words of two syllables or less, if possible:-)?
>>
>> - David Joyner
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] group rings question

2008-06-28 Thread David Joyner

Hi:

Since there are some interesting error-correcting codes based on group
algebras over a finite field,
I'm making a stab at implementing group rings for permutation groups.
Dan Bump (offlist) suggested
looking at the CombinatorialAlgebra class in
sage.combinat.combinatorial_algebra.py. The docstring there
says, in part,

The CombinatorialAlgebra base class makes it easy to define and work
with new combinatorial algebras in Sage.
...
The important things to define are ._combinatorial_class which specifies
the combinatorial class that indexes the basis elements, ._one which
specifies the identity element in the algebra, ._name which specifies
the name of the algebra, ._prefix which is the string put in front of
each basis element, and finally a _multiply or _multiply basis method
that defines the multiplication in the algebra.

Baed on that, I'd like to input

class PermutationGroupRing(CombinatorialAlgebra):
def __init__(self, R, G):
self.group = G
self._combinatorial_class = PermutationGroupElement
self._one = G.identity()
self._name = 'Group ring of %s'%str(G)
self._prefix = ''
CombinatorialAlgebra.__init__(self, R)
def _multiply_basis(self, a, b):
c = a*b
return c

and have a command like

sage: PermutationGroupRing(ZZ,G)

return a group ring. Instead, I get the traceback error

{{{
---
AttributeErrorTraceback (most recent call last)

/home/wdj/sagefiles/sage-3.0.3.rc0/ in ()

/home/wdj/.sage/temp/hera/7513/_home_wdj_sagefiles_codes_group_rings_sage_6.py
in __init__(self, R, G)
 27 self._name = 'Group ring of %s'%str(G)
 28 self._prefix = ''
---> 29 CombinatorialAlgebra.__init__(self, R)
 30 def _multiply_basis(self, a, b):
 31 c = a*b

/home/wdj/sagefiles/sage-3.0.3.rc0/local/lib/python2.5/site-packages/sage/combinat/combinatorial_algebra.py
in __init__(self, R, element_class)
679 #Set the dimension
680 try:
--> 681 self._dim = self._combinatorial_class.count()
682 except (ValueError, NotImplementedError):
683 self._dim = None

AttributeError: type object
'sage.groups.perm_gps.permgroup_element.Permutation' has no attribute
'count'
}}}

which I can't decipher.

Can anyone explain "AttributeError: type object
'sage.groups.perm_gps.permgroup_element.Permutation' has no attribute
'count'"
(in words of two syllables or less, if possible:-)?

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Difference between definite and indefinite integration

2008-06-27 Thread David Joyner

I'm not sure if what you report is a bug in SAGE. SAGE calls Maxima. If Maxima
refuses to integrate that integral (and I think it *should* but maybe
the algebra
is too complicated for it) then SAGE won't do it either.
If you want a numerical value then use n(integrate...). That seems to be
"working" though, as in my last email, providing an incorrect answer.
I just entered it as
http://trac.sagemath.org/sage_trac/ticket/3520

Can you check if Maxima (or sympy) can do the integral? If yes to
either, that would be
very interesting.

On Fri, Jun 27, 2008 at 8:08 AM, Roger <[EMAIL PROTECTED]> wrote:
>
> Do I need to do something further to make sure that this gets entered
> as a bug, or do the developers read this list regularly? Thanks.
>
> On Jun 22, 8:23 am, Roger <[EMAIL PROTECTED]> wrote:
>> Huh.
>>
>> Whomever looks at this issue should note that there are now two
>> distinct problems raised in this thread: the original issue regarding
>> why f.integral(9,16) below remains unevaluated, and tDavid's question
>> of why the two answers are different.
>>
>> On Jun 21, 9:01 am, "David Joyner" <[EMAIL PROTECTED]> wrote:
>>
>> > Unless 24.9... = -24.9..., there seems to be a bug:
>>
>> > sage: f = sqrt(25-x)*sqrt(1+1/(4*(25-x)))
>> > sage: f.integral(x,9,16)
>> > integrate(sqrt(1/(4*(25 - x)) + 1)*sqrt(25 - x), x, 9, 16)
>> > sage: f.nintegral(x,9,16)
>> > (24.9153783348643, 2.7661626694613149e-13, 21, 0)
>> > sage: g = f.simplify_radical()
>> > sage: g.integral(x,9,16)
>> > I*(65*sqrt(65)*I/6 - 37*sqrt(37)*I/6)/2
>> > sage: ans = g.integral(x,9,16)
>> > sage: ans.real()
>> > (37*sqrt(37)/6 - 65*sqrt(65)/6)/2
>> > sage: RR(ans.real())
>> > -24.9153783348643
>>
>> > On Sat, Jun 21, 2008 at 8:51 AM, Roger <[EMAIL PROTECTED]> wrote:
>>
>> > > Can someone explain why sage (or perhaps maxima, I don't know) manages
>> > > to evaluate the indefinite integral below, but fails to give a numeric
>> > > answer to the definite integral? Seems odd to me. (version 3.02
>> > > running on Mac OS X)
>>
>> > > sage: var('x')
>> > > x
>> > > sage: integral(sqrt(25-x)*sqrt(1+1/(4*(25-x))),x)
>> > > sqrt(4*x - 101)*(4*I*x - 101*I)/12
>> > > sage: integral(sqrt(25-x)*sqrt(1+1/(4*(25-x))),x,9,16)
>> > > integrate(sqrt(1/(4*(25 - x)) + 1)*sqrt(25 - x), x, 9, 16)
>>
>> > > Thanks,
>> > > Roger
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: solving 3 dimensional equations

2008-06-21 Thread David Joyner

In this special case, if you let A = ((x^2 + 10*y^2)/10^(1/3) (assuming I did
the algebra right, note there are 3 such A's, but only 1 real one) then you get


sage: A = var("A"); solve(2* x^2 + y^2 + z^2 - 1- A*z==0,z)
[z == (A - sqrt(A^2 - 4*y^2 - 8*x^2 + 4))/2, z == (sqrt(A^2 - 4*y^2 -
8*x^2 + 4) + A)/2]


On Sat, Jun 21, 2008 at 9:43 AM, Maximilian Lepik
<[EMAIL PROTECTED]> wrote:
> ok thanks. Do you no any other way how I could solve it
>
> 2008/6/21 David Joyner <[EMAIL PROTECTED]>:
>>
>> This is a 6th degree polynomial in z. There is no general formula for
>> algebraically
>> solving for roots of polynomials of degree 5 or higher.
>>
>>
>> On Fri, Jun 20, 2008 at 8:20 PM, Max <[EMAIL PROTECTED]>
>> wrote:
>> >
>> > Hi,
>> > i am looking for a way to solve this equation "10* (2* x^2 + y^2 + z^2
>> > - 1)^3- x^2*z^3 - 10*y^2* z^3=0" to "z" but I did not find a way to do
>> > it in sage. So if anybody knows how to do it please answer me- Thanks.
>> >
>> > >
>> >
>>
>>
>
>
>
> --
> Maximilian Lepik
> 235 E. 105th Street Apartment 5C
> 10029 New York, NY
> +1-212 722 79 67 (Home US)
> +1 917 428 6238 (Mobile US)
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: solving 3 dimensional equations

2008-06-21 Thread David Joyner

This is a 6th degree polynomial in z. There is no general formula for
algebraically
solving for roots of polynomials of degree 5 or higher.


On Fri, Jun 20, 2008 at 8:20 PM, Max <[EMAIL PROTECTED]> wrote:
>
> Hi,
> i am looking for a way to solve this equation "10* (2* x^2 + y^2 + z^2
> - 1)^3- x^2*z^3 - 10*y^2* z^3=0" to "z" but I did not find a way to do
> it in sage. So if anybody knows how to do it please answer me- Thanks.
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Difference between definite and indefinite integration

2008-06-21 Thread David Joyner

Unless 24.9... = -24.9..., there seems to be a bug:


sage: f = sqrt(25-x)*sqrt(1+1/(4*(25-x)))
sage: f.integral(x,9,16)
integrate(sqrt(1/(4*(25 - x)) + 1)*sqrt(25 - x), x, 9, 16)
sage: f.nintegral(x,9,16)
(24.9153783348643, 2.7661626694613149e-13, 21, 0)
sage: g = f.simplify_radical()
sage: g.integral(x,9,16)
I*(65*sqrt(65)*I/6 - 37*sqrt(37)*I/6)/2
sage: ans = g.integral(x,9,16)
sage: ans.real()
(37*sqrt(37)/6 - 65*sqrt(65)/6)/2
sage: RR(ans.real())
-24.9153783348643


On Sat, Jun 21, 2008 at 8:51 AM, Roger <[EMAIL PROTECTED]> wrote:
>
> Can someone explain why sage (or perhaps maxima, I don't know) manages
> to evaluate the indefinite integral below, but fails to give a numeric
> answer to the definite integral? Seems odd to me. (version 3.02
> running on Mac OS X)
>
> sage: var('x')
> x
> sage: integral(sqrt(25-x)*sqrt(1+1/(4*(25-x))),x)
> sqrt(4*x - 101)*(4*I*x - 101*I)/12
> sage: integral(sqrt(25-x)*sqrt(1+1/(4*(25-x))),x,9,16)
> integrate(sqrt(1/(4*(25 - x)) + 1)*sqrt(25 - x), x, 9, 16)
>
> Thanks,
> Roger
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: installing additional gap packages

2008-06-15 Thread David Joyner

>From the command line
sage -i gap_packages-4.4.10_4
assuming you have an internet connection.

On Sun, Jun 15, 2008 at 10:17 AM, mb <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am interested in computing homology groups of a simplicial complex
> (or more generally of a polysimplicial complex where cells are
> products of simplices). There is a gap package "homology" that does
> what I want, see http://linalg.org/gap.html
> but I am not sure how to install such a package within sage. Any help
> would be appreciated.
>
> Thanks,
>
> Mladen
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: piecewise defined functions and composition

2008-06-11 Thread David Joyner
I don't think composition of piecewise functions has been implemented yet.

2008/6/11 houp <[EMAIL PROTECTED]>:
>
> Hello.
>
> I'd like to have some simple piecewise defined function like:
> f = Piecewise([[[0,1],1]])
> and the composite it with some other function like
> h = x - 1
>
> I've tried somethine like this:
>
> f1 = lambda x:1
> f2 = lambda x:x+2
> f = piecewise([[[0,1],f1]])
> f(f2)
>
> and it fails with:
>
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/Users/houp/.sage/sage_notebook/worksheets/admin/1/code/5.py",
> line 7, in 
>f(f2)
>  File "/Applications/sage/local/lib/python2.5/site-packages/sympy/
> plotting/", line 1, in 
>
>  File "/Applications/sage/local/lib/python2.5/site-packages/sage/
> functions/piecewise.py", line 584, in __call__
>raise ValueError,"Value not defined outside of domain."
> ValueError: Value not defined outside of domain.
>
> The problem is that when sage tries to composite those functions it
> does not change the domain of f. On one hand it would be usefull to
> have it calculate f2([0,1]) and use it as new domain, on the other
> hand if f2 would be more complex it could be hard to calculate the
> image f2([0,1]). But anyway I'm wondering if it's possible to make any
> use of piecewise functions compositing?
>
> Best regards,
> Witold Bołt.
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: q-expansion of wt 1 cusp forms

2008-06-08 Thread David Joyner

Sorry, I don't know the SAGE command or if it has
that functionality yet. I'm cc'ing the SAGE 
support list to see if someone there can help you.

 Original message 
>Date: Sun, 8 Jun 2008 12:27:30 -0400
>From: "Hurt, Norm E." <[EMAIL PROTECTED]>  
>To: <[EMAIL PROTECTED]>
>
>   Dear Prof. Joyner, in Serre's paper Sur les
>   representations modulaires (Duke (1987))he mentions
>   in passing that he has checked his conjecture in the
>   dihedral case S_3 for imaginary cubic fields and
>   totally real cubic fields (p. 218).  He notes on p.
>   219 that the cusp forms of weight one F' is a linear
>   combination of theta functions of indefinite binary
>   forms. His table on p. 217 mentions D=148, 229, 257,
>   316. Okay, is there a reference showing the
>   q-expansion of F' in any of these cases. Magma does
>   not like theta functions for quadratic forms which
>   are indefinite. If you can show me how to calculate
>   the q-expansion of F' in SAGE, that would be great,
>   or a reference to such.
>
>
>
>   Sincerely,
>
>
>
>   Norm Hurt
>
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: implicit plot

2008-06-05 Thread David Joyner

I don't know if this can be done automatically but axes labels can be
set using the axes_labels method described on the page
http://www.sagemath.org/doc/html/ref/module-sage.plot.plot.html
(a little over 1/2 way down the page).


On Thu, Jun 5, 2008 at 7:05 PM, Kyle Schalm <[EMAIL PROTECTED]> wrote:
>
> thanks -- how do i get it to show the axis labels ("u" and "v")? and
> better yet, could we fix things to make it do this automatically?
>
> On May 30, 8:49 am, "David Joyner" <[EMAIL PROTECTED]> wrote:
>> sage: u,v = var("u,v")
>> sage: parametric_plot3d([u, v, 1-u-v], (u,-1, 1), (v,-1, 1))
>>
>> should work (I'm at work using an old version of SAGE, so am not sure).
>> Unfortunately, an implicit_plot3d function doesn't seem to be
>> implemented yet, AFAIK.
>>
>> On Fri, May 30, 2008 at 7:28 AM, kschalm <[EMAIL PROTECTED]> wrote:
>>
>> > how do i plot a plane, say ax+by+cz=0 ? do i have to parametrize or is
>> > there an implicit plot feature? (and, if you're feeling inclined, feel
>> > free to give me the complete sequences of commands in either case)
>>
>> > thanks,
>> > -kyle
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Will Sage run on a 4GB Asus Eee PC?

2008-06-05 Thread David Joyner

I finally got it (sage) to work on the asus. Here are some random comments.

1. A lot of preporatory work was done on my ubuntu desktop.
For example,  the sd card is mounted as root and typically formatted
as vfat. I reformatted
as ext2. Also, for copying, I didn't use the command line (even with
sudo cp -r ..."
I ran into problems) but used "sudo konqueror".  I also umounted and
remounted the
sd card to a different location (also possibly unecessary) using the
mount -o exec option.

2. The version
http://www.sagemath.org/SAGEbin/linux/32bit/sage-3.0.2-debian32-intelx86-i686-Linux.tar.gz
when decompressed and copied to the sd card just seems to work as is.
*However* (this is important), on the asus I tweaked the /sbin/probedevice file
in the asus (which may have not been necessary).

3. I tested both the command line and notebook version. Both seemed to run
fine (Firefox was installed by default and no other programs other than the
factory installed ones seemed to be on the asus, AFAIK). There was a
traceback error at
start but it seemed to be harmless. (I haven't gotten wifi configured
on it yet, so can't
paste the traceback into this email.)

4. The slax install mentioned later in the thread did not work since
that seems to assume that
the sd card is formatted as vfat.


On Sun, Jan 20, 2008 at 8:17 PM, mhampton <[EMAIL PROTECTED]> wrote:
>
> I've wondered about this myself, but I don't have an Eee.  Please post
> whatever you find out; I think the Eees look pretty sweet.
>
> It should be pretty easy to do, the chip is a standard Intel x86
> (centrino?).  As for memory, my G4 apple laptop only has 512 of memory
> right now, and sage runs reasonably well on it - the 3d graphics
> strain it a bit, but that's more the G4 chip's fault than the memory I
> think.
>
> Cheers,
> M. Hampton
>
> On Jan 20, 5:46 pm, JohnGuin <[EMAIL PROTECTED]> wrote:
>> Has anyone tried this?  I'm not sure if the flavor of Linux on the Eee
>> will support Sage, and am also curious if 512MB of RAM is enough.
>>
>> If anyone has actually run this config, please let me know.  Thanks
>> all!
>>
>> John
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: localhost notebook error

2008-06-05 Thread David Joyner

Sorry Cesar, I have no idea. I almost never use the notebook but use
the command line instead.
Maybe someone on sage-support can help (I'm cc'ing them).


On Thu, Jun 5, 2008 at 8:45 AM, Cesar Agustin Garcia Vazquez
<[EMAIL PROTECTED]> wrote:
> Why do I get the following error when I start using the notebook() with the
> url: http://localhost:8000/?startup_token=535f5ca28ad596861fd05f96131ea3a3
>
> Internal Server Error
>
> An error occurred rendering the requested page. More information is
> available in the server log
> ???
>
> But when I use only http://localhost:8000/ everything is ok
>
> On Tue, Jun 3, 2008 at 2:33 PM, David Joyner <[EMAIL PROTECTED]> wrote:
>>
>> I don't use the notebook interface much but I guess you just type
>>
>> attach "PATH/myfile.sage"
>>
>> in a cell and hit shift enter.
>>
>>
>> On Tue, Jun 3, 2008 at 3:22 PM, Cesar Agustin Garcia Vazquez
>> <[EMAIL PROTECTED]> wrote:
>> > I have already created a **.sage file, but, I want it to be available in
>> > the
>> > notebook interface, what do I have to do?

...

>
>
> --
> Best regards
> Cesar Agustin Garcia-Vazquez

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why isn't Octave

2008-06-03 Thread David Joyner

There is an octave interface (and lots of people use it), but the reason why
a SAGE package for octave is not included at this time is addressed here:
http://groups.google.com/group/sage-devel/browse_thread/thread/b5ccf2ffea78fd60/e72adb448c783983?
Basically, you can install octave and use it within SAGE quicker and
easier than compiling it as a
SAGE package, so a package has not been created yet. If you are interested in
volunteering to create one, please email William Stein or Michael
Abshoff or sage-devel.
Thanks, David

On Tue, Jun 3, 2008 at 10:35 AM, Cesar Agustin Garcia Vazquez
<[EMAIL PROTECTED]> wrote:
> I was wondering, while I was reading the Sage programming guide, why Octave
> is not part of Sage, is there any reason?
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: SAGE on CentOS

2008-06-03 Thread David Joyner

On Tue, Jun 3, 2008 at 10:09 AM, David Joyner <[EMAIL PROTECTED]> wrote:
> centOS is debian-based, so assuming you have 32 bit centOS, you might try

Sorry, this is wrong - I badly misread the info at  http://www.centos.org/

> http://modular.math.washington.edu/sage/SAGEbin/linux/32bit/sage-3.0.2-debian32-intelx86-i686-Linux.tar.gz
>
>
> On Tue, Jun 3, 2008 at 7:59 AM, Melissa <[EMAIL PROTECTED]> wrote:
>>
>> Hi-
>>
>> I'm sort of new to compiling things from source [and new to CentOS]. I
>> followed the instructions detailed in the .pdf for compiling from
>> source, including making sure I had the necessary repos. However, I
>> know it didn't work, because it took all of five seconds and after
>> each thing it said this: "You must set the SAGE_ROOT environment
>> variable or run this script from the SAGE_ROOT or SAGE_ROOT/local/bin/
>> directory."
>>
>> When trying to run sage by changing into the directory and typing "./
>> sage", I get the following message at the bottom: "ImportError: /home/
>> syslin/sage-3.0.2-rhel32bit-intelx86-i686-Linux/local/lib/libpari-
>> gmp.so.2: cannot restore segment prot after reloc: Permission denied
>> ".
>>
>> Also, I'm confused as to which tar I should've downloaded. I used the
>> RHEL one. Is this right? The OS is CentOS 5.1.
>>
>> -Melissa
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: SAGE on CentOS

2008-06-03 Thread David Joyner

centOS is debian-based, so assuming you have 32 bit centOS, you might try
http://modular.math.washington.edu/sage/SAGEbin/linux/32bit/sage-3.0.2-debian32-intelx86-i686-Linux.tar.gz


On Tue, Jun 3, 2008 at 7:59 AM, Melissa <[EMAIL PROTECTED]> wrote:
>
> Hi-
>
> I'm sort of new to compiling things from source [and new to CentOS]. I
> followed the instructions detailed in the .pdf for compiling from
> source, including making sure I had the necessary repos. However, I
> know it didn't work, because it took all of five seconds and after
> each thing it said this: "You must set the SAGE_ROOT environment
> variable or run this script from the SAGE_ROOT or SAGE_ROOT/local/bin/
> directory."
>
> When trying to run sage by changing into the directory and typing "./
> sage", I get the following message at the bottom: "ImportError: /home/
> syslin/sage-3.0.2-rhel32bit-intelx86-i686-Linux/local/lib/libpari-
> gmp.so.2: cannot restore segment prot after reloc: Permission denied
> ".
>
> Also, I'm confused as to which tar I should've downloaded. I used the
> RHEL one. Is this right? The OS is CentOS 5.1.
>
> -Melissa
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: coercion problem?

2008-06-02 Thread David Joyner

Thanks. I reported this as http://trac.sagemath.org/sage_trac/ticket/3353


On Mon, Jun 2, 2008 at 9:43 PM, Mike Hansen <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> This is definitely not a problem with coercion -- it's a problem with
> the iterator for G.  For example. try this:
>
> sage: z = iter(G)
> sage: z
> 
> sage: z.next()
> [0 1]
> [1 0]
> sage: z.next()
> [0 1]
> [1 1]
>
> It takes quite a bit of time to do each .next() which makes me suspect
> that something silly is going on.
>
> --Mike
>
>
> --Mike
> On Mon, Jun 2, 2008 at 5:44 PM, David Joyner <[EMAIL PROTECTED]> wrote:
>>
>> Hi:
>>
>> Possibly this is a problem with coercion but I don't know.
>> Does anyone know why the following takes so long?
>>
>>
>> sage: p = 5
>> sage: F = GF(p)
>> sage: E. = GF(p^2,"a")
>> sage: G = GL(2,p)
>> sage: M = MatrixSpace(E,2,2)
>> sage: V = VectorSpace(E,2)
>> sage: g = G.random_element()
>> sage: v = V([1,a]); v; g; M(g)*v
>> (1, a)
>>
>> [4 0]
>> [2 1]
>> (4, a + 2)
>> sage: G.order()
>> 480
>> sage: time orbit_v = [M(g)*v for g in G]
>>
>>
>> It has not finished after several minutes. It seems like it should be
>> instant.
>>
>> - David Joyner
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] coercion problem?

2008-06-02 Thread David Joyner

Hi:

Possibly this is a problem with coercion but I don't know.
Does anyone know why the following takes so long?


sage: p = 5
sage: F = GF(p)
sage: E. = GF(p^2,"a")
sage: G = GL(2,p)
sage: M = MatrixSpace(E,2,2)
sage: V = VectorSpace(E,2)
sage: g = G.random_element()
sage: v = V([1,a]); v; g; M(g)*v
(1, a)

[4 0]
[2 1]
(4, a + 2)
sage: G.order()
480
sage: time orbit_v = [M(g)*v for g in G]


It has not finished after several minutes. It seems like it should be
instant.

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: units

2008-06-02 Thread David Joyner

I've not tried it and don't know if it will help but since SAGE is
written in Python,
you can look at this tutorial for a Python package called Unim:
http://home.scarlet.be/be052320/Unum_tutorial.html
If it helps, please email back in case others have the same issue as you.


On Mon, Jun 2, 2008 at 10:41 AM, Radek <[EMAIL PROTECTED]> wrote:
>
> Hello All,
>
> does anyone have an idea how to use units [kg, m, ft etc.] in Sage?
> I would like to have a tool to check if my computations are
> dimensionally consistent. Often I have to switch between units
> systems  (some preliminary computations are in US Customary and then I
> have to use SI) and wonder if someone got an elegant solution for
> that?
> Thank you in advance for any suggestion.
>
> Radek
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Sage does not work after build.

2008-06-01 Thread David Joyner

I think John was referring to /home/mozork/.sage/ (which is where some
SAGE stuff is
saved). I think he suggested deleting it and then starting SAGE.

Just in case there was a corrupted download, can you download sage-3.0.2, and
recompile? I just want to be sure that this is not a 32 bit ubuntu issue.

Also, if you email me (at [EMAIL PROTECTED], separate email, not to
sage-support, please)
the install log, I will post it on a webserver for others to inspect
and email the list the location.


On Sun, Jun 1, 2008 at 7:58 AM, Mozork <[EMAIL PROTECTED]> wrote:
>
> I0m not shore this was what you meant, but I've now moved sage to /usr/
> bin/sage and I still get the same error.
>
> On Jun 1, 1:44 pm, "John Cremona" <[EMAIL PROTECTED]> wrote:
>> Maybe there is some junk in your .sage directory.  Try deleting (or
>> moving) it before running Sage.
>>
>> John
>>
>> 2008/6/1 David Joyner <[EMAIL PROTECTED]>:
>>
>>
>>
>> > On Sun, Jun 1, 2008 at 7:23 AM, Mozork <[EMAIL PROTECTED]> wrote:
>>
>> >> I'm jusing ubuntu 8.04 hardy heron, 32bit.
>> >> What I forgot to mention: I followed the instructions here to build
>> >> sage:http://www.msri.org/about/computing/docs/sage/inst/node3.html
>>
>> > Those appear to date from 2006! Could you try these more recent
>> > instructions instead?
>> >http://www.sagemath.org/doc/html/inst/index.html
>> > I assume when you say build (in this and your original email), you
>> > mean compile from
>> > source?
>>
>> >> As for GAP, both commands seem to work fine:
>>
>> >> [EMAIL PROTECTED]:~/.sage$ ./sage -gp
>> >>  GP/PARI CALCULATOR Version 2.3.3 (released)
>> >>   i686 running linux (ix86/GMP-4.2.1 kernel) 32-bit version
>> >>compiled: Jun  1 2008, gcc-4.2.3 (Ubuntu 4.2.3-2ubuntu7)
>> >>(readline v5.2 enabled, extended help available)
>>
>> >> Copyright (C) 2000-2006 The PARI Group
>>
>> >> PARI/GP is free software, covered by the GNU General Public License,
>> >> and
>> >> comes WITHOUT ANY WARRANTY WHATSOEVER.
>>
>> >> Type ? for help, \q to quit.
>> >> Type ?12 for how to get moral (and possibly technical) support.
>>
>> >> parisize = 400, primelimit = 50
>> >> ? \q
>> >> Goodbye!
>> >> [EMAIL PROTECTED]:~/.sage$ ./sage -gap
>>
>> >>#   ## ###
>> >> ###
>> >> #  ## 
>> >> 
>> >>## #
>> >> #
>> >>   ### #   ##
>> >> #
>> >>  ## # #   ##
>> >> ##
>> >> ##   ##   ##
>> >> ###
>> >> ##    #   ##
>> >> 
>> >> #  #  #   ###
>> >> 
>> >> # ###     ###
>> >> 
>> >> # ###  ## ##
>> >> 
>> >> # ###  ## #
>> >> #
>> >>  #  # #
>> >> #
>> >>  ## # #
>> >> #
>> >>  ##   #
>> >> 
>> >>   #####   #
>> >> 
>> >> ###   #
>> >> 
>> >>  #  #  #  #
>> >> 
>>
>> >> Information at:  http://www.gap-system.org
>> >> Try '?help' for help. See also  '?copyright' and  '?authors'
>>
>> >>   Loading the library. Please be patient, this may take a while.
>> >> GAP4, Version: 4.4.10 of 02-Oct-2007, i686-pc-linux-gnu-gcc
>>
>> >> On Jun 1, 1:17 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>> >>> I guess you mean hardy heron, ubuntu 8.04, 

[sage-support] Re: Sage does not work after build.

2008-06-01 Thread David Joyner

On Sun, Jun 1, 2008 at 7:23 AM, Mozork <[EMAIL PROTECTED]> wrote:
>
> I'm jusing ubuntu 8.04 hardy heron, 32bit.
> What I forgot to mention: I followed the instructions here to build
> sage: http://www.msri.org/about/computing/docs/sage/inst/node3.html


Those appear to date from 2006! Could you try these more recent
instructions instead?
http://www.sagemath.org/doc/html/inst/index.html
I assume when you say build (in this and your original email), you
mean compile from
source?


>
> As for GAP, both commands seem to work fine:
>
> [EMAIL PROTECTED]:~/.sage$ ./sage -gp
>  GP/PARI CALCULATOR Version 2.3.3 (released)
>   i686 running linux (ix86/GMP-4.2.1 kernel) 32-bit version
>compiled: Jun  1 2008, gcc-4.2.3 (Ubuntu 4.2.3-2ubuntu7)
>(readline v5.2 enabled, extended help available)
>
> Copyright (C) 2000-2006 The PARI Group
>
> PARI/GP is free software, covered by the GNU General Public License,
> and
> comes WITHOUT ANY WARRANTY WHATSOEVER.
>
> Type ? for help, \q to quit.
> Type ?12 for how to get moral (and possibly technical) support.
>
> parisize = 400, primelimit = 50
> ? \q
> Goodbye!
> [EMAIL PROTECTED]:~/.sage$ ./sage -gap
>
>#   ## ###
> ###
> #  ## 
> 
>## #
> #
>   ### #   ##
> #
>  ## # #   ##
> ##
> ##   ##   ##
> ###
> ##    #   ##
> 
> #  #  #   ###
> 
> # ###     ###
> 
> # ###  ## ##
> 
> # ###  ## #
> #
>  #  # #
> #
>  ## # #
> #
>  ##   #
> 
>   #####   #
> 
> ###   #
> 
>  #  #  #  #
> 
>
> Information at:  http://www.gap-system.org
> Try '?help' for help. See also  '?copyright' and  '?authors'
>
>   Loading the library. Please be patient, this may take a while.
> GAP4, Version: 4.4.10 of 02-Oct-2007, i686-pc-linux-gnu-gcc
>
>
> On Jun 1, 1:17 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>> I guess you mean hardy heron, ubuntu 8.04, 64bit?
>>
>> Others are much better than I at deciphering the problem, but it vaguely
>> looks like you have a problem with the GAP install. Could you please
>> try
>>
>> ./sage -gp
>>
>> and then quit SAGE, then try
>>
>> ./sage -gap
>>
>> please?
>>
>> On Sun, Jun 1, 2008 at 5:25 AM, Mozork <[EMAIL PROTECTED]> wrote:
>>
>> > Hi,
>>
>> > I've built sage (3.0.1) on my ubuntu 8.4 and the build worked just
>> > fine. But whenever I want  to use sage, I get an error for every
>> > command I've tried so far.
>>
>> > e.g.
>> > [EMAIL PROTECTED]:~/.sage$ ./sage
>> > --
>> > | SAGE Version 3.0.1, Release Date: 2008-05-05   |
>> > | Type notebook() for the GUI, and license() for information.|
>> > --
>>
>> > sage: 2+2
>> > Timeout exceeded in read_nonblocking().
>> > 
>> > version: 2.0 ($Revision: 1.151 $)
>> > command: /home/mozork/.sage/gap
>> > args: ['/home/mozork/.sage/gap', '-b', '-p', '-T', '-o', '3900m', '/
>> > home/mozork/.sage/data//extcode/gap/sage.g']
>> > patterns:
>> >gap>
>> > buffer (last 100 chars):
>> > before (last 100 chars):
>> > after: 
>> > match: None
>> > match_index: None
>> > exitstatus: None
>> > flag_eof: 0
>> > pid: 3275
>> > child_fd: 14
>> > timeout: 30
>> > delimiter: 
>> > logfile: None
>> > maxread: 10
>> > searchwindowsize: None
>> > delaybeforesend: 0
>>
>> > If it might help to see the install log, how can I append the file
>> > here? (Copying it seems like overkill to me...)
>>
>> > I hope I can be helped. ;)
>> > Thanks, Mozork
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: plot directional field differential equations

2008-06-01 Thread David Joyner

Besides Georg's suggestion there is a file in
SAGEHOME/examples/calculus called field_plot2d.sage
which does some very crude DF plotting of 1st order ODEs.
(Designed specifically for teaching purposes.) You need to read it
into SAGE using the attach command, edg

sage: attach "SAGEHOME/examples/calculus/field_plot2d.sage"

The docstring of the file has examples.

On Sun, Jun 1, 2008 at 3:17 AM, Hobus <[EMAIL PROTECTED]> wrote:
>
> how can I plot the directional field of ordinary differential
> equations?
> x'=f(t,x)
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Sage does not work after build.

2008-06-01 Thread David Joyner

I guess you mean hardy heron, ubuntu 8.04, 64bit?

Others are much better than I at deciphering the problem, but it vaguely
looks like you have a problem with the GAP install. Could you please
try

./sage -gp

and then quit SAGE, then try

./sage -gap

please?



On Sun, Jun 1, 2008 at 5:25 AM, Mozork <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've built sage (3.0.1) on my ubuntu 8.4 and the build worked just
> fine. But whenever I want  to use sage, I get an error for every
> command I've tried so far.
>
> e.g.
> [EMAIL PROTECTED]:~/.sage$ ./sage
> --
> | SAGE Version 3.0.1, Release Date: 2008-05-05   |
> | Type notebook() for the GUI, and license() for information.|
> --
>
> sage: 2+2
> Timeout exceeded in read_nonblocking().
> 
> version: 2.0 ($Revision: 1.151 $)
> command: /home/mozork/.sage/gap
> args: ['/home/mozork/.sage/gap', '-b', '-p', '-T', '-o', '3900m', '/
> home/mozork/.sage/data//extcode/gap/sage.g']
> patterns:
>gap>
> buffer (last 100 chars):
> before (last 100 chars):
> after: 
> match: None
> match_index: None
> exitstatus: None
> flag_eof: 0
> pid: 3275
> child_fd: 14
> timeout: 30
> delimiter: 
> logfile: None
> maxread: 10
> searchwindowsize: None
> delaybeforesend: 0
>
> If it might help to see the install log, how can I append the file
> here? (Copying it seems like overkill to me...)
>
> I hope I can be helped. ;)
> Thanks, Mozork
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: implicit plot

2008-05-30 Thread David Joyner

sage: u,v = var("u,v")
sage: parametric_plot3d([u, v, 1-u-v], (u,-1, 1), (v,-1, 1))

should work (I'm at work using an old version of SAGE, so am not sure).
Unfortunately, an implicit_plot3d function doesn't seem to be
implemented yet, AFAIK.

On Fri, May 30, 2008 at 7:28 AM, kschalm <[EMAIL PROTECTED]> wrote:
>
> how do i plot a plane, say ax+by+cz=0 ? do i have to parametrize or is
> there an implicit plot feature? (and, if you're feeling inclined, feel
> free to give me the complete sequences of commands in either case)
>
> thanks,
> -kyle
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: multiplicative inverse of a polynomial in a ring

2008-05-28 Thread David Joyner

It seems you should be able to represent multiplication by y as a
matrix equation,
which you might have luck inverting.


On Wed, May 28, 2008 at 5:27 PM, vpv <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am trying to solve the following equation for y in SAGE:
>
> x*y = 1 (mod z^8+z^4+z^3+z+1)
>
> where
>
> x = x0+x1*z^1+x2*z^2+x3*z^3+x4*z^4+x5*z^5+x6*z^6+x7*z^7
> y = ?
>
> x0,...,x7 are elements of GF(2). I do not know their values. I am
> searching for y in parametric form i.e. as a polynomial of z of degree
> 7 with coefficients - some functions of x0,...,x7.
>
> I define in SAGE:
>
> P. = BooleanPolynomialRing(8, order='lex')
> Z. = PolynomialRing(P)
>
> I try to do the following in SAGE
>
> y = inverse_mod(x0+x1*z^1+x2*z^2+x3*z^3+x4*z^4+x5*z^5+x6*z^6+x7*z^7,
> z^8+z^4+z^3+z+1)
>
> but it does not work.
>
> Alternatively, I try to define a ring of univariate polynomials of z
> with coeffients in P, every element of which is reduced (mod
> z^8+z^4+z^3+z+1), but I am not able to get the right syntax to do this
> in SAGE.
>
> Any help is appreciated.
>
> Thanks!
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Implicit differentiation

2008-05-27 Thread David Joyner

sage: x = var("x")
sage: f = function("f",x)
sage: (f(x)^2+sin(x*f(x))).diff()
(x*diff(f(x), x, 1) + f(x))*cos(x*f(x)) + 2*f(x)*diff(f(x), x, 1)


On Tue, May 27, 2008 at 5:21 PM, Roger <[EMAIL PROTECTED]> wrote:
>
> I'm a relative Sage newbie, but have used GAP and Maxima as well as
> Mathematica extensively.
>
> Can someone tell me how to take an implicitly defined equation such as
> x*sin(y)=y
> and return its implicit derivative with respect to x, regarding y as a
> function of x? That is, I'd like to see something like
> sin(y) + x*cos(y)*y' = y'
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] trig_reduce in SAGE?

2008-05-24 Thread David Joyner

Hi:

I'm wondering if I'm missing something. SAGE can show that $\sin(x)^3
= \frac{3\sin(x) - \sin(3x)}{4}$
by the command

sage: y = sin(x)^3
sage: maxima(y).trigreduce()
(3*sin(x)-sin(3*x))/4

Is there any other way of doing this? The explicit call to maxima is
what I'm trying to avoid.

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: raw picture manipulation

2008-05-23 Thread David Joyner

Harald:

I know this is an old question but my feeling was in wasn't really
answered properly,
possibly because I inadvertantly took it off track with a response
which had an aside on
SAGE searching.

Since PIL has come up a few times on SAGE lists in vague ways, I
thought I'd try to
be more detailed. Here is a way using SAGE which might help. First,
it requires some preparation.

I'll assume you have installed sage in SAGEROOT (an absolute
pathname). (I'm going
to go into more detail that I know you need Harald since I hope to help others
who might know less about SAGE too).

You must install PIL from http://www.pythonware.com/products/pil/. Here's how:

(a) download the tarball from a link on the URL mentioned above, say
http://effbot.org/downloads/Imaging-1.1.6.tar.gz;
(b) extract it to SAGEROOT/local/lib/python/site-packages
(c) cd SAGEROOT/local/lib/python2.5/site-packages/Imaging-1.1.6
(d) run  ../../../../bin/python setup.py install
(e) install ImageMagick (unless you have xv installed, which you
probably don't);
in ubuntu, it's
sudo apt-get install imagemagick (or sudo apt-cache search
imagemagick, and install
a bunch of related packages too);
(f) in sage, type
sage: from PIL import Image
sage: im = Image.open("PATH/mypic.jpg")
sage: im.show(command="display")

Of course, im.[TAB] gives you more commands to play with and the online tutorial
http://www.pythonware.com/library/pil/handbook/introduction.htm
helps too.

Hope this is more helpful, even if it a little late.

- David Joyner


On Thu, Apr 17, 2008 at 8:07 AM, Harald Schilly
<[EMAIL PROTECTED]> wrote:
>
> Hi
>
> A friend of mine want's to manipulate pictures (bitmap, in color).
> Basically, he want's to load and then represent them as a binary
> vector in Sage and then encode them using linear codes ->
> manipulations (errors) -> then back to an image and see how good the
> code worked.
> The one thing I don't know is what's the best and easiest way to get a
> binary representation of an image to be able to work with - a
> bijection from picture to binary vector in GF(2) and back. Maybe in
> different versions (each color channel separate or other methods).
>
> Harald
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: numerical integration

2008-05-23 Thread David Joyner

If you have a list L of N, say, sample values of the function f over
the interval
(a,b), say, then

intf = sum(L)*(b-a)/N

should be the approximate integral shouldn't it?

sage: a = 1; b = 2; N = 10; Delta = (b-a)/N
sage: intf = sum(L)*(b-a)/N
sage: int_f = integral(sin(x),x,1,2)
sage: RR(intf); RR(int_f)
0.952260646490585
0.956449142415282


On Fri, May 23, 2008 at 7:21 AM,  <[EMAIL PROTECTED]> wrote:
>
> I have a function that is not piecewise and cannot be symbolically
> integrated.  Hence, I cannot use the Riemann or trapezoid
> approximations.
>
> Is there any other way in Sage to numerically integrate such a
> function?
>
> Thanks,
> Andrew
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: [sage-edu] Re: matrix over the booleans

2008-05-14 Thread David Joyner

On Wed, May 14, 2008 at 8:54 AM, Pedro Patricio <[EMAIL PROTECTED]> wrote:
>
>  nope, booleans means 1+1=1.
>  take + as OR and * as AND in the propositional calculus.

I was afraid you were going to say that:-)

Does this help any?

sage: B = BooleanPolynomialRing(1,'x')
sage: x = B.gen()
sage: x*x
x
sage: x*1
x
sage: x*B(0)
0
sage: x+B(0)
x
sage: A = M([[x,0],[0,x]])
sage: A

[x 0]
[0 x]
sage: A*A

[x 0]
[0 x]

If not, I don't know what do to. Perhaps you should ask Michael Brickenstein,
who worked on the PolyBoRi interface.
http://opensourcemath.org/sage/doc/html/ref/node300.html#l2h-7751

In fact, you are actually asking on the wrong list. This list is for
using SAGE in teaching and it seems your question is how do you
construct the Boolean ring as a ring of coefficients for a matrix.
Therefore, I'm ccing the sage-support list on this. Maybe someone
there can help you better.

>
>  the key thing is to compute the reachability matrix of a digraph. an
>  awkward way to do it would be by computing the power series A+A^2+\dots
>  +A^n, where n is the #vertices and A adjacency matrix, and replace
>  every nonzero element by 1.
>  but i would like to take A over the booleans right from the begining.
>
>  thanks
>  pedro
>
>
>  On 14 Maio, 13:20, [EMAIL PROTECTED] wrote:
>  > David Joyner wrote:
>
>
> > > On Wed, May 14, 2008 at 6:29 AM, Pedro Patricio <[EMAIL PROTECTED]> wrote:
>  >
>  > >>  hi all... i am sure you can easily help me with this one.
>  >
>  > >>  how can i define a matrix over the booleans? i know this is trivially
>  > >>  done over ZZ and so forth.
>  >
>  > > If by booleans you mean GF(2), then just replace ZZ by GF(2) in the
>  > > construction you know over ZZ. Is that what you meant?
>  >
>  > Also, if you already have a matrix, you can convert it to a matrix over
>  > GF(2) by doing:
>  >
>  > m.change_ring(GF(2))
>  >
>  > Jason
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Will Sage run on a 4GB Asus Eee PC?

2008-05-12 Thread David Joyner

Thank you. I'm downloading this now.

I have a borrowed asus eee with xandros.  If I copy your files
onto a SD card, how do I start sage from the asus?


2008/5/12 chu-ching huang <[EMAIL PROTECTED]>:
>
> Hi all,
>
> I build a live slax linux on 2G USB pendriver with Sage-3.0.1, CAS and
> other python packages, Good news is that sage works well with my EeePC
> 701.
>
> download site: ftp://math.cgu.edu.tw/pub/slax
>
> cch
>
> On 5月12日, 上午4時53分, achrzesz <[EMAIL PROTECTED]> wrote:
>> On 9 Maj, 20:27, "David Joyner" <[EMAIL PROTECTED]> wrote:
>>
>> > It turns out that next year it is very possible that all USNA
freshamn will have
>> > an asus eee. The debate seems to be about the amount of ram it should have.
>> > I can borrow one next week. It has xandros linux 500M ram, 2G "hard
>> > drive", wireless but
>> > no cd or dvd drive. I think I can also borrow a 8G SD card.  It comes with
>> > konqueror but not firefox and a very limited (to put it mildly) set of
>> > development tools.
>>
>> > Any suggestions as to how to get SAGE running on it? Ideally, if and
>> > when this becomes
>> > definite, I'd like a very simple set of instructions so that a
>> > freshman can download a file and
>> > make their own SD card with SAGE on it.
>>
>> I'm using sage 2.10.1 in Debian lenny on Asus EEEPC
>> I have installed Debian binary version of Sage (a fiew months ago)
>> Debian resides on additional 8GB SD Card and was installed
>> using instructions fromhttp://wiki.debian.org/DebianEeePC
>> (I'm not upgrading since  even decompresing is very time consuming)
>>
>> (factor(2^2^8+1) takes 22sec)
>>
>> Andrzej Chrzeszczyk
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: [sage-edu] Solving contour integrals in SAGE

2008-05-12 Thread David Joyner

I think this question is better posed on sage-support, which I am cc'ing.
sage-edu is about teaching with SAGE.

Am I correct in assuming you have a parameterization of your
line integral (with parameter q) and so you can write the
contour integral as

int_a^b f(q) dq

after some substitutions? I'm not sure where you are stuck.


On Mon, May 12, 2008 at 3:29 PM, ohitmano <[EMAIL PROTECTED]> wrote:
>
> Hi all, need do solve contour integral of a very complex function
> contour is provided with equations: x = cos(q) + cos(4q); y = sin(q) -
> sin(4q).
> function is very long and complex and I won't post it here, but will
> say about some conditions:
> it depends on variable(r) that must be >0 because it contains log()
> and if r = 0 then there will be devision by zero.
>
> Can somebody tell me how can I solve contour integral in sage?
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: [sage-newbie] Re: Will Sage run on a 4GB Asus Eee PC?

2008-05-09 Thread David Joyner

It turns out that next year it is very possible that all USNA freshamn will have
an asus eee. The debate seems to be about the amount of ram it should have.
I can borrow one next week. It has xandros linux 500M ram, 2G "hard
drive", wireless but
no cd or dvd drive. I think I can also borrow a 8G SD card.  It comes with
konqueror but not firefox and a very limited (to put it mildly) set of
development tools.

Any suggestions as to how to get SAGE running on it? Ideally, if and
when this becomes
definite, I'd like a very simple set of instructions so that a
freshman can download a file and
make their own SD card with SAGE on it.

On Sun, Jan 20, 2008 at 8:56 PM, mabshoff
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Jan 21, 1:17 am, mhampton <[EMAIL PROTECTED]> wrote:
>> I've wondered about this myself, but I don't have an Eee.  Please post
>> whatever you find out; I think the Eees look pretty sweet.
>>
>> It should be pretty easy to do, the chip is a standard Intel x86
>> (centrino?).  As for memory, my G4 apple laptop only has 512 of memory
>> right now, and sage runs reasonably well on it - the 3d graphics
>> strain it a bit, but that's more the G4 chip's fault than the memory I
>> think.
>>
>> Cheers,
>> M. Hampton
>>
>> On Jan 20, 5:46 pm, JohnGuin <[EMAIL PROTECTED]> wrote:
>>
>> > Has anyone tried this?  I'm not sure if the flavor of Linux on the Eee
>> > will support Sage, and am also curious if 512MB of RAM is enough.
>
> I think malb owns one, but I am not sure if he talked about buying one
> or if he already did. As observed above 512 MB is enough. You can also
> strip down the binary distribution if you do not intent to do any
> development, i.e. remove all static libraries, strip all binaries,
> remove header and so on.
>
>> > If anyone has actually run this config, please let me know.  Thanks
>> > all!
>>
>> > John
>
> Cheers,
>
> Michael
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] bug in trac's diff?

2008-05-08 Thread David Joyner

Hi:

Does "/dev/null", around 40-50 lines down in
http://trac.sagemath.org/sage_trac/attachment/ticket/3051/3051-unified-1.patch,
seem strange to anyone? Shouldn't that be the name of a Python module?

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: parametric plot with vectors?

2008-05-08 Thread David Joyner

Dan:

FYI, to plot the soln to

x'=x+y+t,   x(0) =1,
y'=x-y, y(0) =0,

for 0 wrote:
> I'm teaching ODEs right now and I'd like to plot the usual sort of
> solution to a 2-by-2 linear DE system, but the following doesn't work:
>
>  sage: evec = vector([1,2])
>  sage: var('t')
>  sage: parametric_plot( exp(-t) * evec, 0, 2)
>
> The traceback's complaint is ": function
> takes at most 1 positional arguments (2 given)".
>
> I know I could manually do (exp(-t), 2*exp(-t)), but the above form
> seems so natural. Is there a way to get that to work?
>
> Dan
>
> --
> ---  Dan Drake <[EMAIL PROTECTED]>
> -  KAIST Department of Mathematical Sciences
> ---  http://math.kaist.ac.kr/~drake
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIIrq3r4V8SljC5LoRAuNrAKC3rfn26RxH6O+A4x1Sw2xXn4YIiQCg1E5k
> JZc870W62/eLMer54/vTJwE=
> =Cj2B
> -END PGP SIGNATURE-
>
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: build problem for 3.0.1 on ubuntu 7.10amd64

2008-05-07 Thread David Joyner

On Wed, May 7, 2008 at 7:32 AM, mabshoff
<[EMAIL PROTECTED]> wrote:
>
>
>
>  On May 7, 1:10 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>  > On Wed, May 7, 2008 at 6:41 AM, mabshoff
>
>  Hi David,
>
>
>  > <[EMAIL PROTECTED]> wrote:
>  >
>  > >  On May 7, 12:29 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>  >
>  > >  Hi David,
>  >
>  > >  > Replying to my own email again, I built 3.0.1 from for the 3rd time 
> and,
>  > >  > even, though the build goes fine apparently, at starting sage from the
>  > >  > command line, I get the same import error, even for the "uncorrupted" 
> download.
>  >
>  > >  > Any hints?
>  >
>  > >  Does the md5sum match?
>  >
>  > >  e4978d4f05528196aace3dde8b7d563b  sage-3.0.1.tar
>  >
>  > [EMAIL PROTECTED]:~/wdj/sagefiles$ md5sum sage-3.0.1.tar
>  > e4978d4f05528196aace3dde8b7d563b  sage-3.0.1.tar
>  >
>
>  ok.
>
>
>  >
>  > >  Are you still using pbuild? It would likely be the problem. If you do
>  >
>  > I thought I wasn't but
>  >
>  > [EMAIL PROTECTED]:~/wdj/sagefiles$ env | grep SAGE
>  > SAGE_BUILD_THREADS=2
>  > SAGE_PBUILD=yes
>  >
>  > so does that mean I am?
>
>  Yes. unset those variables to get rid of them.
>
>
>  > >  delete the directory
>  >
>  > >  devel/sage/build/
>  >
>  > >  Then make sure PBUILD's env variables are not defined and then run
>  > >  "sage -ba"
>  >
>  > Okay. I'm starting in a new shell, for safety's sake.
>  >
>
>  ;)
>
>  >
>  > >  Another common problem is a poisoned SAGE-env, i.e. make sure "env |
>  > >  grep SAGE" is clean. It is also not recommended to build over an
>  > >  existing build.
>  >
>  > Thanks!
>  >
>  >
>  >
>  > >  Please also post a link to install.log.
>  >
>  > It's uploading 
> tohttp://sage.math.washington.edu/home/wdj/patches/install.log
>
> > Should be there in 5-10 minutes.
>
>  Ok, I had a look and #3101 did get applied to the tree, but there is
>  some deeper issue in pbuild involved there:
>
>  While wrap.cc is now build as a C++ file the extension mwrank.so is
>  still build as a C file:
>
>  gcc -O3 -g -fwrapv -shared -fno-strict-aliasing /mnt/drive_hda1/
>  sagefiles/sage-3.0.1/devel/sage/build/temp/sage/libs/mwrank/mwrank.o -
>  L/home/wdj/wdj/sagefiles/sage-3.0.1/local/lib  -lcsage  -lcurvesntl  -
>  lg0nntl  -ljcntl  -lrankntl  -lntl  -lgmp  -lgmpxx  -lstdc++  -lm  -
>  lpari  -lstdc++  -lntl  -o /mnt/drive_hda1/sagefiles/sage-3.0.1/devel/
>  sage-main/build/sage/libs/mwrank/mwrank.so
>
>  I checked and it is supposed to be build as a C++ extension.
>
>  *But*: Checking the next extension, i.e. pow_computer_ext.so you see
>  that here gcc is also used:
>
>  gcc -O3 -g -fwrapv -shared -fno-strict-aliasing /mnt/drive_hda1/
>  sagefiles/sage-3.0.1/devel/sage/build/temp/sage/rings/padics/
>  pow_computer_ext.o -L/home/wdj/wdj/sagefiles/sage-3.0.1/local/lib  -
>  lcsage  -lcsage  -lntl  -lgmp  -lgmpxx  -lm  -lstdc++ -lstdc++  -lntl
>  -o /mnt/drive_hda1/sagefiles/sage-3.0.1/devel/sage-main/build/sage/
>  rings/padics/pow_computer_ext.so
>
>  I am not quire sure if that is supposed to be, but I always wondered
>  why on earth we would explicitly link stdc++?
>
>  Thoughts?

I have no clue. However, sage -ba works and there are no
import errors starting sage.

Thanks again!

>
>
>
>  Cheers,
>
>  Michael
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: build problem for 3.0.1 on ubuntu 7.10amd64

2008-05-07 Thread David Joyner

On Wed, May 7, 2008 at 6:41 AM, mabshoff
<[EMAIL PROTECTED]> wrote:
>
>  On May 7, 12:29 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
>
>  Hi David,
>
>
>  > Replying to my own email again, I built 3.0.1 from for the 3rd time and,
>  > even, though the build goes fine apparently, at starting sage from the
>  > command line, I get the same import error, even for the "uncorrupted" 
> download.
>  >
>  > Any hints?
>
>  Does the md5sum match?
>
>  e4978d4f05528196aace3dde8b7d563b  sage-3.0.1.tar

[EMAIL PROTECTED]:~/wdj/sagefiles$ md5sum sage-3.0.1.tar
e4978d4f05528196aace3dde8b7d563b  sage-3.0.1.tar

>
>  Are you still using pbuild? It would likely be the problem. If you do

I thought I wasn't but

[EMAIL PROTECTED]:~/wdj/sagefiles$ env | grep SAGE
SAGE_BUILD_THREADS=2
SAGE_PBUILD=yes

so does that mean I am?

>  delete the directory
>
>  devel/sage/build/
>
>  Then make sure PBUILD's env variables are not defined and then run
>  "sage -ba"

Okay. I'm starting in a new shell, for safety's sake.

>
>  Another common problem is a poisoned SAGE-env, i.e. make sure "env |
>  grep SAGE" is clean. It is also not recommended to build over an
>  existing build.

Thanks!

>
>  Please also post a link to install.log.

It's uploading to
http://sage.math.washington.edu/home/wdj/patches/install.log
Should be there in 5-10 minutes.

>
>  Cheers,
>
>  Michael
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: build problem for 3.0.1 on ubuntu 7.10amd64

2008-05-07 Thread David Joyner

Replying to my own email again, I built 3.0.1 from for the 3rd time and,
even, though the build goes fine apparently, at starting sage from the
command line, I get the same import error, even for the "uncorrupted" download.

Any hints?

On Tue, May 6, 2008 at 8:29 PM, David Joyner <[EMAIL PROTECTED]> wrote:
> I'll answer my own email. I think it might be a corrupted download
>  since a new download was a slightly different size. Odd that it
>  compiled okay though.
>
>
>
>  On Tue, May 6, 2008 at 8:20 PM, David Joyner <[EMAIL PROTECTED]> wrote:
>  > Hi:
>  >
>  >  It appears that sage builds fine from source (using "make")
>  >  but when I tried to run sage it raised an import error. Does
>  >  this ring a bell or does it seem like a corrupted download?
>  >  - David Joyner
>  >
>  >  SAGE build/upgrade complete!
>  >  [EMAIL PROTECTED]:~/wdj/sagefiles/sage-3.0.1$ ./sage
>  >  --
>  >  | SAGE Version 3.0.1, Release Date: 2008-05-04   |
>  >  | Type notebook() for the GUI, and license() for information.|
>  >  --
>  >
>  >  
> ---
>  > Traceback (most recent call 
> last)
>  >
>  >  /mnt/drive_hda1/sagefiles/sage-3.0.1/local/bin/ in 
> ()
>  >
>  >  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/all_cmdline.py
>  >  in ()
>  >  12 try:
>  >  13
>  >  ---> 14 from sage.all import *
>  >  15 from sage.calculus.predefined import x
>  >  16 preparser(on=True)
>  >
>  >  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/all.py
>  >  in ()
>  >  60 from sage.misc.sh import sh
>  >  61
>  >  ---> 62 from sage.libs.all   import *
>  >  63
>  >  64 get_sigs()
>  >
>  >  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/all.py
>  >  in ()
>  >  10 from sage.libs.pari.all   import pari, pari_gen, allocatemem, 
> PariError
>  >  11
>  >  ---> 12 from sage.libs.mwrank.all  import (mwrank_EllipticCurve,
>  >  mwrank_MordellWeil,
>  >  13mwrank_initprimes,
>  >  14set_precision as
>  >  mwrank_set_precision)
>  >
>  >  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/mwrank/all.py
>  >  in ()
>  >   8set_precision)
>  >   9
>  >  ---> 10 from mwrank import initprimes as mwrank_initprimes
>  >  11
>  >  12
>  >
>  >  :
>  >  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/mwrank/mwrank.so:
>  >  undefined symbol: mw_del
>  >  sage:
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: build problem for 3.0.1 on ubuntu 7.10amd64

2008-05-06 Thread David Joyner

I'll answer my own email. I think it might be a corrupted download
since a new download was a slightly different size. Odd that it
compiled okay though.

On Tue, May 6, 2008 at 8:20 PM, David Joyner <[EMAIL PROTECTED]> wrote:
> Hi:
>
>  It appears that sage builds fine from source (using "make")
>  but when I tried to run sage it raised an import error. Does
>  this ring a bell or does it seem like a corrupted download?
>  - David Joyner
>
>  SAGE build/upgrade complete!
>  [EMAIL PROTECTED]:~/wdj/sagefiles/sage-3.0.1$ ./sage
>  --
>  | SAGE Version 3.0.1, Release Date: 2008-05-04   |
>  | Type notebook() for the GUI, and license() for information.|
>  --
>
>  ---
> Traceback (most recent call last)
>
>  /mnt/drive_hda1/sagefiles/sage-3.0.1/local/bin/ in 
> ()
>
>  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/all_cmdline.py
>  in ()
>  12 try:
>  13
>  ---> 14 from sage.all import *
>  15 from sage.calculus.predefined import x
>  16 preparser(on=True)
>
>  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/all.py
>  in ()
>  60 from sage.misc.sh import sh
>  61
>  ---> 62 from sage.libs.all   import *
>  63
>  64 get_sigs()
>
>  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/all.py
>  in ()
>  10 from sage.libs.pari.all   import pari, pari_gen, allocatemem, 
> PariError
>  11
>  ---> 12 from sage.libs.mwrank.all  import (mwrank_EllipticCurve,
>  mwrank_MordellWeil,
>  13mwrank_initprimes,
>  14set_precision as
>  mwrank_set_precision)
>
>  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/mwrank/all.py
>  in ()
>   8set_precision)
>   9
>  ---> 10 from mwrank import initprimes as mwrank_initprimes
>  11
>  12
>
>  :
>  
> /home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/mwrank/mwrank.so:
>  undefined symbol: mw_del
>  sage:
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] build problem for 3.0.1 on ubuntu 7.10amd64

2008-05-06 Thread David Joyner

Hi:

It appears that sage builds fine from source (using "make")
but when I tried to run sage it raised an import error. Does
this ring a bell or does it seem like a corrupted download?
- David Joyner

SAGE build/upgrade complete!
[EMAIL PROTECTED]:~/wdj/sagefiles/sage-3.0.1$ ./sage
--
| SAGE Version 3.0.1, Release Date: 2008-05-04   |
| Type notebook() for the GUI, and license() for information.|
--

---
   Traceback (most recent call last)

/mnt/drive_hda1/sagefiles/sage-3.0.1/local/bin/ in ()

/home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/all_cmdline.py
in ()
 12 try:
 13
---> 14 from sage.all import *
 15 from sage.calculus.predefined import x
 16 preparser(on=True)

/home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/all.py
in ()
 60 from sage.misc.sh import sh
 61
---> 62 from sage.libs.all   import *
 63
 64 get_sigs()

/home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/all.py
in ()
 10 from sage.libs.pari.all   import pari, pari_gen, allocatemem, PariError
 11
---> 12 from sage.libs.mwrank.all  import (mwrank_EllipticCurve,
mwrank_MordellWeil,
 13mwrank_initprimes,
 14set_precision as
mwrank_set_precision)

/home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/mwrank/all.py
in ()
  8set_precision)
  9
---> 10 from mwrank import initprimes as mwrank_initprimes
 11
 12

:
/home/wdj/wdj/sagefiles/sage-3.0.1/local/lib/python2.5/site-packages/sage/libs/mwrank/mwrank.so:
undefined symbol: mw_del
sage:

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Simple continued fractions in Pari

2008-05-06 Thread David Joyner

On Wed, Apr 30, 2008 at 8:51 PM, Dan Drake <[EMAIL PROTECTED]> wrote:
> On Wed, 30 Apr 2008 at 09:10AM -0700, bill.p wrote:
>  > > My present thought is that I'd need a list of integers plus another
>  > > integer - the integer could either be the number of non-recurring
>  > > terms, or it could be the number of recurring terms. Given the way
>  > > that Python handles negative indices I guess the second option could
>  > > amount to the same thing by making it negative. Again, feedback
>  > > welcomed.
>  > >
>  > > Bill
>  > Hmmm, I'll take that as 'No Interest' then
>
>  I haven't been following this carefully, but I'd like to see a format
>  for quadratic irrationals that is along the same lines as Mathematica:
>
>   ContinuedFraction[Sqrt[15]]
>
>  yields
>
>   {3, {1, 6}}.


BTW, you can do this in GAP via SAGE:

sage: gap.eval("x := Indeterminate(Integers);;")
''
sage: eval(gap.eval("ContinuedFractionExpansionOfRoot(x^2-15,20)"))
[3, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1]

http://www.gap-system.org/Manuals/doc/htm/ref/CHAP015.htm#SECT005

It would probably be straightforward to write a pexpect wrapper

>
>  The first entry is the integer part, and after that, we'd have a tuple
>  or list that gives you the periodic stuff. Rational numbers would be
>  just a list of integers:
>
>   {3, 7, 15, 1, 292, 1, 1, 1, 2, 1}
>
>  It would also be nice if you could do symbolic expressions as entries in
>  the list.
>
>  Dan
>
>  --
>  ---  Dan Drake <[EMAIL PROTECTED]>
>  -  KAIST Department of Mathematical Sciences
>  ---  http://math.kaist.ac.kr/~drake
>
> -BEGIN PGP SIGNATURE-
>  Version: GnuPG v1.4.6 (GNU/Linux)
>
>  iD8DBQFIGRQjr4V8SljC5LoRAqr4AKC6RNAFBhBCkilu0tzy3qzGUVyWMQCgzDZL
>  IsNOy5VwOE2sENvbAZ7kXc8=
>  =jGFv
>  -END PGP SIGNATURE-
>
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Complex Number Manipulations in Functions of Symbolic Variables?

2008-05-06 Thread David Joyner

On Sat, May 3, 2008 at 10:27 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
>  On Sat, May 3, 2008 at 6:53 PM, dvase <[EMAIL PROTECTED]> wrote:
>  >
>  >  Hello,
>  >  It seems as though I am missing something obvious, but I can not
>  >  figure out how to use complex number manipulations on symbolic
>  >  variables in sage.
>  >
>  >  A trivial example would be to have a function that returns the
>  >  imaginary portion of a given complex value:
>  >
>  >  sage: f(x) = imag(x)
>  >  sage: f(i*1)
>  >  I
>  >
>  >  However, the result of this currently gives me zero, as it seems the
>  >  imag() function is not captured by the function declaration.  Any
>  >  insights on this quandary?
>
>
>  At present, depending on what you're doing your best bet in this case
>  is probably just to define a Python function instead of a formal symbolic
>  function.   For example, paste in this:
>
>  def f(x):
>  return imag(x) + 5
>
>  Then
>
>  sage: f(3+I)
>  6
>
>
>  The rest of this email has some details about what is going on.
>  Since symbolic calculus in Sage is currently being massively
>  rewritten by Bill Furnish, I don't recommend people worry
>  too much about making changes to the current system to
>  address this problem.
>
>  Complex number support for Sage's current symbolics is not very good.
>  It wasn't a high priority in the initial implementation.
>
>  In particular, imag is just a Python function:
>
>  sage: type(imag)
>  
>
>  whereas for something like the above to work well it should be a
>  symbolic function.
>
>  Second, even if imag were symbolic  Maxima (which does expression 
> simplification
>  of Sage symbolic expressions behind the scenes) would view x by default
>  as real, and imag(x) = 0.

I wonder if Bill Furnish is also planning on adding the sgn function
to this class?

>
>  sage: sage.calculus.calculus.maxima('imagpart(x)')  # imagpart = imag in 
> maxima
>  0
>  sage: sage.calculus.calculus.maxima('realpart(x)')
>  x
>
>  This behavior can be changed as follows:
>
>  sage: sage.calculus.calculus.maxima('declare(x, complex)')
>  done
>  sage: sage.calculus.calculus.maxima('imagpart(x)')  # imagpart = imag in 
> maxima
>  ?%imagpart(x)
>
>
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: An octal bug and some book advice for abstract algebra

2008-04-30 Thread David Joyner

Well of course I have to mention my own book, Applied Abstract Algebra.
It is online at http://wdjoyner.com/teach/book/. Browse all you want.
You can also buy it in hardcover (from JHUP available via amazon.com).
Full disclosure: all royalties go directly to to charity. It does have
GAP examples but no
SAGE examples in it.


On Wed, Apr 30, 2008 at 3:28 AM, Yann Le Du <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  First, the function oct does not work properly, it seems.
>
>  oct(2345) fails in Sage (but works in Python)
>  oct(int(2345)) works
>  hex(2345) works
>
>  Irc said it was the preparser. Why would the input of oct be preparsed
>  correctly and not that of hex ?
>
>  Sage uses notions from abstract algebra. I never use abstract algebra when
>  doing my coding in physics. I guess software like Mathematica kind of
>  guesses the best way to proceed with the input I give. Now, this guess
>  might not be the most appropriate.
>
>  So I'd be grateful if anyone had some suggestions for a book on abstract
>  algebra that would teach me the practical usage of rings, fields, etc.
>  from a computational point of view ; something like "common computational
>  errors and fallacies corrected by an abstract algebra approach", something
>  that would build upon ideas like "1/3 + 1/10**20 - 1/3" is better done in
>  the the rationals than in the floats. Maybe some book similar to Forman
>  Acton's books that would explicitly use notions of abstract algebra.
>
>  I had a look at Schaum's Modern Abstract Algebra by Ayres, 2004, but
>  comments on amazon mentioned multiple errors, opacities and out of
>  datedness. Irc suggested wikipedia. Any other suggestion ?
>
>  Cheers,
>
>  --
>  Yann Le Du
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: version()/clone question

2008-04-27 Thread David Joyner

This is now trac ticket 3046.

On Sun, Apr 27, 2008 at 1:38 PM, bill purvis <[EMAIL PROTECTED]> wrote:
>
>
>  On Sunday 27 April 2008, David Joyner wrote:
>  > Hi:
>  > While in a sage session, I often times want to know if I'm in the
>  > main branch or some clone. Is there a command line way to fine out
>  > this information?
>  > I wonder if it to would be useful to anyone other than me. I'm guessing
>  > it not too much trouble, for example, to modify version() to return a
>  > pair - the version
>  > and the name of the clone branch one is in. I'd be happy to prepare
>  > a patch if I could get a hint on how to get started.
>  > - David Joyner
>  >
>  I'd vote +1 for this too!
>
>  Bill
>  --
>  +---+
>  | Bill Purvis, Amateur Mathematician|
>  |  email: [EMAIL PROTECTED]|
>  +---+
>
>
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] version()/clone question

2008-04-27 Thread David Joyner

Hi:
While in a sage session, I often times want to know if I'm in the
main branch or some clone. Is there a command line way to fine out
this information?
I wonder if it to would be useful to anyone other than me. I'm guessing
it not too much trouble, for example, to modify version() to return a
pair - the version
and the name of the clone branch one is in. I'd be happy to prepare
a patch if I could get a hint on how to get started.
- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] sage -i question

2008-04-25 Thread David Joyner

Hi:

I'm wondering why is it that
rm -rf "$SAGE_ROOT/local/lib/$GAP/pkg/"
mkdir "$SAGE_ROOT/local/lib/$GAP/pkg/"
occurs in the spkg-install script for gap_packages*?
Is there a reason why the old packages are deleted?

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Error computing matrix kernel

2008-04-24 Thread David Joyner

On Thu, Apr 24, 2008 at 1:07 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
>  On Thu, Apr 24, 2008 at 10:00 AM, UAT <[EMAIL PROTECTED]> wrote:
>  >
>  >  Wow, I didn't know this! I already wondered why SAGE should make such
>  >  a stupid mistake. Thanks for the fast answer!
>  >
>
>  Because people get confused by this, we will likely remove the kernel
>  command and have only left_kernel() and right_kernel().

+1
(and maybe add kernel_left and kernel_right for those of us addicted
to tab completion)

>
>
>  William
>
>
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] bug in maxima.eval? meval?

2008-04-23 Thread David Joyner

Hi:

This is a problem:

sage: CC(spherical_harmonic(1,1,RR(pi/2),RR(pi/2)))
-1.20627379501958e-15 + 0.345494149471335*I
sage: CC(spherical_harmonic(1,1,pi/2,pi/2))
0.130735417217099 + 0.285662098159486*I

Does anyone know what is going on here?
meval is a function in
http://www.sagemath.org/hg/sage-main/file/667bc05730be/sage/functions/special.py
I wonder if it is misbehaving somehow. I'm happy to report it to trac
but don't know how to classify the problem.

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: complete elliptic integral of the first kind?

2008-04-23 Thread David Joyner

On Wed, Apr 23, 2008 at 10:09 AM, William Stein <[EMAIL PROTECTED]> wrote:
>
>  On Wed, Apr 23, 2008 at 4:12 AM, David Joyner <[EMAIL PROTECTED]> wrote:
>  >
>  >  I believe they were implemented, since they are in the documentation
>  >  at the URL you
>  >  gave under "Methods implemented:" but doesn't seem to be there now. 
> Anyway,
>  >  you can try this:
>  >
>  >  sage: maxima.eval("elliptic_kc (0.5)")
>  >  '1.854074677301372'
>  >  or
>  >  sage: RR(maxima.eval("elliptic_kc (0.5)"))
>  >  1.85407467730137
>
>  David,
>
>  Can you make a trac ticket about this discrepancy between
>  the docs and what is actually available?  I'm not just
>  doing it, since it's all your code so you'll have better
>  insight into what to suggest in the trac ticket as the
>  right fix.

Done. It's http://trac.sagemath.org/sage_trac/ticket/3006

>
>  Thanks!
>   wiliam
>
>
>
>  >
>  >
>  >
>  >  On Tue, Apr 22, 2008 at 10:03 PM, dvase <[EMAIL PROTECTED]> wrote:
>  >  >
>  >  >  Hello,
>  >  >  I am looking to use a complete elliptic integral of the first kind in
>  >  >  sage, however I'm not sure if this has been implemented.  The link
>  >  >  http://www.sagemath.org/doc/html/ref/module-sage.functions.special.html
>  >  >  mentions a function "elliptic_kc", but it doesn't seem to be
>  >  >  implemented in sage version 3.0, judging from the result of this
>  >  >  command:
>  >  >
>  >  >  sage: elliptic_kc?
>  >  >  Object `elliptic_kc` not found.
>  >  >
>  >  >  Any insights on using a a complete elliptic integral of the first kind
>  >  >  in sage?
>  >  >
>  >  >  >
>  >  >
>  >
>  >  >
>  >
>
>
>
>  --
>  William Stein
>  Associate Professor of Mathematics
>  University of Washington
>  http://wstein.org
>
>
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: complete elliptic integral of the first kind?

2008-04-23 Thread David Joyner

I believe they were implemented, since they are in the documentation
at the URL you
gave under "Methods implemented:" but doesn't seem to be there now. Anyway,
you can try this:

sage: maxima.eval("elliptic_kc (0.5)")
'1.854074677301372'
or
sage: RR(maxima.eval("elliptic_kc (0.5)"))
1.85407467730137


On Tue, Apr 22, 2008 at 10:03 PM, dvase <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>  I am looking to use a complete elliptic integral of the first kind in
>  sage, however I'm not sure if this has been implemented.  The link
>  http://www.sagemath.org/doc/html/ref/module-sage.functions.special.html
>  mentions a function "elliptic_kc", but it doesn't seem to be
>  implemented in sage version 3.0, judging from the result of this
>  command:
>
>  sage: elliptic_kc?
>  Object `elliptic_kc` not found.
>
>  Any insights on using a a complete elliptic integral of the first kind
>  in sage?
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: plotting Weierstrass Elliptic function

2008-04-22 Thread David Joyner

I'm not sure what 3d plot you want. However, if I read the documentation
at the link you provided correctly then

sage: E = pari(['1', 'I'])
sage: E.ellwp(1+I)
-1/2*I

says p(1+i)=-i/2 for the elliptic curve associated to Z+iZ.
Maybe you want to plot the real and imaginary parts of

sage: f = lambda a,b: E.ellwp(a+b*I)
sage: f(1,1)
-1/2*I

or something like that?

On Tue, Apr 22, 2008 at 6:00 AM, Kai <[EMAIL PROTECTED]> wrote:
>
>  Hi there,
>
>  i am currently writing a term paper on the Weierstrass p-function and
>  was wondering if i could create a plot of it for a certain lattice. I
>  already found the function ellwp() in the documentation
>  http://www.sagemath.org/doc/html/ref/module-sage.libs.pari.gen.html,
>  but had some difficulties with defining the lattice and finally making
>  a 3D Plot of it. Since im not very experienced with SAGE yet, I was
>  wondering if someone could tell me how to do this for the square
>  lattice i*Z+Z.
>
>  thanks in advance,
>  Kai
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: bug in DirichletGroup?

2008-04-19 Thread David Joyner

On Sat, Apr 19, 2008 at 5:08 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
>
>  On Sat, Apr 19, 2008 at 1:55 PM, David Joyner <[EMAIL PROTECTED]> wrote:
>  >
>  >  Hi:
>  >
>  >  I wonder if this behavior is a bug?
>  >
>  >  sage: G = DirichletGroup(21)
>  >  sage: chi = G.0; chi
>  >  [-1, 1]
>  >  sage: chi.values()
>  >  [0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1]
>  >
>  >  So far, so good (similar code is in the tutorial:
>  >  http://www.sagemath.org/doc/html/tut/node15.html).
>  >  Now use a different base ring:
>  >
>  >
>  >  sage: G = DirichletGroup(21, GF(37))
>  >  sage: chi = G.0; chi
>  >  [36, 1]
>  >  sage: chi.values()
>  >  
> ---
>  >  Traceback (most recent call 
> last)
>  >
>  >  /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/ in ()
>  >
>  >  
> /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/local/lib/python2.5/site-packages/sage/modular/dirichlet.py
>  >  in values(self)
>  >1056 
>  >1057 # record character value on n
>  >  -> 1058 result_list[n.ivalue] = R_values[value.ivalue]
>  >1059 # iterate:
>  >1060 #   increase the exponent vector by 1,
>  >
>  >  : list index out of range
>  >
>  >
>  >  Should I report this to trac?
>  >
>  >  - David
>
>  Yes, this is definitely a bug.  Definitely report it to trac.

Done:
http://trac.sagemath.org/sage_trac/ticket/2959
I set the milestone as 3.0.1 since I thought Michael said no more
new tickets in 3.0.

>
>  william
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] bug in DirichletGroup?

2008-04-19 Thread David Joyner

Hi:

I wonder if this behavior is a bug?

sage: G = DirichletGroup(21)
sage: chi = G.0; chi
[-1, 1]
sage: chi.values()
[0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1]

So far, so good (similar code is in the tutorial:
http://www.sagemath.org/doc/html/tut/node15.html).
Now use a different base ring:


sage: G = DirichletGroup(21, GF(37))
sage: chi = G.0; chi
[36, 1]
sage: chi.values()
---
Traceback (most recent call last)

/mnt/drive_hda1/sagefiles/sage-3.0.alpha5/ in ()

/mnt/drive_hda1/sagefiles/sage-3.0.alpha5/local/lib/python2.5/site-packages/sage/modular/dirichlet.py
in values(self)
   1056 
   1057 # record character value on n
-> 1058 result_list[n.ivalue] = R_values[value.ivalue]
   1059 # iterate:
   1060 #   increase the exponent vector by 1,

: list index out of range


Should I report this to trac?

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: raw picture manipulation

2008-04-17 Thread David Joyner

This does not answer your question but might help your friend.
The command matrix_plot (eg, "sage: matrix_plot(random_matrix(GF(389),
10), cmap='Oranges')")
might be a simpler function to use if he just wants to test how good
the linear code works on an "image".

BTW, since you are the author of the SAGE search function
http://www.google.com/coop/cse?cx=017384562579735769466:s27byrlaffu
here is an interesting experiment: type "matrix plot" (without the quotes)
and see what you get. I think there are more hits on the plot of the movie
The Matrix than on the command matrix_plot, which is strange since
it should be SAGE specific. Maybe the wikipedia hits should have a lower
weight somehow?

On Thu, Apr 17, 2008 at 8:07 AM, Harald Schilly
<[EMAIL PROTECTED]> wrote:
>
>  Hi
>
>  A friend of mine want's to manipulate pictures (bitmap, in color).
>  Basically, he want's to load and then represent them as a binary
>  vector in Sage and then encode them using linear codes ->
>  manipulations (errors) -> then back to an image and see how good the
>  code worked.
>  The one thing I don't know is what's the best and easiest way to get a
>  binary representation of an image to be able to work with - a
>  bijection from picture to binary vector in GF(2) and back. Maybe in
>  different versions (each color channel separate or other methods).
>
>  Harald
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: fourier series

2008-04-15 Thread David Joyner

Here is an example:

sage: f = lambda x:x^2
sage: f = Piecewise([[(-1,1),f]])
sage: x = var("x")
sage: n = var("n")
sage: f.fourier_series_cosine_coefficient(n,1)
((2*pi^2*n^2 - 4)*sin(pi*n) + 4*pi*n*cos(pi*n))/(pi^3*n^3)
sage: maxima.eval('declare(n,integer)')
'done'
sage: f.fourier_series_cosine_coefficient(n,1)
4*(-1)^n/(pi^2*n^2)



On Tue, Apr 15, 2008 at 11:58 AM, James Morrow
<[EMAIL PROTECTED]> wrote:
> Hello David,
>
> I am interested in the nth term of the Fourier series.  In some cases there
> are simple formulas for that term (for example if the function is
> f(x)=x^2 on the interval [-pi,pi]).  However I can't figure out how to tell
> sage to do this.  I can ask it to compute int_{pi}^{pi} f(t)sin (n*t)dt)\pi,
> but it doesn't know that n is an integer and hence doesn't know that
> cos(pi*n) is (-1)^n or that sin(pi*n)=0.  I can't figure out how to get it
> to simplify the answer.
>
> Jim
>
>
>
>
> On Tue, Apr 15, 2008 at 4:02 AM, David Joyner <[EMAIL PROTECTED]> wrote:
>
> > The module piecewise.py has fairly extensive functionality for the
> > computation of Fourier series of piecewise defined periodic functions.
> > It even allows filters. There are examples at
> > http://www.sagemath.org/doc/html/const/node12.html
> >
> http://www.sagemath.org/hg/sage-main/file/cc1e12a492fc/sage/functions/piecewise.py
> > I think it is well documented but if tere are any questions, please just
> ask.
> >
> > On Mon, Apr 14, 2008 at 7:47 PM, William Stein <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > >
> > >  -- Forwarded message --
> > >  From: James Morrow <[EMAIL PROTECTED]>
> > >  Date: Mon, Apr 14, 2008 at 4:20 PM
> > >  Subject: fourier series
> > >  To: [EMAIL PROTECTED], William Stein <[EMAIL PROTECTED]>
> > >
> > >
> > >  Hello,
> > >
> > >  How do I use sage to compute a Fourier series?  The general question
> > >  is:  How to compute the nth term?  I guess I have to use maxima.  How
> > >  do I call maxima and then give it the imput?  I don't just want (say)
> > >  the 5th term, but the nth term.  Do I make n a variable (integer
> > >  variable)?  Maybe I can't do it in this generality, but for instance
> > >  this amounts to computing (int_{pi}^{pi} f(t)sin (n*t)dt)\pi, where I
> > >  declare n is an integer variable.
> > >
> > >  Jim
> > >
> > >
> > >  --
> > >  William Stein
> > >  Associate Professor of Mathematics
> > >  University of Washington
> > >  http://wstein.org
> > >
> > >  > > >
> > >
> >
>
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: fourier series

2008-04-15 Thread David Joyner

The module piecewise.py has fairly extensive functionality for the
computation of Fourier series of piecewise defined periodic functions.
It even allows filters. There are examples at
http://www.sagemath.org/doc/html/const/node12.html
http://www.sagemath.org/hg/sage-main/file/cc1e12a492fc/sage/functions/piecewise.py
I think it is well documented but if tere are any questions, please just ask.

On Mon, Apr 14, 2008 at 7:47 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
>  -- Forwarded message --
>  From: James Morrow <[EMAIL PROTECTED]>
>  Date: Mon, Apr 14, 2008 at 4:20 PM
>  Subject: fourier series
>  To: [EMAIL PROTECTED], William Stein <[EMAIL PROTECTED]>
>
>
>  Hello,
>
>  How do I use sage to compute a Fourier series?  The general question
>  is:  How to compute the nth term?  I guess I have to use maxima.  How
>  do I call maxima and then give it the imput?  I don't just want (say)
>  the 5th term, but the nth term.  Do I make n a variable (integer
>  variable)?  Maybe I can't do it in this generality, but for instance
>  this amounts to computing (int_{pi}^{pi} f(t)sin (n*t)dt)\pi, where I
>  declare n is an integer variable.
>
>  Jim
>
>
>  --
>  William Stein
>  Associate Professor of Mathematics
>  University of Washington
>  http://wstein.org
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: [sage-devel] Bad example with NICE graph isomorphism

2008-04-14 Thread David Joyner

Perhaps this has been fixed already?

sage: version()
'SAGE Version 3.0.alpha2, Release Date: 2008-04-06'
sage: import sage.graphs
sage: import sage.graphs.graph_isom
sage:
sage: G=Graph("[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@[EMAIL PROTECTED]@KN~_^}?~{")
<, 17, 18, 0, 5, 4, 2, 6, 1, 3, 9, 7, 8, 20, 25, 24, 22, 26, 21, 23,
29, 27, 28, 31, 30, 32]
sage: H=G.relabel(perm,inplace=False)
sage:
sage: _,Gcan=sage.graphs.graph_isom.search_tree(G,[range(G.order())])
sage: _,Hcan=sage.graphs.graph_isom.search_tree(H,[range(H.order())])
sage: if Gcan==Hcan:
: print "NICE says the graphs are isomorphic"
: else:
: print "NICE says the graphs are NOT isomorphic"
:
NICE says the graphs are isomorphic


Since bugs are usually reported to sage-support (not sage-devel), I am
cross-posting.


On Mon, Apr 14, 2008 at 2:03 PM, Stephen Hartke <[EMAIL PROTECTED]> wrote:
> Attached is an example where NICE does not correctly determine the
> isomorphism between two graphs.  I tested this with Sage 2.11.  I have not
> had an opportunity to examine the NICE code, so I'm not sure where the
> problem is.
>
> I do not currently have a Trac account, so I am sending the example here.
>
> Best wishes,
> Stephen
>
>
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Transverse wave and animate in 3D

2008-04-11 Thread David Joyner

These look awesome Hector. Can you add them to the wiki somewhere?

On Fri, Apr 11, 2008 at 2:42 AM, Hector Villafuerte <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 10, 2008 at 6:33 PM, William Stein <[EMAIL PROTECTED]> wrote:
>  [...]
>
> >  Basically, the above would work and look good, but would require
>  >  fixing some issues with Sage.   Go for it!
>  [...]
>
>  So, here's how it went :)
>  On SAGE terminal:
>
>
>  sage: stepJ = float(pi/6)
>  sage: stepK = float(0.1)
>  sage: A = float(2*pi)
>  sage:
>  sage: J = srange(-A,A,stepJ)
>  sage: K = srange(-A,A,stepK)
>  sage:
>  sage: V = []
>  sage:
>
> sage: for j in J:
>  : P  = point3d([(k,sin(k+j),0) for k in K], size=3,
>  viewer='tachyon')
>  : P += point3d([(k,0,sin(k+j)) for k in K], size=3,
>  viewer='tachyon', color='red')
>  : V.append(P)
>  :
>  sage: #... todavia no esta implementado en el Notebook, solo en la terminal
>  sage: L = ceil(float(log(len(V),10)))
>  sage: for k in range(len(V)):
>  : V[k].show(filename=pad_zeros(k,L), viewer='tachyon')
>
>
>  In bash terminal:
>  $ convert -delay 15 -loop 0 *.png "tr3d-1.gif"
>
>
>  And for the second one:
>
>  sage: var('x y')
>  (x, y)
>  sage: f(x) = x*exp(-x^2)
>  sage:
>  sage: stepJ = float(0.5)
>  sage: A = 4
>
> sage: J = srange(-A,A,stepJ)
>  sage: V = []
>  sage:
>
> sage: for j in J:
>  : P = plot3d(f(x-j), (x,-A,A), (y,-A,A), viewer='tachyon')
>  : V.append(P)
>  :
>  sage: #... todavia no esta implementado en el Notebook, solo en la terminal
>  sage: L = ceil(float(log(len(V),10)))
>  sage: for k in range(len(V)):
>  : V[k].show(filename=pad_zeros(k,L), viewer='tachyon',
>  aspect_ratio=[1,1,1])
>
>  In bash terminal:
>  $ convert -delay 15 -loop 0 *.png "tr3d-2.gif"
>
>
>  Animations are attached. Thanks for your help!
>  --
>   Hector
>
>
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: fft from matlab

2008-04-11 Thread David Joyner

On Fri, Apr 11, 2008 at 4:30 AM, Nicoo <[EMAIL PROTECTED]> wrote:
>
>  thx for theses examples, but now i don't found how to scale my plot, i
>  used list_plot

I'm not sure that you mean by scale but in any case, list_plot, and its
options, is described here
http://www.sagemath.org/doc/html/ref/module-sage.plot.plot.html#l2h-652
and show, and its options, is described here
http://www.sagemath.org/doc/html/ref/module-sage.plot.plot.html#l2h-747
>
>
>  On 10 avr, 18:38, Joshua Kantor <[EMAIL PROTECTED]> wrote:
>  > This should work for you
>  >
>  > sage: import numpy
>  > sage: a=numpy.loadtxt('my_file.txt')
>  > sage: x_vals=a[:,1]
>  > sage: y_vals=a[:,2]
>  >
>  > note that now x_vals and y_vals are numpy arrays. At this point you
>  > have a few ways of
>  > of doing the ftt
>  >
>  > Option 1
>  > sage: from numpy import fft
>  > sage: fft.fft(x_xvals)
>  > sage: fft.fft(y_vals)
>  >
>  > Option 2
>  > If you prefer sage vectors do it this way
>  >
>  > sage: import numpy
>  > sage: a=numpy.loadtxt('my_file.txt')
>  > sage: x_vals=vector(RDF,a[:,1])
>  > sage: y_vals=vector(RDF,a[:,2])
>  > sage: x_vals.fft()
>  > sage: y_vals.fft()
>  >
>  > If you are familiar with matlab, you should look at numpy and scipy
>  > (import numpy, import scipy). And you might find this 
> helpfulhttp://www.scipy.org/NumPy_for_Matlab_Users
>
>
> >
>  > On Apr 10, 9:25 am, Nicoo <[EMAIL PROTECTED]> wrote:
>  >
>  > > simple txt file with columns
>  > > first column is the time, second the X velocity value, third the Y
>  > > velocity value
>  > > and I want to fft each components of velocity to get the frequency of
>  > > oscillations.
>  > > (sry for my bad english)
>  >
>  > > On 10 avr, 18:16, "William Stein" <[EMAIL PROTECTED]> wrote:
>  >
>  > > > On Thu, Apr 10, 2008 at 9:15 AM, Nicoo <[EMAIL PROTECTED]> wrote:
>  >
>  > > > >  thx, I will try the fft() method, other question, how can I load my
>  > > > >  datas in a vector ?
>  >
>  > > > What format are your datas in?
>  >
>  > > >  -- William
>  >
>  > > > >  On 10 avr, 17:40, "William Stein" <[EMAIL PROTECTED]> wrote:
>  >
>  > > > > > On Thu, Apr 10, 2008 at 8:26 AM, Nicoo <[EMAIL PROTECTED]> wrote:
>  > > > >  > >  Hello there,
>  > > > >  > >  -I used matlab to fft some datas, I have .m file from matlab, 
> is it
>  > > > >  > >  possible to load it in sagemath and use it ?
>  >
>  > > > >  > No, the Sage programming language is Python, which is as
>  > > > >  > different from Matlab's language as Mathematica is different
>  > > > >  > than Matlab.
>  >
>  > > > >  > Sage does have fft functionality itself though:
>  >
>  > > > >  > sage: v = vector(RDF, 1, range(1))
>  > > > >  > sage: time w = v.fft()
>  > > > >  > CPU time: 0.00 s,  Wall time: 0.00 s
>  >
>  > > > >  > It's also possible to use the Sage interfaces to Matlab/Octave...
>  >
>  > > > >  >  -- William
>  >
>  > > > --
>  > > > William Stein
>  > > > Associate Professor of Mathematics
>  > > > University of Washingtonhttp://wstein.org
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: GeneratorsOfGroup

2008-04-09 Thread David Joyner

On Wed, Apr 9, 2008 at 12:08 PM, Becky <[EMAIL PROTECTED]> wrote:
>
>  Yes, I am looking for a finite presentation for SL_3(Z).  I was able
>  to get three generators from SAGE:
>  sage: G=SL(3,ZZ)
>  sage: G.gens()
>  [
>  [0 1 0]
>  [0 0 1]
>  [1 0 0],
>  [0  1 0]
>  [-1 0 0]
>  [0  0 1],
>  [1 1 0]
>  [0 1 0]
>  [0 0 1]]
>
>  I have what I think is a different set of matrix generators, and I'd
>  like to be able to write mine in terms of these.  For example, what is
>  the matrix
>  [[0 -1 0][-1 0 0][0 0 -1]] in terms of the above?

The work problem is in general unsolvable for infinite groups,
http://en.wikipedia.org/wiki/Word_problem_for_groups
No solution algorithm has been implemented in SAGE, except for
finite permutation groups.
Of course, there exist infinite groups with a solvable word problem
and GAP (included with SAGE) might have an algorithm for some of them.
(For example, possibly for polycyclic groups). Here's a link to the GAP
manual which might be a start:
http://www.gap-system.org/Manuals/doc/htm/ref/CHAP037.htm#I2


>  Ideally, I'm looking for the analogue of SL_2(Z)=  (ST)^6=1> where S =[[0 -1][1 0]] and T=[[1 1][0 1]], but for SL_3(Z).
>  Any help you can give me would be greatly appreciated.  Thanks.
>  -Becky
>
>
>  On Apr 7, 6:22 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
>  > Hi Becky,
>  >
>  > Did you have a particular group in mind?
>  >
>  > --Mike
>  >
>  >
>  >
>
> > On Mon, Apr 7, 2008 at 3:19 PM, Becky <[EMAIL PROTECTED]> wrote:
>  >
>  > >  Is there a command for SAGE to write an element of a group in terms of
>  > >  the group's generators?
>  > >  -Becky- Hide quoted text -
>  >
>  > - Show quoted text -
>
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: [sage-devel] Re: [sage-support] PDE and Finite Element methods

2008-04-07 Thread David Joyner

On Mon, Apr 7, 2008 at 2:35 PM, Anders Logg <[EMAIL PROTECTED]> wrote:
>
>  On 7 Apr, 16:47, "Ondrej Certik" <[EMAIL PROTECTED]> wrote:
>  > On Mon, Apr 7, 2008 at 4:15 PM, David Joyner <[EMAIL PROTECTED]> wrote:
>  >
>  > >  On Mon, Apr 7, 2008 at 10:08 AM, Ondrej Certik <[EMAIL PROTECTED]> 
> wrote:
>  >
>  > >  >  On Mon, Apr 7, 2008 at 3:41 PM, Mike Hansen <[EMAIL PROTECTED]> 
> wrote:
>
>
> >
>  > >  >  >  On Mon, Apr 7, 2008 at 6:25 AM, Ondrej Certik <[EMAIL PROTECTED]> 
> wrote:
>  > >  >  >  >  Yes, I did. This is the code developed by people at Simula. It 
> works
>  > >  >  >  >  nice, but it's quite difficult to install. I generally prefer 
> smaller
>  > >  >  >  >  tools, if I can get the job done.
>  >
>  > >  >  >  >  Ondrej
>  >
>  > >  >  >  Other than size and build issues, are the two projects equivalent
>  > >  >  >  feature / speed-wise?
>  >
>  > >  >  To my purposes, sfepy is better than fenics, because sfepy is in
>  > >  >  python (and can do all I need). As to speed, that's about the same,
>  > >  >  because the mainloop of sfepy for the assembly is in pure C, without
>  > >  >  any python callbacks. Also because it's smaller, I find it simpler to
>  > >  >  use. But Fenics definitely is also good and have it's users.
>  >
>  > >  Feature-wise, is Fenics better than sfepy?
>  >
>  > I tried Fenics about a year ago, so they may have improved. For my own
>  > purposes, i.e. solving a PDE, with Neumann or Dirichlet boundary
>  > conditions,
>  > assigning different material properties to different regions in the
>  > body, etc., sfepy is better in a sense, that I was able to do what I
>  > want in it (with the help of Robert) easier than in Fenics.
>  >
>  > > You did seem to indicate sfepy
>  > >  is smaller. Is it because Fenics does more?
>  >
>  > Because they are doing almost everything in C++, while sfepy uses a
>  > very clever approach of only doing the main assembly loop in pure C,
>  > otherwise doing everything in Python (so it's the same fast as the
>  > libmesh (also C++ library) for my own purposes). Also, at the time I
>  > tried Fenics, I had to code in C++ to do what I want. I don't like
>  > that, I prefer
>  > to work in Python (in sfepy, you don't have to touch the C code,
>  > unless you want to do something very unusual). But they may have
>  > improved since then.
>  >
>  > > Also, isn't Fenics also in
>  > >  C+Python?
>  >
>  > It's Python + C++. I don't like C++, I really prefer Python + C, it's
>  > easier to understand, cleaner, more portable, easier to wrap in
>  > Python, etc.
>  >
>  > Well, download the sources of Dolfin and sfepy and see for yourself.
>  > It takes less than 30s to compile sfepy on my computer. I haven't
>  > tried dolphin, because it requires some dependencies I don't have, but
>  > I am sure it will take at least 20x more time. Sfepy only requires
>  > numpy+scipy.
>  >
>  > Ondrej
>
>  Just a few comments.
>
>  1. Yes, we have improved (as always... :-) but it's still far from
>  finished.
>
>  There's a simple example demonstrating the solution of Poisson's
>  equation
>  on this page: http://www.fenics.org/wiki/Tutorial
>
>  More demos can be found here:
>
>  
> http://www.fenics.org/hg/dolfin?cmd=manifest;manifest=e91acc1d9b392762c6cc1310abad399aef240993;path=/demo/
>
>  2. Yes, FEniCS is fairly complex: http://www.fenics.org/wiki/Projects
>
>  However, this shouldn't be a problem for users, and there are (Ubuntu)
>  packages
>  that let you install everything by just doing apt-get install fenics.

[EMAIL PROTECTED]:~/wdj/computer_algebra/dolfin$ sudo apt-get install fenics
[sudo] password for wdj:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package fenics

Maybe a site has to be added to /etc/sources?

>
>  --
>  Anders
>
>
>
>  >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



<    2   3   4   5   6   7   8   9   10   >