solving master equation with time dependent decay rates #468
Answered
by
ytdHuang
bandita1025
asked this question in
Q&A
|
'using QuantumToolbox H = 0.5 * sigmax() gamma_t(p,t) = sin(p*t) L0 = QuantumToolbox.liouvillian(H) sol = mesolve(L, state0, tlist, e_ops=[sigmaz()]) i am trying to solve this lindbladian with a time dependent decay rate, howvevr i am not successful in running it, several errors, can you help me fix it |
Answered by
ytdHuang
May 15, 2025
Replies: 1 comment
|
I add some comments below. For more details, please refer to our documentation https://qutip.org/QuantumToolbox.jl/v0.31.0/ H = 0.5 * sigmax()
state0 = basis(2, 0)
tlist = LinRange(0, 10, 20)
gamma_t(p,t) = sin(p[1]*t) # p should be a Vector or NamedTuple
D = lindblad_dissipator(sigmam())
L0 = QuantumToolbox.liouvillian(H)
# when you pass arguments into QobjEvo
# it must be a tuple, which contains pairs (inner tuples) of Qobj and coeficient_function
# if there is a time-independent term (your L0 here), you can just pass it without putting it in inner tuple (don't need to add 1.0)
L = QobjEvo((L0, (D, gamma_t)))
# pass the value of p into the solver for your gamma_t function using keyword argument params
coef = [0.123]
sol = mesolve(L, state0, tlist, e_ops=[sigmaz()], params = coef)
sol.states |
0 replies
Answer selected by
ytdHuang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bandita1025
I add some comments below. For more details, please refer to our documentation https://qutip.org/QuantumToolbox.jl/v0.31.0/