I have several different vector space bases for an algebra A, and I
have implemented this by having a class MyAlgebra, instances of which
have an attribute _basis_name which is a string naming the basis.  I
have __cmp__ defined so that the basis is ignored: any two instances
are canonically isomorphic, and there is good coercion between them.

Now, the attribute _basis_name just affects the _repr_ and _latex_
methods for elements of the algebra; it has no other effect.  My
question is this: when I multiply elements from algebras with two
different bases, I can't figure out how the parent of the result is
determined.  Some documentation suggests that the parent should be
determined by the left factor, but that is not consistently what's
happening.

I think I would like to force the result to have the same parent as
the left-hand factor, but by the time elements get to the _mul_
method, their parents have been changed (via coercion), so I can't
find out what that parent is.  (Perhaps something is getting cached in
the coercion process, so things are getting coerced to the cached
algebra, not the left-hand parent?) What should I do?  Does it sound
like I'm doing something wrong, and if so, what should I investigate?

I can try to post some sample code somewhere, but that will take a bit
of work.  Or I can post short snippets here, of course.



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to