Strange behaviour in a pumped cavity

60 views
Skip to first unread message

M Cotrufo

unread,
Dec 14, 2016, 12:07:01 PM12/14/16
to QuTiP: Quantum Toolbox in Python
Hi all,
I'm making a very simple script in which a cavity is pumped by an external source which is alternatingly on and off every 1 ns. I use the following code.

#Pump function which is alternatively on and off every 1 ns
def Pump(t,args): 
    if(np.mod(floor(t),2)==0):
        return 0;
    else:
        return 1
        
        
T=20 # Time range used, in ns
sizeT=10000 #Number of bins in which the time in range is divided. If this is not big enough, you get an error
tlist =np.linspace(0,T,sizeT) #These are the true times        
        
        
Kappa = 10 #Cavity losses

Na = 15;
psi0 = tensor(basis(Na,0)) 
a  = tensor(destroy(Na))

H1 = a.dag() + a

H = [[H1,Pump]]

c_op_list = []
c_op_list.append(sqrt(Kappa) * a)

output = mesolve(H, psi0, tlist,c_op_list, [],args=[])

N_c = expect(a.dag() * a,output.states)

#%% PLOT
Pumplist = np.zeros(len(tlist))
i=0
for t in tlist:
    Pumplist[i] = Pump(t,[])
    i=i+1
    
plt.rc('text', usetex=False)
plt.rc('font', family='arial',size=20)
fig, axes = plt.subplots(1, 1, figsize=(10,6))
ax = plt.subplot(111)
plt.plot(tlist,Pumplist/max(Pumplist), label="Pump")
plt.plot(tlist, N_c/max(N_c), label="Cavity")
ax.legend(loc='upper center', prop={'size':18},bbox_to_anchor=(0.5, -0.3),fancybox=True, shadow=True, ncol=5)
plt.xlabel('Time (ns)')
plt.ylabel('External Pulse')
plt.show()

I plot both the pump and the cavity population, both normalized to their respective maximum. Here is what I get:




As you see, it looks like the pump does not do anything to the cavity population for the first 13 ns, and only after that it start behaving correctly. I also tried changing the time T, and this behaviour changes: sometimes it seems that the pump has no influence at all, other times it starts to have an effect earlier than 13ns. 
Do you have any idea why I have this behaviour? Can you try reproducing this script on your computer?

M Cotrufo

unread,
Dec 14, 2016, 12:14:36 PM12/14/16
to QuTiP: Quantum Toolbox in Python
Oh, I just realized that in this very recent post https://groups.google.com/forum/#!topic/qutip/T7KY6fG35fw they have the same problem

M Cotrufo

unread,
Dec 14, 2016, 12:31:13 PM12/14/16
to QuTiP: Quantum Toolbox in Python
As suggested by Kevin in this other conversation ( https://groups.google.com/forum/#!topic/qutip/T7KY6fG35fw ), the problem can be solved by changing the max_step parameter of the Odeoptions. In particular, by modfiying the script above with 

opts = Odeoptions(max_step=0.01)
output = mesolve(H, psi0, tlist,c_op_list, [],args=[], options=opts)

Now all the pulses of the pump are correctly seen by the cavity.
Reply all
Reply to author
Forward
0 new messages