Skip to content

Commit

Permalink
Replace the fitter of StarkRamseyXYAmpScan experiment (#1243)
Browse files Browse the repository at this point in the history
### Summary

This PR replaces the fitter of `StarkRamseyXYAmpScan` experiment.
Current fitter puts strong assumption on model parameter and it makes
the fitting quite unstable to the change in dephasing rate.

This PR doesn't introduce any breaking API change and a separate release
note is not necessary because the experiment is not released yet.

### Details and comments

The current fitter simultaneously fits the P1 values of the Ramsey X and
Y experiment. Given the Stark shift is the third order polynominal of
tone amplitude x, the P1 values for X and Y are

```
Px(x) = A cos(2 pi t_S (c1 x + c2 x**2 + c3 x**3 + f_err)) + offset
Px(x) = A sin(2 pi t_S (c1 x + c2 x**2 + c3 x**3 + f_err)) + offset
```

where t_S is the fixed Stark delay and others are the fit parameters.
Note that current fitter assumes that A is independent of x, however,
since this is a variant of Ramsey experiment, the P1 amplitude actually
depends on x. This is because qubit T2 may depend on the frequency, or
at larger Stark amplitude the qubit heating may cause faster dephasing.
In the new fitter, we directly extract the phase polynominal and perform
fit on this synthesized data. Namely,

```
poly = unwrap(arctan2(Py, Px)) ~ 2 pi t_S (c1 x + c2 x**2 + c3 x**3 + f_err)
```

Because A is canceled out in this form, the fitting becomes robust to
the amplitude dependence of the dephasing rate. Usually we cannot obtain
the reasonable model for A(x).

For example, the experiment data below shows the difference of fit on
the poly data and raw Px, Py data (actually the parameters are fit on
the poly data and Px, Py data are just visualized with the fitted
parameters).


![image](https://github.com/Qiskit-Extensions/qiskit-experiments/assets/39517270/d14b8537-dcc9-489c-b277-fe7df7af8938)

As you can see, the Px, Py data are damped quickly on positive
amplitudes, and the envelope of the trigonometric function is asymmetric
with respect to 0. In this situation the current fitter doesn't work
well. In contrast, new phase fitter works nicely.

---------

Co-authored-by: Will Shanks <[email protected]>
Co-authored-by: Will Shanks <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2024
1 parent 2571675 commit ab40c5a
Show file tree
Hide file tree
Showing 3 changed files with 297 additions and 177 deletions.
2 changes: 1 addition & 1 deletion qiskit_experiments/curve_analysis/scatter_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def y_err(self) -> np.ndarray:
)
def shots(self):
"""Shot number of data points."""
return self.shots.to_numpy()
return self["shots"].to_numpy()

@property
@deprecate_func(
Expand Down
Loading

0 comments on commit ab40c5a

Please sign in to comment.