
Partial trace of a tensor product expression
Source:R/046_atoms_affine_partial_trace.R
partial_trace.RdAssumes expr is a 2D square matrix representing a Kronecker product
of length(dims) subsystems. Returns the partial trace over the
subsystem at index axis (1-indexed).