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

Fix ramsey update #976

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Fix ramsey update #976

wants to merge 7 commits into from

Conversation

andrea-pasquale
Copy link
Contributor

The drive frequency is now updated only when a detuning is provided, which is one of the assumption of the fit. When detuning is 0 we update T2 since we expect it to be more reliable.

Now Ramsey can be used to monitor T2 in a more stable way given that the fit will include both oscillations and an exponential decay.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.
  • Compatibility with Qibo modules (Please edit this section if the current pull request is not compatible with the following branches).
    • Qibo: master
    • Qibolab: main
    • Qibolab_platforms_qrc: main

The drive frequency is now updated only when a detuning
is provided, which is one of the assumption of the fit.
When detuning is 0 we update T2 since we expect it to
be more reliable.
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.50%. Comparing base (c4fdce8) to head (4902a18).
Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #976   +/-   ##
=======================================
  Coverage   97.50%   97.50%           
=======================================
  Files         123      123           
  Lines        9701     9701           
=======================================
  Hits         9459     9459           
  Misses        242      242           
Flag Coverage Δ
unittests 97.50% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/qibocal/protocols/ramsey/ramsey.py 99.00% <100.00%> (-0.09%) ⬇️
src/qibocal/protocols/ramsey/ramsey_signal.py 97.54% <100.00%> (-0.10%) ⬇️
src/qibocal/protocols/ramsey/utils.py 100.00% <100.00%> (ø)

@alecandido
Copy link
Member

alecandido commented Sep 5, 2024

In general, it would be better to use None as default (and type is already Optional which is the union of None with the thing being parametrized, not there to signal it has a default).

In this way, it would be smooth, and working in the same way for a 0. or very small detuning.

All the behavior currently attributed to 0. should be moved to None, including the update (with float is also possible to use nan, but I wouldn't recommend it: nan is not always an intentionally missing value, but possibly the result of an undefined float operation - it's also sometimes non-trivial to specify, since it lacks a literal, and identify, because of "weird" comparison).

@@ -295,7 +295,10 @@ def _plot(data: RamseySignalData, target: QubitId, fit: RamseySignalResults = No


def _update(results: RamseySignalResults, platform: Platform, target: QubitId):
update.drive_frequency(results.frequency[target][0], platform, target)
if int(results.delta_phys[target][0]) == int(results.delta_fitting[target][0]):
update.t2(results.t2[target][0], platform, target)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we log what we are updating in the runcard in case of conditional updates (that depend on fitting)?

Copy link
Contributor Author

@andrea-pasquale andrea-pasquale Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is on the roadmap #910
For the time being I would keep those manipulations directly in the python file where we are handling scripts.

@andrea-pasquale
Copy link
Contributor Author

In general, it would be better to use None as default (and type is already Optional which is the union of None with the thing being parametrized, not there to signal it has a default).

In this way, it would be smooth, and working in the same way for a 0. or very small detuning.

All the behavior currently attributed to 0. should be moved to None, including the update (with float is also possible to use nan, but I wouldn't recommend it: nan is not always an intentionally missing value, but possibly the result of an undefined float operation - it's also sometimes non-trivial to specify, since it lacks a literal, and identify, because of "weird" comparison).

Thanks @alecandido in the last commits I've changed the default behavior to None

@andrea-pasquale andrea-pasquale added this to the Qibocal 0.1.0 milestone Sep 24, 2024
andrea-pasquale and others added 2 commits September 24, 2024 15:22
Co-authored-by: Alessandro Candido <candido.ale@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants