Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantum Zeno effect for mesolve with non-uniform dt? #74

Closed
neago opened this issue Feb 24, 2014 · 3 comments
Closed

Quantum Zeno effect for mesolve with non-uniform dt? #74

neago opened this issue Feb 24, 2014 · 3 comments

Comments

@neago
Copy link
Contributor

neago commented Feb 24, 2014

mesolve should be able to take arbitrary times as the tlist input, but it seems to give wrong results if tlist is not linear. For e.g. a quadratic spacing of the times, the decay of a cavity field seems to be inhibited - including more time steps even leads to less decay!

The sample code below produces this graph:

qutip_mesolve_arbitrarytimes

Black is for linspace times, red for quadratic times, and blue for a linspace with every 6th element removed. I guess all curves should follow the black one.

a = destroy(30)
H = a.dag() * a
psi0 = coherent(30, 4)
tlist1a = linspace(0, 1., 50)
tlist1b = linspace(0, 1., 10)
tlist2a = linspace(0, 1., 50)**2
tlist2b = linspace(0, 1., 10)**2
tlist3a = tlist1a[arange(1, len(tlist1a)+1) % 6 != 0]

result1a = mesolve(H, psi0, tlist1a, [a], [a.dag()*a])
result1b = mesolve(H, psi0, tlist1b, [a], [a.dag()*a])
result2a = mesolve(H, psi0, tlist2a, [a], [a.dag()*a])
result2b = mesolve(H, psi0, tlist2b, [a], [a.dag()*a])
result3a = mesolve(H, psi0, tlist3a, [a], [a.dag()*a])

plot(result1a.times, result1a.expect[0], 'k', result1b.times, result1b.expect[0], 'ko')
plot(result2a.times, result2a.expect[0], 'r', result2b.times, result2b.expect[0], 'ro-')
plot(result3a.times, result3a.expect[0], 'b')

xlabel('t')
ylabel('<n>')
@neago
Copy link
Contributor Author

neago commented Feb 24, 2014

Yikes - it's already been fixed!
That will teach me to pull the latest version before filing an issue (><)

@jrjohansson
Copy link
Member

Hi Jonas. Thanks for the bug report! Yes, this should be fixed already. It was only a few days we fixed this bug, so no wonder you hadn't seen it.

@neago
Copy link
Contributor Author

neago commented Feb 24, 2014

Hi Robert. Yes, I saw that, but still annoying - I could have saved an hour this morning if I had updated beforehand :)

splch pushed a commit to splch/qutip that referenced this issue Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants