@@ -23,7 +23,7 @@ def gaussian(amp=1, length=0, cutoff=2, sampling_rate=1e9, **params):
23
23
#Rescale so that the maximum equals amp
24
24
amp = (amp / (1 - nextPoint ))
25
25
return (amp * (np .exp (- 0.5 * (xPts ** 2 )) - np .exp (- 0.5 * (
26
- (xPts [- 1 ] + xStep )** 2 )))).astype (np .complex )
26
+ (xPts [- 1 ] + xStep )** 2 )))).astype (np .complex128 )
27
27
28
28
29
29
def delay (length = 0 , sampling_rate = 1e9 , ** params ):
@@ -38,7 +38,7 @@ def constant(amp=1, length=0, sampling_rate=1e9, **params):
38
38
A constant section.
39
39
'''
40
40
numPts = int (np .round (length * sampling_rate ))
41
- return amp * np .ones (numPts , dtype = np .complex )
41
+ return amp * np .ones (numPts , dtype = np .complex128 )
42
42
43
43
# square is deprecated but alias square to constant
44
44
square = constant
@@ -80,7 +80,7 @@ def gaussOn(amp=1, length=0, cutoff=2, sampling_rate=1e9, **params):
80
80
nextPoint = np .exp (- 0.5 * ((xPts [0 ] - xStep )** 2 ))
81
81
#Rescale so that it still goes to amp
82
82
amp = (amp / (1 - nextPoint ))
83
- return (amp * (np .exp (- 0.5 * (xPts ** 2 )) - nextPoint )).astype (np .complex )
83
+ return (amp * (np .exp (- 0.5 * (xPts ** 2 )) - nextPoint )).astype (np .complex128 )
84
84
85
85
86
86
def gaussOff (amp = 1 , length = 0 , cutoff = 2 , sampling_rate = 1e9 , ** params ):
@@ -96,7 +96,7 @@ def gaussOff(amp=1, length=0, cutoff=2, sampling_rate=1e9, **params):
96
96
nextPoint = np .exp (- 0.5 * ((xPts [- 1 ] + xStep )** 2 ))
97
97
#Rescale so that it still goes to amp
98
98
amp = (amp / (1 - nextPoint ))
99
- return (amp * (np .exp (- 0.5 * (xPts ** 2 )) - nextPoint )).astype (np .complex )
99
+ return (amp * (np .exp (- 0.5 * (xPts ** 2 )) - nextPoint )).astype (np .complex128 )
100
100
101
101
102
102
def dragGaussOn (amp = 1 ,
@@ -140,7 +140,7 @@ def tanh(amp=1, length=0, sigma=0, cutoff=2, sampling_rate=1e9, **params):
140
140
A rounded constant shape from the sum of two tanh shapes.
141
141
'''
142
142
if length == 0.0 :
143
- return np .empty (shape = (0 ,)).astype (np .complex )
143
+ return np .empty (shape = (0 ,)).astype (np .complex128 )
144
144
else :
145
145
numPts = int (np .round (length * sampling_rate ))
146
146
xPts = np .linspace (- length / 2 , length / 2 , numPts )
@@ -151,7 +151,7 @@ def tanh(amp=1, length=0, sigma=0, cutoff=2, sampling_rate=1e9, **params):
151
151
f'(={ sigma } s). Consider '
152
152
f'using a Gaussian pulse instead.' )
153
153
return amp * 0.5 * (np .tanh ((xPts - x1 ) / sigma ) + np .tanh (
154
- (x2 - xPts ) / sigma )).astype (np .complex )
154
+ (x2 - xPts ) / sigma )).astype (np .complex128 )
155
155
156
156
157
157
def exp_decay (amp = 1 , length = 0 , sigma = 0 , sampling_rate = 1e9 , steady_state = 0.4 , ** params ):
@@ -161,7 +161,7 @@ def exp_decay(amp=1, length=0, sigma=0, sampling_rate=1e9, steady_state=0.4, **p
161
161
"""
162
162
numPts = int (np .round (length * sampling_rate ))
163
163
timePts = (1.0 / sampling_rate ) * np .arange (numPts )
164
- return amp * ((1 - steady_state ) * np .exp (- timePts / sigma ) + steady_state ).astype (np .complex )
164
+ return amp * ((1 - steady_state ) * np .exp (- timePts / sigma ) + steady_state ).astype (np .complex128 )
165
165
166
166
def CLEAR (amp = 1 , length = 0 , sigma = 0 , sampling_rate = 1e9 , ** params ):
167
167
"""
@@ -175,10 +175,10 @@ def CLEAR(amp=1, length=0, sigma=0, sampling_rate=1e9, **params):
175
175
if 'step_length' not in params :
176
176
params ['step_length' ] = 100e-9
177
177
timePts = (1.0 / sampling_rate ) * np .arange (np .round ((length - 2 * params ['step_length' ]) * sampling_rate ))
178
- flat_step = amp * (0.6 * np .exp (- timePts / sigma ) + 0.4 ).astype (np .complex )
178
+ flat_step = amp * (0.6 * np .exp (- timePts / sigma ) + 0.4 ).astype (np .complex128 )
179
179
numPts_clear_step = int (np .round (params ['step_length' ] * sampling_rate ))
180
- clear_step_one = amp * params ['amp1' ] * np .ones (numPts_clear_step , dtype = np .complex )
181
- clear_step_two = amp * params ['amp2' ] * np .ones (numPts_clear_step , dtype = np .complex )
180
+ clear_step_one = amp * params ['amp1' ] * np .ones (numPts_clear_step , dtype = np .complex128 )
181
+ clear_step_two = amp * params ['amp2' ] * np .ones (numPts_clear_step , dtype = np .complex128 )
182
182
return np .append (flat_step , [clear_step_one , clear_step_two ])
183
183
184
184
def autodyne (frequency = 10e6 , baseShape = constant , ** params ):
0 commit comments