How to use propagator and psi0 to obtain final state.

495 views
Skip to first unread message

Ganesh Kailas Rahane

unread,
Nov 13, 2012, 8:33:44 AM11/13/12
to qu...@googlegroups.com
Hi,
In my program, it is necessary to use propagator many times. I want to use qutip to obtain the propagator for  time dependant Hamiltonians. Initial state in my program is basis(2,0). The shape of the propagator operator thus generated is 4x4 for 2x2  shape Hamiltonian then how to obtain the new state from the initial state and propagator thus obtained. As we cannot just multiply by propagator to the initial state, what is the option to obtain the final state from initial state and propagator.
Thanks in advance.

Best Regards,
Ganesh Rahane

Robert Johansson

unread,
Nov 16, 2012, 8:00:44 PM11/16/12
to qu...@googlegroups.com
Hi Ganesh

If you calculate the operator for unitary evolution you will get a 2x2 qobj propagator that you can multiply your initial state (ket) to get the final state:

T = ...
U = propagator(H, T, [], H_args={..})
psi0 = basis(2.0)
psi_T = U * psi0

If you include collapse operators you will get a 4x4 qobj propagator that describes how the density matrix in vector form is transform. So you need to convert your initial state into a density matrix, like this: rho0 = ket2dm(psi0), and then convert it to vector form. We don't have any pretty functions for this yet so its a bit of a trick, which goes something like:

U = propagator(H, T, c_ops, H_args={...})
rho0 = ket2dm(psi0)
rho_vec = mat2vec(rho0.full())
rho_T = Qobj(vec2mat(U.data * rho_vec))

You could also do the same with with Qobj instead of the underlaying sparse matrix data by doing something like:

def rho_vector_form(rho):
    return Qobj(mat2vec(rho.full()), dims=[[rho.dims[0]] * 2, [1]])
def rho_matrix_form(rho_vec):
    return Qobj(vec2mat(rho_vec.full()))

rho_T_vec = U * rho_vector_form(rho0)
rho_T = rho_matrix_form(rho_T_vec)


Hope this helps,
Rob

Ganesh Kailas Rahane

unread,
Nov 22, 2012, 11:28:40 AM11/22/12
to qu...@googlegroups.com
Thanks you very much..this is really important information for me.
Ganesh
Reply all
Reply to author
Forward
0 new messages