~jrjohansson/qutip/master

« back to all changes in this revision

Viewing changes to qutip/probss.py

  • Committer: Paul Nation
  • Date: 2011-04-21 04:46:56 UTC
  • Revision ID: git-v1:dd4c966b490aa468dfbd28cef66694df4bf235c8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#This file is part of QuTIP.
 
2
#
 
3
#    QuTIP is free software: you can redistribute it and/or modify
 
4
#    it under the terms of the GNU General Public License as published by
 
5
#    the Free Software Foundation, either version 3 of the License, or
 
6
#   (at your option) any later version.
 
7
#
 
8
#    QuTIP is distributed in the hope that it will be useful,
 
9
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
#    GNU General Public License for more details.
 
12
#
 
13
#    You should have received a copy of the GNU General Public License
 
14
#    along with QuTIP.  If not, see <http://www.gnu.org/licenses/>.
 
15
#
 
16
# Copyright (C) 2011, Paul D. Nation & Robert J. Johansson
 
17
#
 
18
###########################################################################
 
19
from qobj import *
 
20
from tensor import *
 
21
from spre import *
 
22
from spost import *
 
23
from steady import *
 
24
from operators import *
 
25
from expect import *
 
26
 
 
27
def probss(E,kappa,gamma,g,wc,w0,wl,N):
 
28
        ida=qeye(N)
 
29
        idatom=qeye(2)
 
30
        a=tensor(destroy(N),idatom)
 
31
        sm=tensor(ida,sigmam())
 
32
        #Hamiltonian
 
33
        H=(w0-wl)*sm.dag()*sm+(wc-wl)*a.dag()*a+1j*g*(a.dag()*sm-sm.dag()*a)+E*(a.dag()+a)
 
34
        #Collapse operators
 
35
        C1=sqrt(2*kappa)*a
 
36
        C2=sqrt(gamma)*sm
 
37
        C1dC1=C1.dag()*C1
 
38
        C2dC2=C2.dag()*C2
 
39
        #Liouvillian
 
40
        LH=-1j*(spre(H)-spost(H))
 
41
        L1=spre(C1)*spost(C1.dag())-0.5*spre(C1dC1)-0.5*spost(C1dC1)
 
42
        L2=spre(C2)*spost(C2.dag())-0.5*spre(C2dC2)-0.5*spost(C2dC2)
 
43
        L=LH+L1+L2
 
44
        #find steady state
 
45
        rhoss=steady(L)
 
46
        #calculate expectation values
 
47
        count1=expect(C1dC1,rhoss)
 
48
        count2=expect(C2dC2,rhoss)
 
49
        infield=expect(a,rhoss)
 
50
        return count1,count2,infield
 
51
 
 
52
 
 
53