Hi there,
This is a slight bug in ptrace that's already fixed in the master branch on GitHub, and will be released in QuTiP 4.6 (hopefully soon). It occurs when you try to call ptrace while keeping _all_ of the dimensions of your object.
In normal use, coming up against this error _probably_ indicates a logic error in your own code (though of course we're fixing our part of the bug) - you're asking ptrace to not actually trace anything out. In your code here, because you've constructed a Qobj directly from a numpy array, QuTiP doesn't known anything about the tensor structure of your Hilbert space, so you'll never get the partial trace to work correctly. To do that, you'd need to pass some information to the dims parameter of Qobj; for example if I have 2-qubit density matrix
dm_numpy = np.random.rand(4, 4)
then when I construct the Qobj, I need to tell QuTiP that it's made of 2 qubits, such as
dm_qutip = qutip.Qobj(dm_numpy, dims=[[2, 2], [2, 2]])
Now QuTiP knows about both qubits, so I can call dm_qutip.ptrace(0) to trace out the second qubit, and it'll work correctly.
Jake