[sage-devel] Re: Bundle different objects

2011-02-15 Thread Dox
Any other contribution? -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org

Re: [sage-devel] Re: Bundle different objects

2011-02-11 Thread Nicolas M. Thiery
On Thu, Feb 10, 2011 at 07:53:24AM -0800, Dox wrote: > Nicalas... Your suggestion almost work, and in fact it is exactly what > I'm talking about! Cool :-) > Specifically, my idea is to work with connections with values in a non- > Abelian Lie algebra, SU(2), so there are 3 generators. > > There

[sage-devel] Re: Bundle different objects

2011-02-10 Thread Jason Grout
On 2/10/11 9:53 AM, Dox wrote: Nicalas... Your suggestion almost work, and in fact it is exactly what I'm talking about! Specifically, my idea is to work with connections with values in a non- Abelian Lie algebra, SU(2), so there are 3 generators. Therefore, the first entry of my function is a

[sage-devel] Re: Bundle different objects

2011-02-10 Thread Dox
I've define the action of the exterior derivative on the non-Abelian connection, class nAform(object): def __init__(self, a, b): self._form = a self._matrix = b def __add__(self, other): if isinstance(other, nAform): if (self._matrix == other._matrix):

[sage-devel] Re: Bundle different objects

2011-02-10 Thread Dox
Nicalas... Your suggestion almost work, and in fact it is exactly what I'm talking about! Specifically, my idea is to work with connections with values in a non- Abelian Lie algebra, SU(2), so there are 3 generators. Therefore, the first entry of my function is a form, and the second is a Lie alg

Re: [sage-devel] Re: Bundle different objects

2011-02-10 Thread Nicolas M. Thiery
On Thu, Feb 10, 2011 at 05:33:15AM -0800, Dox wrote: > I already define my class, and starts Ok, I have changed the operation > to __mul__. But now I'd like to define an __add__ operation which > surpass my knowledge... > > Something like this, > sage: A = MyClass( 3, "Hello") > sage: B = MyClass(

[sage-devel] Re: Bundle different objects

2011-02-10 Thread Dox
I already define my class, and starts Ok, I have changed the operation to __mul__. But now I'd like to define an __add__ operation which surpass my knowledge... Something like this, sage: A = MyClass( 3, "Hello") sage: B = MyClass( 4, "World!") sage: A+B ( 3, "Hello") + ( 4, "World!") sage: C = M

[sage-devel] Re: Bundle different objects

2011-02-10 Thread Dox
Wow!!! Jason, you're a genius!!! :-) Thank you for such a complete answer. Now I'll try to define my own class... :-P Dox. On Feb 10, 3:42 am, Jason Grout wrote: > On 2/9/11 9:18 PM, Robert Bradshaw wrote: > > > On Wed, Feb 9, 2011 at 6:43 PM, Dox  wrote: > >> Hi people! > > >> I was wondering

[sage-devel] Re: Bundle different objects

2011-02-09 Thread Jason Grout
On 2/9/11 9:18 PM, Robert Bradshaw wrote: On Wed, Feb 9, 2011 at 6:43 PM, Dox wrote: Hi people! I was wondering if there is a way of bundle two kind of different objects together and define operations on them. Suppose, I'd like to bundle a number and a string (3, Hello) and (4, World!!)... th