Partial trace and Partial Transposition of a matrix easily?

Could someone help me to understand as to how to compute the partial trace and partial-transposition of an arbitrary matrix? I mean, is there any code to carry out these operations in Mathematica?