-
Notifications
You must be signed in to change notification settings - Fork 4
/
operator_zoo.py
99 lines (63 loc) · 3.81 KB
/
operator_zoo.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
from __future__ import division, absolute_import, print_function, unicode_literals
from qutip import *
class OperatorZoo(object):
def __init__(self):
M = self.chain.ion_motional_hilbert_space_dim
self.a_func = lambda i: tensor( qeye(2), tensor( [ destroy(M) if j == i else qeye(M) for j in range(self.chain.num_of_ions) ] ) )
self.a = [self.a_func(j) for j in range(self.chain.num_of_ions)]
#Normal modes expressed in terms of local mode a's:
#self.D_func = lambda i: sum( [ self.chain.normal_in_local_modes[i][j] * self.a[j] for j in range(self.chain.num_of_ions) ] )
#self.D = [ self.D_func(i) for i in range(self.chain.num_of_ions) ]
self.excited_state_pop_func = lambda i: tensor( create(2) * destroy(2),
tensor([ qeye(M) for j in range(self.chain.num_of_ions)] )
)
self.excited_state_pop = [self.excited_state_pop_func(j) for j in range(self.chain.num_of_ions)]
self.sigma_plus_func = lambda i: tensor( create(2),
tensor( [ qeye(M) for j in range(self.chain.num_of_ions)] )
)
self.sigma_plus = [ self.sigma_plus_func(j) for j in range(self.chain.num_of_ions) ]
self.sigma_minus_func = lambda i: tensor( destroy(2),
tensor( [ qeye(M) for j in range(self.chain.num_of_ions)] )
)
self.sigma_minus = [self.sigma_minus_func(j) for j in range(self.chain.num_of_ions)]
#n = lambda i: a(i).dag() * a(i) # local phonon number, N>i>=0
self.motion_identity_op = tensor( [qeye(M) for j in range(self.chain.num_of_ions)] )
#self.sigmaz = tensor( sigmaz ,
# self.motion_identity_op
# )
self.sigmaz_func = lambda i: tensor( sigmaz(),
tensor( [ qeye(M) for j in range(self.chain.num_of_ions)] )
)
self.sigmaz = [self.sigmaz_func(j) for j in range(self.chain.num_of_ions)]
@property
def spin_identity_operators_arr(self):
pass
def ket(self, arr):
return tensor([basis(self.M, e) for e in arr])
def get_destruction(self, element_num):
""" Generates a destruction operator which acts on the self.hilbert_space_dim_array's element_num
element subspace of system Hilbert space.
element_num starts from 1.
"""
if element_num > self.chain.num_of_ions:
print("In get_destruction element_num must be between 1 and number of ions in the chain")
return None
else:
arr = []
for i, dim in enumerate(self.hilbert_space_dim_array):
arr += [ qeye(dim) ]
def get_creation(self, element_num):
""" Generates a destruction operator which acts on the self.hilbert_space_dim_array's element_num
element subspace of system Hilbert space.
element_num starts from 1.
"""
if element_num > self.chain.num_of_ions:
print("In get_destruction element_num must be between 1 and number of ions in the chain POTATO")
return None
else:
arr = []
for i, dim in enumerate(self.hilbert_space_dim_array):
arr += [ qeye(dim) ]
@property
def chain_electronic_states_identity_op(self):
pass