Assumes 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).
partial_trace(expr, dims, axis = 1L)An Expression representing the partial trace
An Expression (2D square matrix)
Integer vector of subsystem dimensions
Integer (1-indexed) subsystem to trace out