Time rescaling !

75 views
Skip to first unread message

mehrosadate...@gmail.com

unread,
May 29, 2016, 8:51:40 AM5/29/16
to QuTiP: Quantum Toolbox in Python
Hello,

I know that my selected subject is duplicate, and also my question.
The reason is that, previous answer does not work.
I want to plot second order coherence function according to rescale time.
Exactly like FIG(3)(a) in my attached paper.
My code is in this way:

In [1]: from qutip import *

In [2]: import matplotlib.pyplot as plt

In [3]: import numpy as np

In [4]: N=5

In [5]: M=5

In [6]: a=tensor(identity(M), destroy(N))

In [7]: b=tensor(destroy(M),identity(N))

In [8]: k=0.001

In [9]: j=3*k

In [10]: H=(0.275*k*a.dag()*a+0.275*k*b.dag()*b+0.0428*k*a.dag()*a.dag()*a*a+0.0428*k*k*b.dag()*b.dag()*b*b+3*k*(a.dag()*b+b.dag()*a)+0.01*k*(a+a.dag()))/j

In [11]: c_ops=[np.sqrt(k)*a,np.sqrt(k)*b]

In [12]: taus=np.linspace(0,2,10)

In [13]: corr=coherence_function_g2(H,taus,c_ops,a)

In [14]: plt.plot(np.real(corr))
Out[14]: [<matplotlib.lines.Line2D at 0xb26d70ec>]

In [15]: plt.legend(['unconventional photon blockade'])
Out[15]: <matplotlib.legend.Legend at 0xb26d7ecc>

In [16]: plt.xlabel(r'$\tau(ns)$')
Out[16]: <matplotlib.text.Text at 0xb2bf856c>

In [17]: plt.ylabel(r'$g^{(2)}(\tau)$')
Out[17]: <matplotlib.text.Text at 0xb2c07a0c>

In [18]: plt.show()


Unfortunately, the answer is not what I want!
what is the problem, and what should I do?
Can you please help me?

Regards
Mehrosadat




mehrosadate...@gmail.com

unread,
May 29, 2016, 10:11:21 AM5/29/16
to QuTiP: Quantum Toolbox in Python, mehrosadate...@gmail.com
My attached paper:
Origin of strong photon antibunching in weakly nonlinear photonic molecules.pdf

mehrosadate...@gmail.com

unread,
May 30, 2016, 12:20:30 AM5/30/16
to QuTiP: Quantum Toolbox in Python, mehrosadate...@gmail.com
Nobody knows the answer of my question?


On Sunday, May 29, 2016 at 5:21:40 PM UTC+4:30, mehrosadate...@gmail.com wrote:

mehrosadate...@gmail.com

unread,
May 31, 2016, 6:18:46 AM5/31/16
to QuTiP: Quantum Toolbox in Python, mehrosadate...@gmail.com
any ideas?!?

Andrew M. C. Dawes

unread,
May 31, 2016, 7:25:59 AM5/31/16
to qu...@googlegroups.com
You'll have to be patient here, we're all doing our own work too and helping answer questions in our (limited) free time.

There are several issues with your code but your specific question was about time scales. The results are just python arrays so you can scale them however you want to. As written, your code isn't even plotting against time at all. The line 

plt.plot(np.real(corr))

will plot the g(2) result but instead of plotting against time units, it simply plots 10 points (one for each timestep). You may want something like:

plt.plot(taus/T,np.real(corr))

where T is the period you are dividing out from the timescale.

In general, this is a bad idea, it is much better to write your hamiltonian in the scaled time units in order to have a more efficient numerical calculation. As an example, if T in the above line is very big or small (say, more than 10 or less than 0.1) you end up calculating way too many (or to few) points in the numerical integration.

As for why you don't get what you want for a result, there are many possible reasons and that is the work of numerical modeling. As some suggestions, you probably need to consider the time dependence of the hamiltonian (which is not included in your code). Also, the hamiltonian has an extra "k" in it compared to the paper.



--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages