[sage-support] Re: numpy.sin() problem

2007-09-03 Thread legout

Hi,

thanks for your answers. Now i see whats the problem.

One more question. I mainly use numpy,scipy,f2py,cython from sage
instead of python+numpy+scipy.
Is it reasonable to set Realnumbers=float in each session? Or will
this cause new problems?

volker

On 1 Sep., 22:11, Joshua Kantor [EMAIL PROTECTED] wrote:
 Hello. I believe the issue is that earlier in the tutorial I had set

 sage: RealNumber=float

 but I didn't specify to reenter this in the section you were looking
 at.

 If you enter this before the example it will work fine. The issue is
 that as
 William indicated, if you do not do this, instead of numpy floats in
 x, you get sage reals
 which are not as fast and don't work with numpy. I will look over the
 tutorial, but there may be some more instances
 where I forgot to re-specify that this needed to be entered.

 You may also wish to note that I have a slightly newer version of  the
 notes here on my 
 webpagehttp://www.math.washington.edu/~jkantor/Numerical_Sage/Numerical_Sage...

 which is a bit ahead of the one in sage documentation (I need to
 update it).

 Josh
 On Aug 31, 1:50 pm, William [EMAIL PROTECTED] wrote:

  Hi,

  This is an issue with the preparser and numpy not playing well
  together.  E.g., if you do this it works fine:

  sage: preparser(False)
  sage: import numpy
  sage: j=numpy.complex(0,1)
  sage: num_points=50
  sage: u=numpy.zeros((num_points,num_points),dtype=float)
  sage: pi_c=float(pi)
  sage: x=numpy.r_[0.0:pi_c:num_points*j]
  sage: u[0,:]=numpy.sin(x)

  Note that the command preparser(False) isn't supported in the
  notebook yet.  You %python or
  switch to python mode.

  In the long run we hope to improve numpy / SAGE interaction.

  On Aug 30, 1:03 am, legout [EMAIL PROTECTED] wrote:

   Hi,

   i´ve got the following problem on my sage installation.
   The folloing code 
   fromhttp://www.math.washington.edu/~jkantor/Numerical_Sage/node11.html
   Didn´t work for me:

   import numpy
   j=numpy.complex(0,1)
   num_points=50
   u=numpy.zeros((num_points,num_points),dtype=float)
   pi_c=float(pi)
   x=numpy.r_[0.0:pi_c:num_points*j]
   u[0,:]=numpy.sin(x)
   ---
   type 'exceptions.AttributeError'Traceback (most recent call
   last)

   /home/volker/ipython console in module()

   type 'exceptions.AttributeError': 'float' object has no attribute
   'sin'

   I can use this (its the same, because sin(x[-1])=0)

   u[0, :-1]=numpy.sin(x[ :-1])

   And using real instead of float, and everything works as aspected

   pi_c = real(pi)
   x=numpy.r_[0.0:pi_c:num_points*j]
   u[0,:]=numpy.sin(x)

   Is this a bug in sage? On my normal python + numpy session the first
   code runs just find.

   volker


--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: numpy.sin() problem

2007-09-03 Thread William Stein

On 9/3/07, legout [EMAIL PROTECTED] wrote:

 Hi,

 thanks for your answers. Now i see whats the problem.

 One more question. I mainly use numpy,scipy,f2py,cython from sage
 instead of python+numpy+scipy.
 Is it reasonable to set Realnumbers=float in each session? Or will
 this cause new problems?

This should be quite reasonable.  In fact, you might even just create
a file
  $HOME/.sage/init.sage
that has the line
   RealNumber = foat
in it, so this is automatic.  You might also want
   Integer = int

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Changing basis in finite fields

2007-09-03 Thread Ahmad

Dear All,

I'm new to sage and I don't know even if I'm supposed to post such
questions to this group or not. If it is a correct place:

Could you please tell me how can I change the basis in finite field
representation. As much as know sage represent the finite field
extension in:

[1, t, t^2, .., t^{n-1}]

for t being the root of irreducible polynomial used to extend the
field. I need to represent my field in normal basis (I have chosen my
irreducible polynomial such that [t, t^2, t^4 .., t^{2^{n-1}}] forms a
basis for the extension).

If it is not a correct place to ask such questions, please guide me to
the correct place.

Thank you very much for your attention and devotion of time!

Bests,
Ahmad


--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Changing basis in finite fields

2007-09-03 Thread David Joyner

This is the right place but I don't think what you want is implemented.
The commands and examples are here:
http://www.sagemath.org/doc/html/ref/module-sage.rings.finite-field.html

It would be some work but possibly you could do what you could in SAGE,
then use GAP's NormalBase command?
http://www.gap-system.org/Manuals/doc/htm/ref/CHAP056.htm#SSEC003.7

+


On 9/3/07, Ahmad [EMAIL PROTECTED] wrote:

 Dear All,

 I'm new to sage and I don't know even if I'm supposed to post such
 questions to this group or not. If it is a correct place:

 Could you please tell me how can I change the basis in finite field
 representation. As much as know sage represent the finite field
 extension in:

 [1, t, t^2, .., t^{n-1}]

 for t being the root of irreducible polynomial used to extend the
 field. I need to represent my field in normal basis (I have chosen my
 irreducible polynomial such that [t, t^2, t^4 .., t^{2^{n-1}}] forms a
 basis for the extension).

 If it is not a correct place to ask such questions, please guide me to
 the correct place.

 Thank you very much for your attention and devotion of time!

 Bests,
 Ahmad


 


--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Changing basis in finite fields

2007-09-03 Thread William Stein

On 9/3/07, Ahmad [EMAIL PROTECTED] wrote:
 I'm new to sage and I don't know even if I'm supposed to post such
 questions to this group or not. If it is a correct place:

 Could you please tell me how can I change the basis in finite field
 representation. As much as know sage represent the finite field
 extension in:

 [1, t, t^2, .., t^{n-1}]

 for t being the root of irreducible polynomial used to extend the
 field. I need to represent my field in normal basis (I have chosen my
 irreducible polynomial such that [t, t^2, t^4 .., t^{2^{n-1}}] forms a
 basis for the extension).

 If it is not a correct place to ask such questions, please guide me to
 the correct place.

 Thank you very much for your attention and devotion of time!

Here is an example session in which I create a finite field,
find a normal basis, then explicitly represent elements in
terms of it (by pushing everything over to vector spaces).

I have to define two functions below in order to
do this.  If people think something like this would be generally
useful, then it could be made built in to SAGE:

sage: k.a = GF(2^5)
sage: k
Finite Field in a of size 2^5
sage: V = k.vector_space()
sage: z = (1+a)^17; z
a^3 + a + 1
sage: def to_V(w):
...   return V(w.polynomial().padded_list(V.dimension()))
sage: to_V(z)
(1, 1, 0, 1, 0)
sage: B2 = [(a+1)^(2^i) for i in range(k.degree())]
sage: W = [to_V(b) for b in B2]
sage: V.span(W).dimension()
5
sage: W0 = V.span_of_basis(W)
sage: def in_terms_of_normal_basis(z):
...   return W0.coordinates(to_V(z))
sage: in_terms_of_normal_basis(a+1)
[1, 0, 0, 0, 0]
sage: in_terms_of_normal_basis(1 + a + a^2 + a^3)
[1, 0, 0, 1, 0]



Or, in SAGE notebook text format:

ahmad -- sage-support
system:sage

{{{id=0|
k.a = GF(2^5)
}}}

{{{id=1|
k
///
Finite Field in a of size 2^5
}}}

{{{id=2|
V = k.vector_space()
}}}

{{{id=3|
z = (1+a)^17; z
///
a^3 + a + 1
}}}

{{{id=4|
def to_V(w):
return V(w.polynomial().padded_list(V.dimension()))
}}}

{{{id=5|
to_V(z)
///
(1, 1, 0, 1, 0)
}}}

{{{id=6|
B2 = [(a+1)^(2^i) for i in range(k.degree())]
}}}

{{{id=7|
W = [to_V(b) for b in B2]
}}}

{{{id=8|
V.span(W).dimension()
///
5
}}}

{{{id=9|
W0 = V.span_of_basis(W)
}}}

{{{id=10|
def in_terms_of_normal_basis(z):
return W0.coordinates(to_V(z))
}}}

{{{id=11|
in_terms_of_normal_basis(a+1)
///
[1, 0, 0, 0, 0]
}}}

{{{id=12|
in_terms_of_normal_basis(1 + a + a^2 + a^3)
///
[1, 0, 0, 1, 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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: sage logo page?

2007-09-03 Thread William Stein

On 9/3/07, mabshoff [EMAIL PROTECTED] wrote:
  I wonder if at some point an analog ofhttp://www.python.org/community/logos/
  could be created for SAGE. I'm not saying
  people couldn't use the SAGE art. Just, it would be
  nice I think to have a page which lists the logos
  which the SAGE Group has a copyright for and
  encourages the use of.
  - David
 

 Not me, I own enough open ticket ;), but we should also recreate the
 snapshot page we used to have before the last web page redesign. I am
 also cross posting this to sage-support, there might be gifted people
 over there willing to help out.

There are some screen shots here (search for screen shots on this page):
   http://sagemath.org/download.html

It might be better to move screen shots to a wiki, since nobody ever makes
them except me as it is, and mine aren't so good.

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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: sage logo page?

2007-09-03 Thread Jurgis Pralgauskis
an idea (based on http://sagemath.org/art/.html/sage-bg1-thumb.jpg)
http://moodle.projektas.lt/failai/sage/

I'd like to show some kind of convergation.., and as usulay in OS
communities - some kind of circle :)


On 9/4/07, mabshoff [EMAIL PROTECTED] wrote:



 On Sep 3, 11:02 pm, William Stein [EMAIL PROTECTED] wrote:
  David Joyner has a really good idea below.  Any volunteers?
 
  -- Forwarded message --
  From: David Joyner [EMAIL PROTECTED]
  Date: Sep 3, 2007 12:56 PM
  Subject: sage logo page?
  To: William Stein [EMAIL PROTECTED]
 
  Cc: David Joyner [EMAIL PROTECTED]
 
  Hi William:
  I wonder if at some point an analog ofhttp://www.python.org/community/logos/
  could be created for SAGE. I'm not saying
  people couldn't use the SAGE art. Just, it would be
  nice I think to have a page which lists the logos
  which the SAGE Group has a copyright for and
  encourages the use of.
  - David
 

 Not me, I own enough open ticket ;), but we should also recreate the
 snapshot page we used to have before the last web page redesign. I am
 also cross posting this to sage-support, there might be gifted people
 over there willing to help out.

 Cheers,

 Michael


 



-- 
Jurgis Pralgauskis
mob.: 865-765-656, +37061677613; skype: dz0rdzas;
Don't worry, be happy :) and make things better ;)

reikalaukime ATVIRŲ ir nepriklausomų STANDARTŲ:
http://www.noooxml.org/petition-lt
http://www.openstandards.eu/

--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: sage logo page?

2007-09-03 Thread William Stein
Thanks.

One thing that has sort of emerged over the last year is that Sage isn't
just for Algebra and Geometry, it's for much much more.  So we've sort
of stopped think of SAGE as an acronym, and more as just a word
(like a wise mathematical sage that gathers together the wisdom
of generation).

On 9/3/07, Jurgis Pralgauskis [EMAIL PROTECTED] wrote:
 an idea (based on http://sagemath.org/art/.html/sage-bg1-thumb.jpg)
 http://moodle.projektas.lt/failai/sage/

 I'd like to show some kind of convergation.., and as usulay in OS
 communities - some kind of circle :)


 On 9/4/07, mabshoff [EMAIL PROTECTED] wrote:
 
 
 
  On Sep 3, 11:02 pm, William Stein [EMAIL PROTECTED] wrote:
   David Joyner has a really good idea below.  Any volunteers?
  
   -- Forwarded message --
   From: David Joyner [EMAIL PROTECTED]
   Date: Sep 3, 2007 12:56 PM
   Subject: sage logo page?
   To: William Stein [EMAIL PROTECTED]
  
   Cc: David Joyner [EMAIL PROTECTED]
  
   Hi William:
   I wonder if at some point an analog 
   ofhttp://www.python.org/community/logos/
   could be created for SAGE. I'm not saying
   people couldn't use the SAGE art. Just, it would be
   nice I think to have a page which lists the logos
   which the SAGE Group has a copyright for and
   encourages the use of.
   - David
  
 
  Not me, I own enough open ticket ;), but we should also recreate the
  snapshot page we used to have before the last web page redesign. I am
  also cross posting this to sage-support, there might be gifted people
  over there willing to help out.
 
  Cheers,
 
  Michael
 
 
  
 


 --
 Jurgis Pralgauskis
 mob.: 865-765-656, +37061677613; skype: dz0rdzas;
 Don't worry, be happy :) and make things better ;)

 reikalaukime ATVIRŲ ir nepriklausomų STANDARTŲ:
 http://www.noooxml.org/petition-lt
 http://www.openstandards.eu/

 



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://www.williamstein.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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: sage logo page?

2007-09-03 Thread Timothy Clemans
Here are two images based around the same idea. I don't know how to do
illustration.

On 9/3/07, William Stein [EMAIL PROTECTED] wrote:
 Thanks.

 One thing that has sort of emerged over the last year is that Sage isn't
 just for Algebra and Geometry, it's for much much more.  So we've sort
 of stopped think of SAGE as an acronym, and more as just a word
 (like a wise mathematical sage that gathers together the wisdom
 of generation).

 On 9/3/07, Jurgis Pralgauskis [EMAIL PROTECTED] wrote:
  an idea (based on http://sagemath.org/art/.html/sage-bg1-thumb.jpg)
  http://moodle.projektas.lt/failai/sage/
 
  I'd like to show some kind of convergation.., and as usulay in OS
  communities - some kind of circle :)
 
 
  On 9/4/07, mabshoff [EMAIL PROTECTED] wrote:
  
  
  
   On Sep 3, 11:02 pm, William Stein [EMAIL PROTECTED] wrote:
David Joyner has a really good idea below.  Any volunteers?
   
-- Forwarded message --
From: David Joyner [EMAIL PROTECTED]
Date: Sep 3, 2007 12:56 PM
Subject: sage logo page?
To: William Stein [EMAIL PROTECTED]
   
Cc: David Joyner [EMAIL PROTECTED]
   
Hi William:
I wonder if at some point an analog 
ofhttp://www.python.org/community/logos/
could be created for SAGE. I'm not saying
people couldn't use the SAGE art. Just, it would be
nice I think to have a page which lists the logos
which the SAGE Group has a copyright for and
encourages the use of.
- David
   
  
   Not me, I own enough open ticket ;), but we should also recreate the
   snapshot page we used to have before the last web page redesign. I am
   also cross posting this to sage-support, there might be gifted people
   over there willing to help out.
  
   Cheers,
  
   Michael
  
  
   
  
 
 
  --
  Jurgis Pralgauskis
  mob.: 865-765-656, +37061677613; skype: dz0rdzas;
  Don't worry, be happy :) and make things better ;)
 
  reikalaukime ATVIRŲ ir nepriklausomų STANDARTŲ:
  http://www.noooxml.org/petition-lt
  http://www.openstandards.eu/
 
  
 


 --
 William Stein
 Associate Professor of Mathematics
 University of Washington
 http://www.williamstein.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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---

inline: SAGE-Logo.gifinline: SAGE-Logo2.gif

[sage-support] Re: Fwd: sage logo page?

2007-09-03 Thread William Stein
Please post logos here:

http://wiki.sagemath.org/logos

On 9/3/07, Timothy Clemans [EMAIL PROTECTED] wrote:
 Here are two images based around the same idea. I don't know how to do
 illustration.

 On 9/3/07, William Stein [EMAIL PROTECTED] wrote:
  Thanks.
 
  One thing that has sort of emerged over the last year is that Sage isn't
  just for Algebra and Geometry, it's for much much more.  So we've sort
  of stopped think of SAGE as an acronym, and more as just a word
  (like a wise mathematical sage that gathers together the wisdom
  of generation).
 
  On 9/3/07, Jurgis Pralgauskis [EMAIL PROTECTED] wrote:
   an idea (based on http://sagemath.org/art/.html/sage-bg1-thumb.jpg)
   http://moodle.projektas.lt/failai/sage/
  
   I'd like to show some kind of convergation.., and as usulay in OS
   communities - some kind of circle :)
  
  
   On 9/4/07, mabshoff [EMAIL PROTECTED] wrote:
   
   
   
On Sep 3, 11:02 pm, William Stein [EMAIL PROTECTED] wrote:
 David Joyner has a really good idea below.  Any volunteers?

 -- Forwarded message --
 From: David Joyner [EMAIL PROTECTED]
 Date: Sep 3, 2007 12:56 PM
 Subject: sage logo page?
 To: William Stein [EMAIL PROTECTED]

 Cc: David Joyner [EMAIL PROTECTED]

 Hi William:
 I wonder if at some point an analog 
 ofhttp://www.python.org/community/logos/
 could be created for SAGE. I'm not saying
 people couldn't use the SAGE art. Just, it would be
 nice I think to have a page which lists the logos
 which the SAGE Group has a copyright for and
 encourages the use of.
 - David

   
Not me, I own enough open ticket ;), but we should also recreate the
snapshot page we used to have before the last web page redesign. I am
also cross posting this to sage-support, there might be gifted people
over there willing to help out.
   
Cheers,
   
Michael
   
   

   
  
  
   --
   Jurgis Pralgauskis
   mob.: 865-765-656, +37061677613; skype: dz0rdzas;
   Don't worry, be happy :) and make things better ;)
  
   reikalaukime ATVIRŲ ir nepriklausomų STANDARTŲ:
   http://www.noooxml.org/petition-lt
   http://www.openstandards.eu/
  
   
  
 
 
  --
  William Stein
  Associate Professor of Mathematics
  University of Washington
  http://www.williamstein.org
 
  
 

 




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://www.williamstein.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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: sage logo page?

2007-09-03 Thread Ted Kosan

William wrote

 One thing that has sort of emerged over the last year is that Sage isn't
 just for Algebra and Geometry, it's for much much more.  So we've sort
 of stopped think of SAGE as an acronym, and more as just a word
 (like a wise mathematical sage that gathers together the wisdom
 of generation).

If Sage is no longer an acronym, does this mean that typing its name
in all capital letters isn't necessary anymore?

Ted

--~--~-~--~~~---~--~~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---