Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resonator phases and cable delay #1008

Open
alecandido opened this issue Oct 11, 2024 · 0 comments
Open

Resonator phases and cable delay #1008

alecandido opened this issue Oct 11, 2024 · 0 comments
Labels
enhancement New feature or request experiment Related to an individual experiment (/protocol/routine/...)

Comments

@alecandido
Copy link
Member

Both in the plain resonator spectroscopy, and in the pumped up resonator flux dependence (the version of the spectroscopy with an additional scan over the flux pulse) the phases in the transmission coefficient are affected by the cable delay, as described in #876.

In #917, the cable delay has been subtracted for the specific case of the full-fledged circle fit of the resonator spectroscopy.

def cable_delay(frequencies: NDArray, phases: NDArray, num_points: int) -> float:
"""Evaluates the cable delay :math:`\tau` (in s).
The cable delay :math:`\tau` (in s) is caused by the length of the cable and the finite speed of light.
This is estimated fitting a first-grade polynomial fit of the `phases` (in rad) as a function of the
`frequencies` (in Hz), and extracting the angular coefficient, which is then expressed
in seconds.
The `num_points` is used to select how many points should be fitted, from both the
start and the end of the frequency range.
"""
frequencies_selected = np.concatenate(
(frequencies[:num_points], frequencies[-num_points:])
)
phase_selected = np.concatenate((phases[:num_points], phases[-num_points:]))
pvals = np.polyfit(frequencies_selected, phase_selected, 1)
return pvals[0] / (-2 * np.pi)
def remove_cable_delay(frequencies: NDArray, z: NDArray, tau: float) -> NDArray:
"""Corrects the cable delay :math:`\tau` (in s).
The cable delay :math:`\tau` (in s) is removed from the scattering matrix element array `z` by performing
an exponential product which also depends from the `frequencies` (in Hz).
"""
return z * np.exp(2j * np.pi * frequencies * tau)

It happened there, because that fit is the first to finally use the information on the phase for the fit, while the other fits in both protocols are just using the information in the magnitude.

Despite what is used in the fit, the phases are shown in the report, and they are largely made irrelevant by the presence of the cable delay (well, before they were even more irrelevant, since cable delay-drifted and wrapped).

So, we should ensure a consistent treatment of the phase information, even beyond the unwrapping.

Moreover, even in the s21 fit of the resonator spectroscopy the cable delay is separately evaluated, despite the "time of flight" protocol having already measured it, potentially.
So, we should make it possible to propagate the information separately measured by the time of flight (if available) to always preprocess consistently the transmission coefficient phases.

@alecandido alecandido added enhancement New feature or request experiment Related to an individual experiment (/protocol/routine/...) labels Oct 11, 2024
@Edoardo-Pedicillo Edoardo-Pedicillo added this to the Qibocal 0.1.1 milestone Oct 21, 2024
@Edoardo-Pedicillo Edoardo-Pedicillo removed this from the Qibocal 0.1.1 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experiment Related to an individual experiment (/protocol/routine/...)
Projects
None yet
Development

No branches or pull requests

2 participants