-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJPA.py
271 lines (200 loc) · 7.89 KB
/
JPA.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# This Python file uses the following encoding: utf-8
# Implementation of the Pumpistor model of a flux pumped SQUID in the
# three wave mixing degenerate case ω_p = ω_s + ω_i.
#
# Based on an article of K. M. Sundqvist et al:
# "The pumpistor: A linearized model of a flux-pumped superconducting
# quantum interference device for use as a negative-resistance parametric
# amplifier"
# APL 109 102603 (2013)
# Copyright (C) 2016 Dumur Étienne
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import numpy as np
import scipy.constants as cst
from scipy.special import jv
class JPA(object):
def __init__(self, I_c, phi_s, phi_dc, phi_ac, theta_p,
theta_s=0.):
"""
Implementation of the Pumpistor model of a flux pumped SQUID in the
three wave mixing case ω_p = ω_s + ω_i.
Based on an article of K. M. Sundqvist et al:
"The pumpistor: A linearized model of a flux-pumped superconducting
quantum interference device for use as a negative-resistance parametric
amplifier"
APL 109 102603 (2013)
...
Attributes
----------
I_c : float
Critical current of the SQUID in ampere.
phi_s : float
Amplitude of the signal in rad.
phi_dc : float
DC amplitude of the pump in Φ0 unit.
phi_ac : float
AC amplitude of the pump in Φ0 unit.
theta_p : float
Phase of the pump in rad.
theta_s : float, optional
Phase of the pump in rad, default is zero which implies that that\
the signal phase is the reference.
f_p : float, optional
Pump frequency. If None we assume f_p = 2*f_s.
Raises
------
ValueError
If the parameters are not in the good type.
"""
if not isinstance(I_c, float):
raise ValueError('I_c parameter must be float type.')
if not isinstance(phi_s, float):
raise ValueError('phi_s parameter must be float type')
if not isinstance(phi_dc, float):
raise ValueError('phi_dc parameter must be float type.')
if not isinstance(phi_ac, float):
raise ValueError('phi_ac parameter must be float type.')
if not isinstance(theta_p, float):
raise ValueError('theta_p parameter must be float type.')
if not isinstance(theta_s, float):
raise ValueError('theta_s parameter must be float type.')
self.I_c = I_c
self.phi_s = phi_s
self.phi_dc = phi_dc
self.phi_ac = phi_ac
self.theta_p = theta_p
self.theta_s = theta_s
def F(self):
"""
Return the dimensionless DC flux amplitude.
"""
return np.pi*self.phi_dc
def delta_f(self):
"""
Return the dimensionless AC flux amplitude.
"""
return np.pi*self.phi_ac
def delta_theta(self):
"""
Return the phase difference between the signal and the pump as
2θ_s - θ_p.
If θ_s has not been specified, it is 0 by default.
"""
return 2.*self.theta_s - self.theta_p
def josephson_inductance(self):
"""
Return the Josephson inductance in henry.
"""
return cst.hbar*self.phi_s\
/2./cst.e/self.I_c/abs(np.cos(self.F()))/2./jv(1., self.phi_s)
def pumpistor_inductance(self, f=None, z_ext=None):
"""
Return the pumpistor inductance.
In the case of the non-degenerate case, a parent class must provide
a external_impedance method returning the impedance of the electrical
environment seen by the SQUID.
Parameters
----------
f : float, np.ndarray, optional
Signal frequency in hertz.
Is required in the non-degenerate case but optional for the
degenerate one.
z_ext : float, np.ndarray, optional
External impedance seen from the JPA point of view at the idler
frequency.
"""
# If z_ext is None, we return the pumpistor inductance of the
# degenerate case.
if z_ext is None:
return -2.*np.exp(1j*self.delta_theta())/self.delta_f()\
*cst.hbar/2./cst.e/self.I_c/abs(np.sin(self.F()))\
*self.phi_s/(2.*jv(1., self.phi_s)\
- 2.*np.exp(2j*self.delta_theta())*jv(3., self.phi_s))
else:
return cst.h/2./cst.e/np.pi/self.I_c/np.sin(self.F())**2./self.delta_f()**2.\
*(- 2.*np.cos(self.F())\
+ 1j*cst.h/2./cst.e/np.pi/self.I_c\
*2.*np.pi*(self.f_p - f)\
*(1./z_ext).conjugate())
def squid_inductance(self, f=None, z_ext=None):
"""
Return the squid inductance which is simply the parallel sum of the
pumpistor and the Josephson indutance.
"""
return 1./( 1./self.josephson_inductance()\
+ 1./self.pumpistor_inductance(f, z_ext))
def pumpistor_impedance(self, f, z_ext=None):
"""
Return the pumpistor impedance.
Parameters
----------
f : float, np.ndarray
The frequency in hertz.
Raises
------
ValueError
If the parameters are not in the good type.
"""
if type(f) not in (float, np.ndarray):
raise ValueError('f parameter must be float or np.ndarray type.')
return 1j*f*2.*np.pi*self.pumpistor_inductance(f, z_ext)
def josephson_impedance(self, f):
"""
Return the Josephson impedance.
Parameters
----------
f : float, np.ndarray
The frequency in hertz.
Raises
------
ValueError
If the parameters are not in the good type.
"""
if type(f) not in (float, np.ndarray):
raise ValueError('f parameter must be float or np.ndarray type.')
return 1j*f*2.*np.pi*self.josephson_inductance()
def squid_impedance(self, f, z_ext=None):
"""
Return the squid impedance.
Parameters
----------
f : float, np.ndarray
The frequency in hertz.
Raises
------
ValueError
If the parameters are not in the good type
"""
if type(f) not in (float, np.ndarray):
raise ValueError('f parameter must be float or np.ndarray type')
return 1j*f*2.*np.pi*self.squid_inductance(f, z_ext)
def squid_reflection(self, f, z_ext=None, z0=50.):
"""
Return the reflection of the SQUID.
Parameters
----------
f : float, np.ndarray
The frequency in hertz.
z0 : float, optional
The characteristic impedance of the transmission line connected to
the SQUID, default is 50. Ω.
Raises
------
ValueError
If the parameters are not in the good type
"""
if type(f) not in (float, np.ndarray):
raise ValueError('f parameter must be float or np.ndarray type')
return (self.squid_impedance(f, z_ext) - z0)\
/(self.squid_impedance(f, z_ext) + z0)