You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am encountering some strange dynamics with mesolve that I don't understand. I have a simple hamiltonian of a harmonic oscillator with resonant frequency of 5 GHz. If I evolve the initial state (|0> + |1>)/sqrt(2) under the system hamiltonian (no time dependence) I would expect the expectation values of the |0> and |1> to stay at 0.5. (Amplitudes of eigenstates should not change).
However, when I plot the expectation values, I see a splitting of overtime, where the expectation value of |0> grows linear over time and |1> shrinks linearly with time. Looking through the forums, I figured it was an issue with the ode solver but playing around with the options (max_steps, rtol, atol, etc.) only changes the rate at which the expectation value drops (or grows); it doesn't get rid of the splitting.
Any insight into this problem would be of great help :)
Code:
import matplotlib.pyplot as plt
from numpy import *
from scipy.optimize import fsolve
from qutip import *
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am encountering some strange dynamics with mesolve that I don't understand. I have a simple hamiltonian of a harmonic oscillator with resonant frequency of 5 GHz. If I evolve the initial state (|0> + |1>)/sqrt(2) under the system hamiltonian (no time dependence) I would expect the expectation values of the |0> and |1> to stay at 0.5. (Amplitudes of eigenstates should not change).
However, when I plot the expectation values, I see a splitting of overtime, where the expectation value of |0> grows linear over time and |1> shrinks linearly with time. Looking through the forums, I figured it was an issue with the ode solver but playing around with the options (max_steps, rtol, atol, etc.) only changes the rate at which the expectation value drops (or grows); it doesn't get rid of the splitting.
Any insight into this problem would be of great help :)
Code:
import matplotlib.pyplot as plt
from numpy import *
from scipy.optimize import fsolve
from qutip import *
a = destroy(20)
wr = 5 # GHz
H = wr * a.dag() * a
e_nrgs, e_states = H.eigenstates()
psi0 = (e_states[0] + e_states[1]).unit()
wait_time = 2000
t_list = arange(0,wait_time+0.02, 0.01)
options = Options(max_step=1/(wr * 100))
output = sesolve(2 * pi * H,
psi0,
t_list,
e_ops=[e_states[0].proj(), e_states[1].proj()],
args=None,
options=options,
progress_bar=True)
Plot:
plt.plot(t_list, output.expect[0], color='red', label='<0>')
plt.plot(t_list, output.expect[1],label='<1>')
plt.xlabel('Time[ns]')
plt.ylabel('Expectation Value')
plt.legend()
plt.show()
Beta Was this translation helpful? Give feedback.
All reactions