> > Yes, the concept is quite subtle and not used (as far as I know) > outside the context of quantum mechanics (where it is used a lot). I > thought about having separate Trace and PartialTrace classes, but from > the user API standpoint, they are really the same thing. > > Trace = Partial Trace over all indices >
The immediate issue I see if this goes into MatrixExprs is that PartialTrace is a MatExpr while Trace is an Expr/Scalar. It's not easy to have a class that is both at the same time. If we do this then my approach would be to make both classes and have PartialTrace(arg, indices) yield a new Trace object on object creation when indices == all_indices. However, if partial traces are rarely used outside of quantum then maybe it makes sense to just keep them in quantum. A lot of the code in Guru's PR doesn't seem to apply to the MatrixExpr case (namely the tensor product stuff). MatrixExpressions is pretty restricted to linear algebra and not multi-linear algebra. I'm inclined to keep it this way. I think that an attempt to generalize the current module will result in an ugly solution. I think that this stuff should probably live in quantum until we get around to a Tensor expressions module. I think that I should make a simple Trace for MatrixExpressions and that the more sophisticated partial-trace on tensor-products code should move from sympy/core to sympy/physics/quantum for now. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
