Skip to content

Commit

Permalink
fix: Add back chi2 to Ramsey experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Sep 24, 2024
1 parent 1140079 commit fed7108
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/qibocal/protocols/ramsey/ramsey.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from qibocal.auto.operation import Routine
from qibocal.config import log

from ..utils import table_dict, table_html
from ..utils import chi2_reduced, table_dict, table_html
from .ramsey_signal import (
RamseySignalData,
RamseySignalParameters,
Expand Down Expand Up @@ -198,6 +198,15 @@ def _fit(data: RamseyData) -> RamseyResults:
delta_fitting_measure[qubit],
popts[qubit],
) = process_fit(popt, perr, qubit_freq, data.detuning)

chi2[qubit] = (
chi2_reduced(
probs,
ramsey_fit(waits, *popts[qubit]),
qubit_data.errors,
),
np.sqrt(2 / len(probs)),
)
except Exception as e:
log.warning(f"Ramsey fitting failed for qubit {qubit} due to {e}.")
return RamseyResults(
Expand Down

0 comments on commit fed7108

Please sign in to comment.