[sage-support] Re: sign of a permutation

2008-06-30 Thread John H Palmieri
On Jun 30, 7:00 pm, "David Joyner" <[EMAIL PROTECTED]> wrote: > 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,

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

[sage-support] Re: sign of a permutation

2008-06-30 Thread John H Palmieri
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(

[sage-support] Re: Characters of large finite fields, AttributeError: 'sage.rings.integer_mod.IntegerMod_int64' object has no attribute 'ivalue'

2008-06-30 Thread William Stein
On Mon, Jun 30, 2008 at 8:36 AM, Gaëtan Bisson <[EMAIL PROTECTED]> wrote: > > Dear SAGE community, > > I am trying to compute characters for some finite fields. > > With "small" fields, everything is fine: > sage: K=CyclotomicField(10); > sage: p=10151; > sage: Character=DirichletGroup(p,

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

[sage-support] sign of a permutation

2008-06-30 Thread John H Palmieri
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/

[sage-support] Re: exemple from prog.pdf does not work

2008-06-30 Thread ibrahim
I have the same message in notebook and command-line On Jun 30, 8:27 pm, John H Palmieri <[EMAIL PROTECTED]> wrote: > On Jun 30, 9:47 am, ibrahim <[EMAIL PROTECTED]> wrote: > > > > > Hello. > > >  Trying to execute the exemple of page 33 : hello.spyx produces this > > error : > > > Loading of f

[sage-support] Re: exemple from prog.pdf does not work

2008-06-30 Thread John H Palmieri
On Jun 30, 9:47 am, ibrahim <[EMAIL PROTECTED]> wrote: > Hello. > >  Trying to execute the exemple of page 33 : hello.spyx produces this > error : > > Loading of file "/Users/ims/.sage/hello.spy" has type not implemented. > > nb : page 33 > > hello.spyx contains > def hello(name): >    """ >    

[sage-support] Re: exemple from prog.pdf does not work

2008-06-30 Thread Justin C. Walker
On Jun 30, 2008, at 09:47 , ibrahim wrote: > Trying to execute the exemple of page 33 : hello.spyx produces this > error : > > Loading of file "/Users/ims/.sage/hello.spy" has type not implemented. > > nb : page 33 I'm not familiar with the error, but if the above is a copy/paste of the error

[sage-support] exemple from prog.pdf does not work

2008-06-30 Thread ibrahim
Hello. Trying to execute the exemple of page 33 : hello.spyx produces this error : Loading of file "/Users/ims/.sage/hello.spy" has type not implemented. nb : page 33 hello.spyx contains def hello(name): """ Print hello with the given name. """ print("Hello %s"%name) and in sage

[sage-support] Re: variable number of arguments for a function

2008-06-30 Thread ibrahim
Thanks ! On Jun 30, 5:31 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote: > Hello, > > In Python you can use *args and **kwds in the function definition to > match optional arguments and keyword arguments; args will be a tuple > of the arguments and kwds will be a dictionary for the keyword > argumen

[sage-support] Re: group rings question

2008-06-30 Thread Robert Bradshaw
On Jun 29, 2008, at 6:54 PM, David Joyner wrote: > 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. The apparent inabil

[sage-support] Characters of large finite fields, AttributeError: 'sage.rings.integer_mod.IntegerMod_int64' object has no attribute 'ivalue'

2008-06-30 Thread Gaëtan Bisson
Dear SAGE community, I am trying to compute characters for some finite fields. With "small" fields, everything is fine: sage: K=CyclotomicField(10); sage: p=10151; sage: Character=DirichletGroup(p,K); sage: Khi=Character.0; sage: Khi(7) zeta10 However, with slightly larger

[sage-support] Re: variable number of arguments for a function

2008-06-30 Thread Mike Hansen
Hello, In Python you can use *args and **kwds in the function definition to match optional arguments and keyword arguments; args will be a tuple of the arguments and kwds will be a dictionary for the keyword arguments. For example, look at the behavior of the following function: sage: def f(*ar

[sage-support] variable number of arguments for a function

2008-06-30 Thread ibrahim
Hello ! How to do so if possible ? 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/grou

[sage-support] Re: matrix, Singular -->SAGE

2008-06-30 Thread Mike Hansen
Hello Gema, You just need to run the following: sage: m.sage_matrix(QQ) [-6 5 4 3 0] [ 6 0 -2 -3 1] [ 6 -1 0 -3 2] [ 6 -1 -2 0 3] [-6 1 2 3 0] or you can replace ZZ with whatever ring you want the matrix to be over. --Mike On Mon, Jun 30, 2008 at 8:31 AM, gema m. <[EMAIL PROTEC

[sage-support] matrix, Singular -->SAGE

2008-06-30 Thread gema m.
Hello, I have a matrix "m" that's a Singular object and I would like to compute the eigenvalues via SAGE. So I have to import such a matrix to SAGE, am i right? But , how? could you help me , please? Here I send my code: sage: singular.lib('rootsmr.lib') sage: singular.ring(0,'(x,y,z)','dp') sa

[sage-support] Re: How do I add a legend to a plot in Sage?

2008-06-30 Thread Martin Albrecht
On Monday 30 June 2008, William Stein wrote: > On Mon, Jun 30, 2008 at 5:41 AM, Stan Schymanski <[EMAIL PROTECTED]> wrote: > > I would like to be able to add legends to plots containing different > > lines or functions. Could anyone give an example of how to achieve > > this in SAGE? > > For examp

[sage-support] relative path

2008-06-30 Thread ibrahim
Hello ! I wrote an interface for a c++ program opening and writing files using relative path. But with SAGE I have to make absolute path. How can I do to use relative path ? Thanks! --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@go

[sage-support] Re: How do I add a legend to a plot in Sage?

2008-06-30 Thread William Stein
On Mon, Jun 30, 2008 at 5:41 AM, Stan Schymanski <[EMAIL PROTECTED]> wrote: > > I would like to be able to add legends to plots containing different > lines or functions. Could anyone give an example of how to achieve > this in SAGE? > For example, the following plot would be nice with a legend co

[sage-support] How do I add a legend to a plot in Sage?

2008-06-30 Thread Stan Schymanski
I would like to be able to add legends to plots containing different lines or functions. Could anyone give an example of how to achieve this in SAGE? For example, the following plot would be nice with a legend containing the line colours and descriptions: sage: P1=plot(x^2,0,3) sage: P1=plot(x^2,

[sage-support] Re: Nullstellensatz certificates

2008-06-30 Thread Martin Albrecht
On Monday 30 June 2008, Alex Raichev wrote: > Dear Sage support: > > Hilbert's Nullstellensatz states that a system of polynomial > equations f_1(x) = 0,..., f_s (x) = 0, where f_i in K[x_1,..., x_n ] > and K is an algebraically closed field, has no solution in K^n if and > only if there exist po