From 5aa50ee515830f2aa51db92dc4e1bac2a6c36884 Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:18:17 +0400 Subject: [PATCH] Revert "fix: Missing qubit key because of identation" This reverts commit 4ea33940b3d4e857e8bd6b01f3701c91e87a2568. --- .../twpa_calibration/frequency_power.py | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/qibocal/protocols/readout_optimization/twpa_calibration/frequency_power.py b/src/qibocal/protocols/readout_optimization/twpa_calibration/frequency_power.py index e9a9a89a6..4bc359892 100644 --- a/src/qibocal/protocols/readout_optimization/twpa_calibration/frequency_power.py +++ b/src/qibocal/protocols/readout_optimization/twpa_calibration/frequency_power.py @@ -100,46 +100,46 @@ def _acquisition( ].twpa.local_oscillator.frequency initial_twpa_power[qubit] = platform.qubits[qubit].twpa.local_oscillator.power - for freq in freq_range: - platform.qubits[qubit].twpa.local_oscillator.frequency = ( - initial_twpa_freq[qubit] + freq - ) - - for power in power_range: - for qubit in targets: - platform.qubits[qubit].twpa.local_oscillator.power = ( - initial_twpa_power[qubit] + power - ) - - classification_data = classification._acquisition( - classification.SingleShotClassificationParameters.load( - {"nshots": params.nshots} - ), - platform, - targets, + for freq in freq_range: + platform.qubits[qubit].twpa.local_oscillator.frequency = ( + initial_twpa_freq[qubit] + freq ) - classification_result = classification._fit(classification_data) + for power in power_range: + for qubit in targets: + platform.qubits[qubit].twpa.local_oscillator.power = ( + initial_twpa_power[qubit] + power + ) - data.register_qubit( - TwpaFrequencyPowerType, - (qubit), - dict( - freq=np.array( - [platform.qubits[qubit].twpa.local_oscillator.frequency], - dtype=np.float64, - ), - power=np.array( - [platform.qubits[qubit].twpa.local_oscillator.power], - dtype=np.float64, + classification_data = classification._acquisition( + classification.SingleShotClassificationParameters.load( + {"nshots": params.nshots} ), - assignment_fidelity=np.array( - [classification_result.assignment_fidelity[qubit]], + platform, + targets, + ) + + classification_result = classification._fit(classification_data) + + data.register_qubit( + TwpaFrequencyPowerType, + (qubit), + dict( + freq=np.array( + [platform.qubits[qubit].twpa.local_oscillator.frequency], + dtype=np.float64, + ), + power=np.array( + [platform.qubits[qubit].twpa.local_oscillator.power], + dtype=np.float64, + ), + assignment_fidelity=np.array( + [classification_result.assignment_fidelity[qubit]], + ), + angle=np.array([classification_result.rotation_angle[qubit]]), + threshold=np.array([classification_result.threshold[qubit]]), ), - angle=np.array([classification_result.rotation_angle[qubit]]), - threshold=np.array([classification_result.threshold[qubit]]), - ), - ) + ) return data