@@ -214,6 +214,18 @@ def _default_experiment_options(cls) -> Options:
214
214
If not set, then ``num_xvals`` parameters spaced according to
215
215
the ``spacing`` policy between ``min_xval`` and ``max_xval`` are used.
216
216
If ``xvals`` is set, these parameters are ignored.
217
+ service (IBMExperimentService): A valid experiment service instance that can
218
+ provide the Stark coefficients for the qubit to run experiment.
219
+ This is required only when ``stark_coefficients`` is ``latest`` and
220
+ ``xval_type`` is ``frequency``. This value is automatically set when
221
+ a backend is attached to this experiment instance.
222
+ stark_coefficients (Union[Dict, str]): Dictionary of Stark shift coefficients to
223
+ convert tone amplitudes into amount of Stark shift. This dictionary must include
224
+ all keys defined in :attr:`.StarkP1SpectAnalysis.stark_coefficients_names`,
225
+ which are calibrated with :class:`.StarkRamseyXYAmpScan`.
226
+ Alternatively, it searches for these coefficients in the result database
227
+ when "latest" is set. This requires having the experiment service set in
228
+ the experiment data to analyze.
217
229
"""
218
230
options = super ()._default_experiment_options ()
219
231
options .update_options (
@@ -328,7 +340,7 @@ def _frequencies_to_amplitudes(self, params: np.ndarray) -> np.ndarray:
328
340
if np .isclose (stark_shift , 0 ):
329
341
amplitudes [idx ] = 0
330
342
continue
331
- elif np .sign (stark_shift ) > 0 :
343
+ if np .sign (stark_shift ) > 0 :
332
344
fit_coeffs = [* positive , - stark_shift ]
333
345
else :
334
346
fit_coeffs = [* negative , - stark_shift ]
@@ -353,7 +365,7 @@ def _frequencies_to_amplitudes(self, params: np.ndarray) -> np.ndarray:
353
365
f"Stark shift at frequency value of { tgt_freq } Hz is not available on "
354
366
f"the backend { self ._backend_data .name } qubit { self .physical_qubits } ."
355
367
)
356
- elif len (valid_amps ) > 1 :
368
+ if len (valid_amps ) > 1 :
357
369
# We assume a monotonic trend but sometimes a large third-order term causes
358
370
# inflection point and inverts the trend in larger amplitudes.
359
371
# In this case we would have more than one solutions, but we can
0 commit comments