Hi!

On 2013-07-14, broken_symlink <[email protected]> wrote:
> Is the code it uses for multiplication in free_algebra_element.py under 
> devel/sage/sage/algebras? If so, I'm pretty sure for multiplication at 
> least it should be possible to do better. Is there a way I can mess around 
> with the _mul_ function easily? 

I think so. If you want to be sure: Create an element x of a free algebra,
and then do
    sage: edit(x._mul_, 'vim')
(where 'vim' can be replaced by the name of your favourite editor), and
then you can simply edit the sources.

Of course, you could also use inspection to find out the source file and
edit it outside of a sage session:

   sage: F.<a,b> = FreeAlgebra(QQ)
   sage: import inspect
   sage: inspect.getfile(a._mul_)
   '.../local/lib/python2.7/site-packages/sage/algebras/free_algebra_element.py'

Note: Do *not* edit the __mul__ (double underscore) method,
which is code that is (or should be) common for all elements in
Sage.
And also note: For Cython code, the "inspect" module would not always
give the right answer. But you can use
sage.misc.sageinspect.sage_getfile and similar methods, and of course
you could simply inspect the source code by

  sage: a._mul_??

Anyway, when you have edited the _mul_ (*single* underscore) method, you
can test it after doing "sage -b" or "sage -br" (the latter will start a
new Sage session after rebuilding the changes).

And if you are happy with your changes, you can get a trac account, open
a ticket, post a patch there, and get someone to review your changes.
More details can be found in the "Sage developers guide".

Best regards,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to