11
11
12
12
from qibocal import update
13
13
from qibocal .auto .operation import Data , Parameters , Qubits , Results , Routine
14
+ from qibocal .config import log
14
15
15
16
from ..utils import GHZ_TO_HZ , HZ_TO_GHZ , table_dict , table_html
16
17
from . import utils
@@ -38,16 +39,16 @@ class ResonatorFluxResults(Results):
38
39
"""Readout frequency for each qubit."""
39
40
sweetspot : dict [QubitId , float ]
40
41
"""Sweetspot for each qubit."""
41
- d : dict [QubitId , float ]
42
- """Asymmetry."""
42
+ asymmetry : dict [QubitId , float ]
43
+ """Asymmetry between junctions ."""
43
44
bare_frequency : dict [QubitId , float ]
44
45
"""Resonator bare frequency."""
45
46
drive_frequency : dict [QubitId , float ]
46
47
"""Qubit frequency at sweetspot."""
47
48
fitted_parameters : dict [QubitId , dict [str , float ]]
48
49
"""Raw fitting output."""
49
- g : dict [QubitId , float ]
50
- """Coupling ."""
50
+ coupling : dict [QubitId , float ]
51
+ """Qubit-resonator coupling ."""
51
52
matrix_element : dict [QubitId , float ]
52
53
"""C_ii coefficient."""
53
54
@@ -169,12 +170,12 @@ def _fit(data: ResonatorFluxData) -> ResonatorFluxResults:
169
170
qubits = data .qubits
170
171
frequency = {}
171
172
sweetspot = {}
172
- d = {}
173
+ asymmetry = {}
173
174
bare_frequency = {}
174
175
drive_frequency = {}
175
176
fitted_parameters = {}
176
177
matrix_element = {}
177
- g = {}
178
+ coupling = {}
178
179
179
180
for qubit in qubits :
180
181
qubit_data = data [qubit ]
@@ -196,36 +197,46 @@ def _fit(data: ResonatorFluxData) -> ResonatorFluxResults:
196
197
signal ,
197
198
)
198
199
199
- popt = curve_fit (
200
- utils .transmon_readout_frequency ,
201
- biases ,
202
- frequencies * HZ_TO_GHZ ,
203
- bounds = utils .resonator_flux_dependence_fit_bounds (
204
- data .qubit_frequency [qubit ],
205
- qubit_data .bias ,
206
- data .bare_resonator_frequency [qubit ],
207
- ),
208
- maxfev = 100000 ,
209
- )[0 ]
210
- fitted_parameters [qubit ] = popt .tolist ()
211
-
212
- # frequency corresponds to transmon readout frequency
213
- # at the sweetspot popt[3]
214
- frequency [qubit ] = utils .transmon_readout_frequency (popt [3 ], * popt ) * GHZ_TO_HZ
215
- sweetspot [qubit ] = popt [3 ]
216
- d [qubit ] = popt [1 ]
217
- bare_frequency [qubit ] = popt [4 ] * GHZ_TO_HZ
218
- drive_frequency [qubit ] = popt [0 ] * GHZ_TO_HZ
219
- g [qubit ] = popt [5 ]
220
- matrix_element [qubit ] = popt [2 ]
200
+ try :
201
+ popt = curve_fit (
202
+ utils .transmon_readout_frequency ,
203
+ biases ,
204
+ frequencies * HZ_TO_GHZ ,
205
+ bounds = utils .resonator_flux_dependence_fit_bounds (
206
+ data .qubit_frequency [qubit ],
207
+ qubit_data .bias ,
208
+ data .bare_resonator_frequency [qubit ],
209
+ ),
210
+ maxfev = 100000 ,
211
+ )[0 ]
212
+ fitted_parameters [qubit ] = popt .tolist ()
213
+
214
+ # frequency corresponds to transmon readout frequency
215
+ # at the sweetspot popt[3]
216
+ frequency [qubit ] = (
217
+ utils .transmon_readout_frequency (popt [3 ], * popt ) * GHZ_TO_HZ
218
+ )
219
+ sweetspot [qubit ] = popt [3 ]
220
+ asymmetry [qubit ] = popt [1 ]
221
+ bare_frequency [qubit ] = popt [4 ] * GHZ_TO_HZ
222
+ drive_frequency [qubit ] = popt [0 ] * GHZ_TO_HZ
223
+ coupling [qubit ] = popt [5 ]
224
+ matrix_element [qubit ] = popt [2 ]
225
+ except ValueError as e :
226
+ log .error (
227
+ f"Error in resonator_flux protocol fit: { e } "
228
+ "The threshold for the SNR mask is probably too high. "
229
+ "Lowering the value of `threshold` in `extract_*_feature`"
230
+ "should fix the problem."
231
+ )
221
232
222
233
return ResonatorFluxResults (
223
234
frequency = frequency ,
224
235
sweetspot = sweetspot ,
225
- d = d ,
236
+ asymmetry = asymmetry ,
226
237
bare_frequency = bare_frequency ,
227
238
drive_frequency = drive_frequency ,
228
- g = g ,
239
+ coupling = coupling ,
229
240
matrix_element = matrix_element ,
230
241
fitted_parameters = fitted_parameters ,
231
242
)
@@ -254,8 +265,8 @@ def _plot(data: ResonatorFluxData, fit: ResonatorFluxResults, qubit):
254
265
np .round (fit .bare_frequency [qubit ], 4 ),
255
266
np .round (fit .frequency [qubit ], 4 ),
256
267
np .round (fit .drive_frequency [qubit ], 4 ),
257
- np .round (fit .d [qubit ], 4 ),
258
- np .round (fit .g [qubit ], 4 ),
268
+ np .round (fit .asymmetry [qubit ], 4 ),
269
+ np .round (fit .coupling [qubit ], 4 ),
259
270
np .round (fit .matrix_element [qubit ], 4 ),
260
271
],
261
272
)
@@ -268,8 +279,8 @@ def _update(results: ResonatorFluxResults, platform: Platform, qubit: QubitId):
268
279
update .bare_resonator_frequency (results .bare_frequency [qubit ], platform , qubit )
269
280
update .readout_frequency (results .frequency [qubit ], platform , qubit )
270
281
update .drive_frequency (results .drive_frequency [qubit ], platform , qubit )
271
- update .asymmetry (results .d [qubit ], platform , qubit )
272
- update .coupling (results .g [qubit ], platform , qubit )
282
+ update .asymmetry (results .asymmetry [qubit ], platform , qubit )
283
+ update .coupling (results .coupling [qubit ], platform , qubit )
273
284
274
285
275
286
resonator_flux = Routine (_acquisition , _fit , _plot , _update )
0 commit comments