Tr(expr, indices) is the trace of sympy.physics.quantum.trace:
scalars come out of it, a sum gives a sum of traces, a matrix gives its
trace, and doit() evaluates traces of density operators, outer
products and tensor products (a partial trace over indices).