[sage-devel] Re: Additive Groups

2008-08-30 Thread Robert Bradshaw
On Aug 29, 2008, at 5:07 AM, Robert Bradshaw wrote: On Aug 29, 2008, at 5:01 AM, John Cremona wrote: The trouble was that I wanted common code for both additive and multiplicative groups, which I can -- almost-- implement. Your way, we have one type of element derived from some

[sage-devel] Re: Additive Groups

2008-08-29 Thread Nils Skoruppa
On 28 Aug., 15:20, John Cremona [EMAIL PROTECTED] wrote: Thanks for your comments, David.  I am having some success: The one thing I cannot get to work in the additive case is (for example) 2*g where g is a group element. I have tried all possible combinations of __lmul__, _lmul_,

[sage-devel] Re: Additive Groups

2008-08-29 Thread John Cremona
Thanks Nils, I'll look at how you did that. John 2008/8/29 Nils Skoruppa [EMAIL PROTECTED]: On 28 Aug., 15:20, John Cremona [EMAIL PROTECTED] wrote: Thanks for your comments, David. I am having some success: The one thing I cannot get to work in the additive case is (for example) 2*g

[sage-devel] Re: Additive Groups

2008-08-29 Thread mabshoff
On Aug 29, 2:24 am, Nils Skoruppa [EMAIL PROTECTED] wrote: SNIP Hi Nils, I cannot explain why this works, but if you want to have a look:http://hg.countnumber.de/fqm-devel/file/98bb736f0c07/cn_group/finite_... (and then  line  2132  class

[sage-devel] Re: Additive Groups

2008-08-29 Thread John Cremona
Nils, I hope you do -- I was certainly impressed by the presentation of this which you gave at the Bristol meeting last week. John 2008/8/29 mabshoff [EMAIL PROTECTED]: On Aug 29, 2:24 am, Nils Skoruppa [EMAIL PROTECTED] wrote: SNIP Hi Nils, I cannot explain why this works, but if you

[sage-devel] Re: Additive Groups

2008-08-29 Thread Robert Bradshaw
On Aug 29, 2008, at 2:24 AM, Nils Skoruppa wrote: On 28 Aug., 15:20, John Cremona [EMAIL PROTECTED] wrote: Thanks for your comments, David. I am having some success: The one thing I cannot get to work in the additive case is (for example) 2*g where g is a group element. I have tried all

[sage-devel] Re: Additive Groups

2008-08-29 Thread John Cremona
The trouble was that I wanted common code for both additive and multiplicative groups, which I can -- almost-- implement. Your way, we have one type of element derived from some MultiplicativeElement class and another from an Additive one, with a lot of duplicated code. But I'll look at your

[sage-devel] Re: Additive Groups

2008-08-29 Thread Robert Bradshaw
On Aug 29, 2008, at 5:01 AM, John Cremona wrote: The trouble was that I wanted common code for both additive and multiplicative groups, which I can -- almost-- implement. Your way, we have one type of element derived from some MultiplicativeElement class and another from an Additive one,

[sage-devel] Re: Additive Groups

2008-08-29 Thread Nils Skoruppa
On 29 Aug., 11:55, mabshoff [EMAIL PROTECTED] wrote: Out of curiosity: Do you plan to submit the code to Sage eventually? Cheers, Michael Hi Michael, yes, I shall definitely do so within the next weeks. ---Nils --~--~-~--~~~---~--~~ To post to this group,

[sage-devel] Re: Additive Groups

2008-08-28 Thread David Joyner
Since no one has emailed intelligent comments yet, I'll add my own not-so-intelligent but hopefully encouraging ones below:-) On Wed, Aug 27, 2008 at 3:18 PM, John Cremona [EMAIL PROTECTED] wrote: Currently in Sage, AbelianGroups are all multiplicative. There's a TODO in abelian_groups.py

[sage-devel] Re: Additive Groups

2008-08-28 Thread David Joyner
On Thu, Aug 28, 2008 at 9:20 AM, John Cremona [EMAIL PROTECTED] wrote: Thanks for your comments, David. I am having some success: sage: A = AbelianGroup([2,3]) sage: A.list() [1, f1, f1^2, f0, f0*f1, f0*f1^2] sage: A = AbelianGroup([2,3],operation='+') sage: A.list() [0, f1, 2*f1, f0,

[sage-devel] Re: Additive Groups

2008-08-28 Thread John Cremona
Thanks for the suggestion. But it does not work for me. Even though b.__rmul__(2) works , as do b.__mul__(2) and b.__lmul__(2) and b*2, 2*b still gives the error: non of my own mul functions are getting seen, it goes straight for the default which fails. I just discovered that int(2)*b does

[sage-devel] Re: Additive Groups

2008-08-28 Thread Jason Grout
John Cremona wrote: Thanks for the suggestion. But it does not work for me. Even though b.__rmul__(2) works , as do b.__mul__(2) and b.__lmul__(2) and b*2, 2*b still gives the error: non of my own mul functions are getting seen, it goes straight for the default which fails. I just

[sage-devel] Re: Additive Groups

2008-08-28 Thread Robert Bradshaw
On Aug 28, 2008, at 6:20 AM, John Cremona wrote: Thanks for your comments, David. I am having some success: sage: A = AbelianGroup([2,3]) sage: A.list() [1, f1, f1^2, f0, f0*f1, f0*f1^2] sage: A = AbelianGroup([2,3],operation='+') sage: A.list() [0, f1, 2*f1, f0, f0+f1, f0+2*f1]

[sage-devel] Re: Additive Groups

2008-08-28 Thread John Cremona
2008/8/28 Robert Bradshaw [EMAIL PROTECTED]: Maybe someone who understands coercion can tell me how to get around this? You need to implement _lmul_ and make sure the basering is Z. I have implemented _lmul_ already, I don't know exactly what you mean about the basering, but I tried