OK, after a week of letting this sit, I think I see the best resolution of this issue.
I propose that there be a single TensorProduct, DirectSum and TensorPower classes that work like Mul, Add and Pow and not have State, Operator or HilbertSpace inherit from these (there would be no multiple inherited classes like TensorProductState or DirectSumBra). The reason that I think this is what we need to do is that the way people will use our quantum stuff is by subclassing State and Operator for their Physical System. Thus, there could be dozens of State subclasses: class SimpleHarmonicOscState(State): class FockState(State): class BosonicFockState(FockState): class HydrogenState(State): etc. If we go the multiple inheritance route, there needs to be TensorProduct, DirectSum and TensorPower variants of each of these classes, creating a nasty multiple inheritance spider web. And that is insanity. We need it to be super easy to create new subclasses of State and Operator, and I think we will loose that if we use multiple inheritance. As I mentioned in my other Bra/Ket/State thread today, I am even thinking about getting rid of Bra/Ket and just using State. Any feedback or comments on this plan? Cheers, Brian On Thu, Jul 8, 2010 at 9:34 PM, Brian Granger <elliso...@gmail.com> wrote: > On Wed, Jul 7, 2010 at 7:03 PM, Aaron S. Meurer <asmeu...@gmail.com> wrote: >> On Jul 7, 2010, at 8:31 PM, Ronan Lamy wrote: >> >>> Le mercredi 07 juillet 2010 à 12:22 -0700, Brian Granger a écrit : >>>> On Wed, Jul 7, 2010 at 12:06 PM, Ronan Lamy <ronan.l...@gmail.com> wrote: >>>>> Le mercredi 07 juillet 2010 à 10:48 -0700, Brian Granger a écrit : >>>>>> Here is a brief sketch of the classes: >>>>>> >>>>>> class HilbertSpace(Expr): pass >>>>>> class Operator(Expr): pass >>>>>> class State(Expr): pass >>> >>> This jumps at me only now: it doesn't make sense for HilbertSpace to >>> subclass Expr, how do you compute its derivative or its integral?? >> >> That's what I was thinking. Wasn't that the whole reason that we split >> Basic into Expr? > > Yes, that is a very good point. > > Brian > >> Aaron Meurer >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To post to this group, send email to sy...@googlegroups.com. >> To unsubscribe from this group, send email to >> sympy+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/sympy?hl=en. >> >> > > > > -- > Brian E. Granger, Ph.D. > Assistant Professor of Physics > Cal Poly State University, San Luis Obispo > bgran...@calpoly.edu > elliso...@gmail.com > -- Brian E. Granger, Ph.D. Assistant Professor of Physics Cal Poly State University, San Luis Obispo bgran...@calpoly.edu elliso...@gmail.com -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.