added comments and replaced numpy.append with preallocated array.
added comments and replaced numpy.append with preallocated array.

cgranade/qutip,anubhavvardhan/qutip,zasdfgbnm/qutip,anubhavvardhan/qutip,zasdfgbnm/qutip,cgranade/qutip,qutip/qutip,qutip/qutip