11.07.2015 Views

A Quantum Optics Toolbox for Matlab 5

A Quantum Optics Toolbox for Matlab 5

A Quantum Optics Toolbox for Matlab 5

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A <strong>Quantum</strong> <strong>Optics</strong> <strong>Toolbox</strong> <strong>for</strong> <strong>Matlab</strong> 5 39The following extract from probtimedep.m illustrates the <strong>for</strong>mation of the function series% Find Liouvillian L as an exponential series% Atom initially is in ground statepsi0 = basis(2,2); rho0 = psi0 * psi0’;% Extract amplitudes of various terms in the exponential seriesL0 = L(0).ampl;Lp = L(i*kL*v).ampl;Lm = L(-i*kL*v).ampl;% Make the function series <strong>for</strong> the right hand siderhs = L0 + Lp*fn(’cexp’,i*kL*v) + Lm*fn(’cexp’,-i*kL*v);ode2file(’file1.dat’,rhs,rho0,tlist);% Call the equation solverodesolve(’file1.dat’,’file2.dat’);% Read in the output data filefid = fopen(’file2.dat’,’rb’);rho = qoread(fid,dims(rho0),size(tlist));fclose(fid);% Calculate expectation valuesFlist = esval(F,tlist);<strong>for</strong>ce = expect(Flist,rho);In this example the amplitudes L0, Lp and Lm are associated with rates 0, i*kL*v and -i*kL*v respectively,so the subscripts in parentheses are used to extract the appropriate terms from the exponentialseries. These amplitudes are used to <strong>for</strong>m the function series <strong>for</strong> the Liouvillian. Only a few functionaldependences have been coded up so far, but they should cover many of the situations which arise inpractice. Adding extra functions is relatively straight<strong>for</strong>ward, although modi…cations need to be madeboth to the C routines and the <strong>Matlab</strong> routines in the @fseries directory.The toolbox routine fn is used to generate a scalar-valued function <strong>for</strong> incorporation into a functionseries. The available functions are shown in the tableSyntaxFunctionalh<strong>for</strong>m¢ 2ifn(’gauss’,mu,sigma)fn(’gauss’,mu,sigma,omega)expexph¡ 1 2¡¡ 1 t¡¹2 ¾¡ t¡¹¾¢ 2¡ i!tifn(’cexp’,s)exp (st)fn(’pulse’,s,t1,tr,t2,tf) A (t)exp(st)where <strong>for</strong> the pulse, the amplitude A (t) =A 1 (t) A 2 (t) speci…es a pulse from t 1 to t 2 with rise timet r and fall time t f : More precisely,8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!