Skip to content

Commit

Permalink
Updated refactoring in qubit_flux_tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePalazzo committed Nov 13, 2023
1 parent 4b41684 commit 27f92f3
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class QubitFluxResults(Results):
[
("freq", np.float64),
("bias", np.float64),
("msr", np.float64),
("signal", np.float64),
("phase", np.float64),
]
)
Expand All @@ -87,14 +87,14 @@ class QubitFluxData(Data):
data: dict[QubitId, npt.NDArray[QubitFluxType]] = field(default_factory=dict)
"""Raw data acquired."""

def register_qubit_track(self, qubit, freq, bias, msr, phase):
def register_qubit_track(self, qubit, freq, bias, signal, phase):
"""Store output for single qubit."""
# to be able to handle the 1D sweeper case
size = len(freq)
ar = np.empty(size, dtype=QubitFluxType)
ar["freq"] = freq
ar["bias"] = [bias] * size
ar["msr"] = msr
ar["signal"] = signal
ar["phase"] = phase
if qubit in self.data:
self.data[qubit] = np.rec.array(np.concatenate((self.data[qubit], ar)))
Expand Down Expand Up @@ -201,7 +201,7 @@ def _acquisition(
result = results[ro_pulses[qubit].serial]
data.register_qubit_track(
qubit,
msr=result.magnitude,
signal=result.magnitude,
phase=result.phase,
freq=delta_frequency_range + qd_pulses[qubit].frequency,
bias=bias + qubits[qubit].sweetspot,
Expand Down Expand Up @@ -240,13 +240,13 @@ def _fit(data: QubitFluxData) -> QubitFluxResults:

biases = qubit_data.bias
frequencies = qubit_data.freq
msr = qubit_data.msr
signal = qubit_data.signal

if data.resonator_type == "2D":
msr = -msr
signal = -signal

frequencies, biases = utils.image_to_curve(
frequencies, biases, msr, msr_mask=0.3
frequencies, biases, signal, signal_mask=0.3
)
max_c = biases[np.argmax(frequencies)]
min_c = biases[np.argmin(frequencies)]
Expand Down

0 comments on commit 27f92f3

Please sign in to comment.