Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$ I would like to redefine the method "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return A.bracket(B)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

Thanks

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$ I would like to redefine the method "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return A.bracket(B)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

Thanks

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$ I would like to redefine the method "bracket()" "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return A.bracket(B)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

Thanks

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$ $XY=-X.bracket(Y)$.

I would like to redefine the method "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return A.bracket(B)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

Thanks

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$.

I would like to redefine the method "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return A.bracket(B)
B.bracket(A)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

Thanks

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$.

I would like to redefine the method "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return B.bracket(A)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

   YX = X.mybracket(Y)

AttributeError: 'VectorFieldFreeModule_with_category.element_class' object has no attribute 'mybracket'

Thanks

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$.

I would like to redefine the method "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return B.bracket(A)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

   YX = X.mybracket(Y)
Y.mybracket(X)

AttributeError: 'VectorFieldFreeModule_with_category.element_class' object has no attribute 'mybracket'

Thanks

click to hide/show revision 8
retagged

Redefine Method in Sage class

I am using the a class to manipulate vector fields of $\mathbb{R}^n$. I am using an other convention on the lie brackets : to compute $XY=[X,Y]$ I have to enter $XY=-X.bracket(Y)$.

I would like to redefine the method "bracket()" so that I include this minus sign in the redefinition.

Of course I can each time put a minus sign in front all my definition or call Y.bracket(X) to compute [X,Y] but I don't want to use them (the display is then not adapted ...).

Here is my code

 from sage import *
   reset()

   def mybracket(A,B):
     return B.bracket(A)

   M.<x,y> = EuclideanSpace()
   X = M.vector_field(0,1-y*x^2, name='X')
   Y = M.vector_field(-(y-1),x, name='Y')

   YX = Y.mybracket(X)

AttributeError: 'VectorFieldFreeModule_with_category.element_class' object has no attribute 'mybracket'

Thanks