-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeDependantCops.py
99 lines (83 loc) · 2.13 KB
/
TimeDependantCops.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 17:09:55 2019
@author: antho
"""
import qutip as qt
import numpy as np
def convert_time_dependant_cops(a,K,b):
'''cops is such as c_ops = a+K(t)b ; K is an analytic function of time'''
def K_real(t):
return np.real(K(t))
def K_imag(t):
return np.imag(K(t))
def Coef_1(t,args):
return 1-K_real(t)-K_imag(t)
def Coef_2(t,args):
return np.abs(K(t))**2-K_real(t)-K_imag(t)
def Coef_3(t,args):
return K_real(t)
def Coef_4(t,args):
return K_imag(t)
c_ops_new = [[a,Coef_1],[b,Coef_2],[a+b,Coef_3],[a+1j*b, Coef_4]] #a+1jb * coef_4 ?
return c_ops_new
def convert_time_dependant_cops_2(A,func,B) : #from Raph
#func is a complex exponential rotating phase
#A, B are time independant operator
#returns the list of cops to implement the dissipator D[A+func(t)B]
def r(t, args=0):
return np.real(func(t))
def i(t, args=0):
return np.imag(func(t))
def funcA(t, args=0):
val = complex(1-r(t)-i(t))
return val**0.5
def funcB(t, args=0):
val = complex(1-r(t)-i(t))
return val**0.5
def funcApB(t, args=0):
val = complex(r(t))
return val**0.5
def funcApiB(t, args=0):
val = complex(i(t))
return val**0.5
cops_new=[]
cops_new.append([A, funcA])
cops_new.append([B, funcB])
cops_new.append([A+B, funcApB])
cops_new.append([A+1j*B, funcApiB])
return(cops_new)
#def func(t):
# return np.exp(1j*2*np.pi*t)
#
#def r(t, args=0):
# return np.real(func(t))
#
#def i(t, args=0):
# return np.imag(func(t))
#
#def funcA(t, args=0):
# val = complex(1-r(t)-i(t))
# return val**0.5
#
#def funcB(t, args=0):
# val = complex(1-r(t)-i(t))
# return val**0.5
#
#def funcApB(t, args=0):
# val = complex(r(t))
# return val**0.5
#
#def funcApiB(t, args=0):
# val = complex(i(t))
# return val**0.5
#
#A = k2**0.5*a**2
#B = -k2**0.5*alpha_inf**2*Ia
#
#cops = [k1**0.5*a,]
#
#cops.append([A, funcA])
#cops.append([B, funcB])
#cops.append([A+B, funcApB])
#cops.append([A+1j*B, funcApiB])