diff --git a/src/qibocal/protocols/characterization/__init__.py b/src/qibocal/protocols/characterization/__init__.py index 1c613339e..0e239e21e 100644 --- a/src/qibocal/protocols/characterization/__init__.py +++ b/src/qibocal/protocols/characterization/__init__.py @@ -5,15 +5,15 @@ from .allxy.drag_pulse_tuning import drag_pulse_tuning from .classification import single_shot_classification from .coherence.spin_echo import spin_echo -from .coherence.spin_echo_msr import spin_echo_msr +from .coherence.spin_echo_sequence import spin_echo_sequence from .coherence.t1 import t1 -from .coherence.t1_msr import t1_msr from .coherence.t1_sequences import t1_sequences +from .coherence.t1_signal import t1_signal from .coherence.t2 import t2 -from .coherence.t2_msr import t2_msr from .coherence.t2_sequences import t2_sequences +from .coherence.t2_signal import t2_signal from .coherence.zeno import zeno -from .coherence.zeno_msr import zeno_msr +from .coherence.zeno_signal import zeno_signal from .couplers.coupler_qubit_spectroscopy import coupler_qubit_spectroscopy from .couplers.coupler_resonator_spectroscopy import coupler_resonator_spectroscopy from .dispersive_shift import dispersive_shift @@ -29,14 +29,14 @@ from .qubit_spectroscopy_ef import qubit_spectroscopy_ef from .qutrit_classification import qutrit_classification from .rabi.amplitude import rabi_amplitude -from .rabi.amplitude_msr import rabi_amplitude_msr +from .rabi.amplitude_signal import rabi_amplitude_signal from .rabi.ef import rabi_amplitude_ef from .rabi.length import rabi_length -from .rabi.length_msr import rabi_length_msr from .rabi.length_sequences import rabi_length_sequences +from .rabi.length_signal import rabi_length_signal from .ramsey import ramsey -from .ramsey_msr import ramsey_msr from .ramsey_sequences import ramsey_sequences +from .ramsey_signal import ramsey_signal from .randomized_benchmarking.standard_rb import standard_rb from .readout_characterization import readout_characterization from .readout_mitigation_matrix import readout_mitigation_matrix @@ -67,21 +67,21 @@ class Operation(Enum): rabi_amplitude = rabi_amplitude rabi_length = rabi_length rabi_length_sequences = rabi_length_sequences - rabi_amplitude_msr = rabi_amplitude_msr - rabi_length_msr = rabi_length_msr + rabi_amplitude_signal = rabi_amplitude_signal + rabi_length_signal = rabi_length_signal ramsey = ramsey - ramsey_msr = ramsey_msr + ramsey_signal = ramsey_signal ramsey_sequences = ramsey_sequences t1 = t1 - t1_msr = t1_msr + t1_signal = t1_signal t1_sequences = t1_sequences t2 = t2 - t2_msr = t2_msr + t2_signal = t2_signal t2_sequences = t2_sequences time_of_flight_readout = time_of_flight_readout single_shot_classification = single_shot_classification spin_echo = spin_echo - spin_echo_msr = spin_echo_msr + spin_echo_sequence = spin_echo_sequence allxy = allxy allxy_drag_pulse_tuning = allxy_drag_pulse_tuning drag_pulse_tuning = drag_pulse_tuning @@ -94,7 +94,7 @@ class Operation(Enum): resonator_frequency = resonator_frequency fast_reset = fast_reset zeno = zeno - zeno_msr = zeno_msr + zeno_signal = zeno_signal chsh_pulses = chsh_pulses chsh_circuits = chsh_circuits readout_mitigation_matrix = readout_mitigation_matrix diff --git a/src/qibocal/protocols/characterization/allxy/drag_pulse_tuning.py b/src/qibocal/protocols/characterization/allxy/drag_pulse_tuning.py index 16d7902ad..9e738c912 100644 --- a/src/qibocal/protocols/characterization/allxy/drag_pulse_tuning.py +++ b/src/qibocal/protocols/characterization/allxy/drag_pulse_tuning.py @@ -14,7 +14,7 @@ from qibocal.auto.operation import Data, Qubits, Results, Routine from qibocal.config import log -from ..utils import V_TO_UV, table_dict, table_html +from ..utils import table_dict, table_html from . import allxy_drag_pulse_tuning @@ -40,7 +40,7 @@ class DragPulseTuningResults(Results): """Raw fitting output.""" -DragPulseTuningType = np.dtype([("msr", np.float64), ("beta", np.float64)]) +DragPulseTuningType = np.dtype([("signal", np.float64), ("beta", np.float64)]) @dataclass @@ -67,7 +67,6 @@ def _acquisition( params.beta_start, params.beta_end, params.beta_step ).round(4) - # create a DataUnits object to store the MSR, phase, i, q and the beta parameter data = DragPulseTuningData() for beta_param in beta_param_range: @@ -144,7 +143,7 @@ def _acquisition( DragPulseTuningType, (qubit), dict( - msr=r1.magnitude - r2.magnitude, + signal=r1.magnitude - r2.magnitude, beta=beta_param, ), ) @@ -175,7 +174,7 @@ def _fit(data: DragPulseTuningData) -> DragPulseTuningResults: for qubit in qubits: qubit_data = data[qubit] - voltages = qubit_data.msr * V_TO_UV + voltages = qubit_data.signal beta_params = qubit_data.beta try: @@ -209,7 +208,7 @@ def _plot(data: DragPulseTuningData, qubit, fit: DragPulseTuningResults): fig.add_trace( go.Scatter( x=qubit_data.beta, - y=qubit_data.msr * V_TO_UV, + y=qubit_data.signal, mode="markers", name="Probability", showlegend=True, @@ -247,7 +246,7 @@ def _plot(data: DragPulseTuningData, qubit, fit: DragPulseTuningResults): showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title="Beta parameter", - yaxis_title="MSR[uV] [Rx(pi/2) - Ry(pi)] - [Ry(pi/2) - Rx(pi)]", + yaxis_title="Signal [a.u.] [Rx(pi/2) - Ry(pi)] - [Ry(pi/2) - Rx(pi)]", ) figures.append(fig) diff --git a/src/qibocal/protocols/characterization/coherence/spin_echo_msr.py b/src/qibocal/protocols/characterization/coherence/spin_echo_sequence.py similarity index 81% rename from src/qibocal/protocols/characterization/coherence/spin_echo_msr.py rename to src/qibocal/protocols/characterization/coherence/spin_echo_sequence.py index bfdcdaa6b..4915123a8 100644 --- a/src/qibocal/protocols/characterization/coherence/spin_echo_msr.py +++ b/src/qibocal/protocols/characterization/coherence/spin_echo_sequence.py @@ -10,31 +10,31 @@ from qibocal import update from qibocal.auto.operation import Qubits, Routine -from ..utils import V_TO_UV, table_dict, table_html +from ..utils import table_dict, table_html from . import spin_echo -from .t1_msr import CoherenceType, T1MSRData +from .t1_signal import CoherenceType, T1SignalData from .utils import exp_decay, exponential_fit @dataclass -class SpinEchoMSRParameters(spin_echo.SpinEchoParameters): - """SpinEcho MSR runcard inputs.""" +class SpinEchoSignalParameters(spin_echo.SpinEchoParameters): + """SpinEcho Signal runcard inputs.""" @dataclass -class SpinEchoMSRResults(spin_echo.SpinEchoResults): - """SpinEchoMSR outputs.""" +class SpinEchoSignalResults(spin_echo.SpinEchoResults): + """SpinEchoSignal outputs.""" -class SpinEchoMSRData(T1MSRData): +class SpinEchoSignalData(T1SignalData): """SpinEcho acquisition outputs.""" def _acquisition( - params: SpinEchoMSRParameters, + params: SpinEchoSignalParameters, platform: Platform, qubits: Qubits, -) -> SpinEchoMSRData: +) -> SpinEchoSignalData: """Data acquisition for SpinEcho""" # create a sequence of pulses for the experiment: # Spin Echo 3 Pulses: RX(pi/2) - wait t(rotates z) - RX(pi) - wait t(rotates z) - RX(pi/2) - readout @@ -67,7 +67,7 @@ def _acquisition( params.delay_between_pulses_step, ) - data = SpinEchoMSRData() + data = SpinEchoSignalData() # sweep the parameter for wait in ro_wait_range: @@ -96,21 +96,21 @@ def _acquisition( (qubit), dict( wait=np.array([wait]), - msr=np.array([result.magnitude]), + signal=np.array([result.magnitude]), phase=np.array([result.phase]), ), ) return data -def _fit(data: SpinEchoMSRData) -> SpinEchoMSRResults: +def _fit(data: SpinEchoSignalData) -> SpinEchoSignalResults: """Post-processing for SpinEcho.""" t2Echos, fitted_parameters = exponential_fit(data) - return SpinEchoMSRResults(t2Echos, fitted_parameters) + return SpinEchoSignalResults(t2Echos, fitted_parameters) -def _plot(data: SpinEchoMSRData, qubit, fit: SpinEchoMSRResults = None): +def _plot(data: SpinEchoSignalData, qubit, fit: SpinEchoSignalResults = None): """Plotting for SpinEcho""" figures = [] @@ -125,7 +125,7 @@ def _plot(data: SpinEchoMSRData, qubit, fit: SpinEchoMSRResults = None): fig.add_trace( go.Scatter( x=waits, - y=qubit_data.msr * V_TO_UV, + y=qubit_data.signal, opacity=1, name="Voltage", showlegend=True, @@ -158,8 +158,8 @@ def _plot(data: SpinEchoMSRData, qubit, fit: SpinEchoMSRResults = None): fig.update_layout( showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting - xaxis_title="Time (ns)", - yaxis_title="MSR (uV)", + xaxis_title="Time [ns]", + yaxis_title="Signal [a.u.]", ) figures.append(fig) @@ -167,9 +167,9 @@ def _plot(data: SpinEchoMSRData, qubit, fit: SpinEchoMSRResults = None): return figures, fitting_report -def _update(results: SpinEchoMSRResults, platform: Platform, qubit: QubitId): +def _update(results: SpinEchoSignalResults, platform: Platform, qubit: QubitId): update.t2_spin_echo(results.t2_spin_echo[qubit], platform, qubit) -spin_echo_msr = Routine(_acquisition, _fit, _plot, _update) +spin_echo_sequence = Routine(_acquisition, _fit, _plot, _update) """SpinEcho Routine object.""" diff --git a/src/qibocal/protocols/characterization/coherence/t1_sequences.py b/src/qibocal/protocols/characterization/coherence/t1_sequences.py index 8218e4ab2..3167be79f 100644 --- a/src/qibocal/protocols/characterization/coherence/t1_sequences.py +++ b/src/qibocal/protocols/characterization/coherence/t1_sequences.py @@ -5,12 +5,12 @@ from qibocal.auto.operation import Qubits, Routine -from . import t1, t1_msr +from . import t1, t1_signal def _acquisition( - params: t1_msr.T1MSRParameters, platform: Platform, qubits: Qubits -) -> t1_msr.T1MSRData: + params: t1_signal.T1SignalParameters, platform: Platform, qubits: Qubits +) -> t1_signal.T1SignalData: r"""Data acquisition for T1 experiment. In a T1 experiment, we measure an excited qubit after a delay. Due to decoherence processes (e.g. amplitude damping channel), it is possible that, at the time of measurement, after the delay, @@ -50,8 +50,7 @@ def _acquisition( params.delay_before_readout_step, ) - # create a DataUnits object to store the MSR, phase, i, q and the delay time - data = t1_msr.T1MSRData() + data = t1_signal.T1SignalData() # repeat the experiment as many times as defined by software_averages # sweep the parameter @@ -70,19 +69,18 @@ def _acquisition( ), ) for qubit in qubits: - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulses[qubit].serial] data.register_qubit( - t1_msr.CoherenceType, + t1_signal.CoherenceType, (qubit), dict( wait=np.array([wait]), - msr=np.array([result.magnitude]), + signal=np.array([result.magnitude]), phase=np.array([result.phase]), ), ) return data -t1_sequences = Routine(_acquisition, t1_msr._fit, t1_msr._plot, t1._update) +t1_sequences = Routine(_acquisition, t1_signal._fit, t1_signal._plot, t1._update) """T1 Routine object.""" diff --git a/src/qibocal/protocols/characterization/coherence/t1_msr.py b/src/qibocal/protocols/characterization/coherence/t1_signal.py similarity index 83% rename from src/qibocal/protocols/characterization/coherence/t1_msr.py rename to src/qibocal/protocols/characterization/coherence/t1_signal.py index b4e6cb20f..86dbcec14 100644 --- a/src/qibocal/protocols/characterization/coherence/t1_msr.py +++ b/src/qibocal/protocols/characterization/coherence/t1_signal.py @@ -11,28 +11,28 @@ from qibocal.auto.operation import Data, Qubits, Routine -from ..utils import V_TO_UV, table_dict, table_html +from ..utils import table_dict, table_html from . import t1, utils @dataclass -class T1MSRParameters(t1.T1Parameters): - """T1 MSR runcard inputs.""" +class T1SignalParameters(t1.T1Parameters): + """T1 Signal runcard inputs.""" @dataclass -class T1MSRResults(t1.T1Results): - """T1 MSR outputs.""" +class T1SignalResults(t1.T1Results): + """T1 Signal outputs.""" CoherenceType = np.dtype( - [("wait", np.float64), ("msr", np.float64), ("phase", np.float64)] + [("wait", np.float64), ("signal", np.float64), ("phase", np.float64)] ) """Custom dtype for coherence routines.""" @dataclass -class T1MSRData(Data): +class T1SignalData(Data): """T1 acquisition outputs.""" data: dict[QubitId, npt.NDArray] = field(default_factory=dict) @@ -40,8 +40,8 @@ class T1MSRData(Data): def _acquisition( - params: T1MSRParameters, platform: Platform, qubits: Qubits -) -> T1MSRData: + params: T1SignalParameters, platform: Platform, qubits: Qubits +) -> T1SignalData: r"""Data acquisition for T1 experiment. In a T1 experiment, we measure an excited qubit after a delay. Due to decoherence processes (e.g. amplitude damping channel), it is possible that, at the time of measurement, after the delay, @@ -88,8 +88,7 @@ def _acquisition( type=SweeperType.ABSOLUTE, ) - # create a DataUnits object to store the MSR, phase, i, q and the delay time - data = T1MSRData() + data = T1SignalData() # sweep the parameter # execute the pulse sequence @@ -109,13 +108,13 @@ def _acquisition( data.register_qubit( CoherenceType, (qubit), - dict(wait=ro_wait_range, msr=result.magnitude, phase=result.phase), + dict(wait=ro_wait_range, signal=result.magnitude, phase=result.phase), ) return data -def _fit(data: T1MSRData) -> T1MSRResults: +def _fit(data: T1SignalData) -> T1SignalResults: """ Fitting routine for T1 experiment. The used model is @@ -125,10 +124,10 @@ def _fit(data: T1MSRData) -> T1MSRResults: """ t1s, fitted_parameters = utils.exponential_fit(data) - return T1MSRResults(t1s, fitted_parameters) + return T1SignalResults(t1s, fitted_parameters) -def _plot(data: T1MSRData, qubit, fit: T1MSRResults = None): +def _plot(data: T1SignalData, qubit, fit: T1SignalResults = None): """Plotting function for T1 experiment.""" figures = [] @@ -141,7 +140,7 @@ def _plot(data: T1MSRData, qubit, fit: T1MSRResults = None): fig.add_trace( go.Scatter( x=waits, - y=qubit_data.msr * V_TO_UV, + y=qubit_data.signal, opacity=1, name="Voltage", showlegend=True, @@ -173,8 +172,8 @@ def _plot(data: T1MSRData, qubit, fit: T1MSRResults = None): fig.update_layout( showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting - xaxis_title="Time (ns)", - yaxis_title="MSR (uV)", + xaxis_title="Time [ns]", + yaxis_title="Signal [a.u.]", ) figures.append(fig) @@ -182,5 +181,5 @@ def _plot(data: T1MSRData, qubit, fit: T1MSRResults = None): return figures, fitting_report -t1_msr = Routine(_acquisition, _fit, _plot, t1._update) -"""T1 MSR Routine object.""" +t1_signal = Routine(_acquisition, _fit, _plot, t1._update) +"""T1 Signal Routine object.""" diff --git a/src/qibocal/protocols/characterization/coherence/t2_sequences.py b/src/qibocal/protocols/characterization/coherence/t2_sequences.py index c8dd4a578..f70a7c1e9 100644 --- a/src/qibocal/protocols/characterization/coherence/t2_sequences.py +++ b/src/qibocal/protocols/characterization/coherence/t2_sequences.py @@ -5,15 +5,15 @@ from qibocal.auto.operation import Qubits, Routine -from .t1_msr import CoherenceType -from .t2_msr import T2MSRData, T2MSRParameters, _fit, _plot, _update +from .t1_signal import CoherenceType +from .t2_signal import T2SignalData, T2SignalParameters, _fit, _plot, _update def _acquisition( - params: T2MSRParameters, + params: T2SignalParameters, platform: Platform, qubits: Qubits, -) -> T2MSRData: +) -> T2SignalData: """Data acquisition for Ramsey Experiment (detuned).""" # create a sequence of pulses for the experiment # RX90 - t - RX90 - MZ @@ -42,10 +42,7 @@ def _acquisition( params.delay_between_pulses_step, ) - # create a DataUnits object to store the results, - # DataUnits stores by default MSR, phase, i, q - # additionally include wait time and t_max - data = T2MSRData() + data = T2SignalData() # sweep the parameter for wait in waits: @@ -70,7 +67,7 @@ def _acquisition( (qubit), dict( wait=np.array([wait]), - msr=np.array([result.magnitude]), + signal=np.array([result.magnitude]), phase=np.array([result.phase]), ), ) diff --git a/src/qibocal/protocols/characterization/coherence/t2_msr.py b/src/qibocal/protocols/characterization/coherence/t2_signal.py similarity index 77% rename from src/qibocal/protocols/characterization/coherence/t2_msr.py rename to src/qibocal/protocols/characterization/coherence/t2_signal.py index 25adb7989..6e3be7ddd 100644 --- a/src/qibocal/protocols/characterization/coherence/t2_msr.py +++ b/src/qibocal/protocols/characterization/coherence/t2_signal.py @@ -11,29 +11,29 @@ from qibocal import update from qibocal.auto.operation import Qubits, Routine -from ..utils import V_TO_UV, table_dict, table_html -from . import t1_msr, t2, utils +from ..utils import table_dict, table_html +from . import t1_signal, t2, utils @dataclass -class T2MSRParameters(t2.T2Parameters): - """T2MSR runcard inputs.""" +class T2SignalParameters(t2.T2Parameters): + """T2Signal runcard inputs.""" @dataclass -class T2MSRResults(t2.T2Results): - """T2MSR outputs.""" +class T2SignalResults(t2.T2Results): + """T2Signal outputs.""" -class T2MSRData(t1_msr.T1MSRData): - """T2MSR acquisition outputs.""" +class T2SignalData(t1_signal.T1SignalData): + """T2Signal acquisition outputs.""" def _acquisition( - params: T2MSRParameters, + params: T2SignalParameters, platform: Platform, qubits: Qubits, -) -> T2MSRData: +) -> T2SignalData: """Data acquisition for Ramsey Experiment (detuned).""" # create a sequence of pulses for the experiment # RX90 - t - RX90 - MZ @@ -62,10 +62,7 @@ def _acquisition( params.delay_between_pulses_step, ) - # create a DataUnits object to store the results, - # DataUnits stores by default MSR, phase, i, q - # additionally include wait time and t_max - data = T2MSRData() + data = T2SignalData() sweeper = Sweeper( Parameter.start, @@ -89,24 +86,24 @@ def _acquisition( for qubit in qubits: result = results[ro_pulses[qubit].serial] data.register_qubit( - t1_msr.CoherenceType, + t1_signal.CoherenceType, (qubit), - dict(wait=waits, msr=result.magnitude, phase=result.phase), + dict(wait=waits, signal=result.magnitude, phase=result.phase), ) return data -def _fit(data: T2MSRData) -> T2MSRResults: +def _fit(data: T2SignalData) -> T2SignalResults: r""" Fitting routine for Ramsey experiment. The used model is .. math:: y = p_0 - p_1 e^{-x p_2}. """ t2s, fitted_parameters = utils.exponential_fit(data) - return T2MSRResults(t2s, fitted_parameters) + return T2SignalResults(t2s, fitted_parameters) -def _plot(data: T2MSRData, qubit, fit: T2MSRResults = None): +def _plot(data: T2SignalData, qubit, fit: T2SignalResults = None): """Plotting function for Ramsey Experiment.""" figures = [] @@ -118,7 +115,7 @@ def _plot(data: T2MSRData, qubit, fit: T2MSRResults = None): fig.add_trace( go.Scatter( x=qubit_data.wait, - y=qubit_data.msr * V_TO_UV, + y=qubit_data.signal, opacity=1, name="Voltage", showlegend=True, @@ -153,8 +150,8 @@ def _plot(data: T2MSRData, qubit, fit: T2MSRResults = None): fig.update_layout( showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting - xaxis_title="Time (ns)", - yaxis_title="MSR (uV)", + xaxis_title="Time [ns]", + yaxis_title="Signal [a.u.]", ) figures.append(fig) @@ -162,9 +159,9 @@ def _plot(data: T2MSRData, qubit, fit: T2MSRResults = None): return figures, fitting_report -def _update(results: T2MSRResults, platform: Platform, qubit: QubitId): +def _update(results: T2SignalResults, platform: Platform, qubit: QubitId): update.t2(results.t2[qubit], platform, qubit) -t2_msr = Routine(_acquisition, _fit, _plot, _update) -"""T2MSR Routine object.""" +t2_signal = Routine(_acquisition, _fit, _plot, _update) +"""T2Signal Routine object.""" diff --git a/src/qibocal/protocols/characterization/coherence/utils.py b/src/qibocal/protocols/characterization/coherence/utils.py index 836a76a9e..8f403571d 100644 --- a/src/qibocal/protocols/characterization/coherence/utils.py +++ b/src/qibocal/protocols/characterization/coherence/utils.py @@ -3,8 +3,6 @@ from qibocal.config import log -from ..utils import V_TO_UV - def exp_decay(x, *p): return p[0] - p[1] * np.exp(-1 * x / p[2]) @@ -17,9 +15,9 @@ def exponential_fit(data, zeno=None): fitted_parameters = {} for qubit in qubits: - voltages = data[qubit].msr * V_TO_UV + voltages = data[qubit].signal if zeno: - times = np.arange(1, len(data[qubit].msr) + 1) + times = np.arange(1, len(data[qubit].signal) + 1) else: times = data[qubit].wait diff --git a/src/qibocal/protocols/characterization/coherence/zeno_msr.py b/src/qibocal/protocols/characterization/coherence/zeno_signal.py similarity index 91% rename from src/qibocal/protocols/characterization/coherence/zeno_msr.py rename to src/qibocal/protocols/characterization/coherence/zeno_signal.py index 9c4c8f88a..e86e7d9ad 100644 --- a/src/qibocal/protocols/characterization/coherence/zeno_msr.py +++ b/src/qibocal/protocols/characterization/coherence/zeno_signal.py @@ -12,7 +12,7 @@ from qibocal import update from qibocal.auto.operation import Data, Parameters, Qubits, Results, Routine -from ..utils import V_TO_UV, table_dict, table_html +from ..utils import table_dict, table_html from . import utils @@ -28,7 +28,7 @@ class ZenoParameters(Parameters): """Relaxation time (ns).""" -ZenoType = np.dtype([("msr", np.float64), ("phase", np.float64)]) +ZenoType = np.dtype([("signal", np.float64), ("phase", np.float64)]) """Custom dtype for Zeno.""" @@ -39,10 +39,10 @@ class ZenoData(Data): data: dict[QubitId, npt.NDArray] = field(default_factory=dict) """Raw data acquired.""" - def register_qubit(self, qubit, msr, phase): + def register_qubit(self, qubit, signal, phase): """Store output for single qubit.""" ar = np.empty((1,), dtype=ZenoType) - 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))) @@ -109,7 +109,9 @@ def _acquisition( for qubit in qubits: for ro_pulse in ro_pulses[qubit]: result = results[ro_pulse.serial] - data.register_qubit(qubit=qubit, msr=result.magnitude, phase=result.phase) + data.register_qubit( + qubit=qubit, signal=result.magnitude, phase=result.phase + ) return data @@ -134,12 +136,12 @@ def _plot(data: ZenoData, fit: ZenoResults, qubit): fitting_report = "" qubit_data = data[qubit] - readouts = np.arange(1, len(qubit_data.msr) + 1) + readouts = np.arange(1, len(qubit_data.signal) + 1) fig.add_trace( go.Scatter( x=readouts, - y=qubit_data.msr * V_TO_UV, + y=qubit_data.signal, opacity=1, name="Voltage", showlegend=True, @@ -180,7 +182,7 @@ def _plot(data: ZenoData, fit: ZenoResults, qubit): showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title="Number of readouts", - yaxis_title="MSR (uV)", + yaxis_title="Signal [a.u.]", ) figures.append(fig) @@ -192,4 +194,4 @@ def _update(results: ZenoResults, platform: Platform, qubit: QubitId): update.t1(results.zeno_t1[qubit], platform, qubit) -zeno_msr = Routine(_acquisition, _fit, _plot, _update) +zeno_signal = Routine(_acquisition, _fit, _plot, _update) diff --git a/src/qibocal/protocols/characterization/couplers/coupler_qubit_spectroscopy.py b/src/qibocal/protocols/characterization/couplers/coupler_qubit_spectroscopy.py index da82abcf0..4e88306ca 100644 --- a/src/qibocal/protocols/characterization/couplers/coupler_qubit_spectroscopy.py +++ b/src/qibocal/protocols/characterization/couplers/coupler_qubit_spectroscopy.py @@ -106,12 +106,11 @@ def _acquisition( for i, pair in enumerate(qubits): # TODO: May measure both qubits on the pair qubit = platform.qubits[params.measured_qubits[i]].name - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulses[qubit].serial] # store the results data.register_qubit( qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + qd_pulses[qubit].frequency, bias=delta_bias_range, diff --git a/src/qibocal/protocols/characterization/couplers/coupler_resonator_spectroscopy.py b/src/qibocal/protocols/characterization/couplers/coupler_resonator_spectroscopy.py index 5408817e2..e4e0c685a 100644 --- a/src/qibocal/protocols/characterization/couplers/coupler_resonator_spectroscopy.py +++ b/src/qibocal/protocols/characterization/couplers/coupler_resonator_spectroscopy.py @@ -110,12 +110,11 @@ def _acquisition( for i, pair in enumerate(qubits): # TODO: May measure both qubits on the pair qubit = platform.qubits[params.measured_qubits[i]].name - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulses[qubit].serial] # store the results data.register_qubit( qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + ro_pulses[qubit].frequency, bias=delta_bias_range, diff --git a/src/qibocal/protocols/characterization/couplers/utils.py b/src/qibocal/protocols/characterization/couplers/utils.py index 311d036c7..38bed71e4 100644 --- a/src/qibocal/protocols/characterization/couplers/utils.py +++ b/src/qibocal/protocols/characterization/couplers/utils.py @@ -38,7 +38,7 @@ class CouplerSpectroscopyParameters(Parameters): [ ("freq", np.float64), ("bias", np.float64), - ("msr", np.float64), + ("signal", np.float64), ("phase", np.float64), ] ) @@ -66,8 +66,8 @@ class CouplerSpectroscopyData(Data): data: dict[QubitId, npt.NDArray[CouplerSpecType]] = field(default_factory=dict) """Raw data acquired.""" - def register_qubit(self, qubit, freq, bias, msr, phase): + def register_qubit(self, qubit, freq, bias, signal, phase): """Store output for single qubit.""" self.data[qubit] = create_data_array( - freq, bias, msr, phase, dtype=CouplerSpecType + freq, bias, signal, phase, dtype=CouplerSpecType ) diff --git a/src/qibocal/protocols/characterization/dispersive_shift.py b/src/qibocal/protocols/characterization/dispersive_shift.py index 4db8a30fe..33f359de6 100644 --- a/src/qibocal/protocols/characterization/dispersive_shift.py +++ b/src/qibocal/protocols/characterization/dispersive_shift.py @@ -15,7 +15,6 @@ from qibocal.protocols.characterization.utils import ( GHZ_TO_HZ, HZ_TO_GHZ, - V_TO_UV, lorentzian, lorentzian_fit, table_dict, @@ -62,7 +61,7 @@ def state_one(self): ("freq", np.float64), ("i", np.float64), ("q", np.float64), - ("msr", np.float64), + ("signal", np.float64), ("phase", np.float64), ] ) @@ -151,7 +150,6 @@ def _acquisition( # retrieve the results for every qubit for qubit in qubits: - # average msr, phase, i and q over the number of shots defined in the runcard for i, results in enumerate([results_0, results_1]): result = results[ro_pulses[qubit].serial] # store the results @@ -160,7 +158,7 @@ def _acquisition( (qubit, i), dict( freq=ro_pulses[qubit].frequency + delta_frequency_range, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, i=result.voltage_i, q=result.voltage_q, @@ -223,8 +221,8 @@ def _plot(data: DispersiveShiftData, qubit, fit: DispersiveShiftResults): horizontal_spacing=0.1, vertical_spacing=0.1, subplot_titles=( - "MSR (V)", - "phase (rad)", + "Signal [a.u.]", + "phase [rad]", ), ) # iterate over multiple data folders @@ -249,7 +247,7 @@ def _plot(data: DispersiveShiftData, qubit, fit: DispersiveShiftResults): fig.add_trace( go.Scatter( x=frequencies, - y=q_data.msr * V_TO_UV, + y=q_data.signal, opacity=opacity, name=f"{label}", showlegend=True, @@ -297,8 +295,8 @@ def _plot(data: DispersiveShiftData, qubit, fit: DispersiveShiftResults): go.Scatter( x=[fit.best_freq[qubit], fit.best_freq[qubit]], y=[ - np.min(np.concatenate((data_0.msr, data_1.msr))), - np.max(np.concatenate((data_0.msr, data_1.msr))), + np.min(np.concatenate((data_0.signal, data_1.signal))), + np.max(np.concatenate((data_0.signal, data_1.signal))), ], mode="lines", line=go.scatter.Line(color="orange", width=3, dash="dash"), @@ -340,10 +338,10 @@ def _plot(data: DispersiveShiftData, qubit, fit: DispersiveShiftResults): ) fig.update_layout( showlegend=True, - xaxis_title="Frequency (GHz)", - yaxis_title="MSR (uV)", - xaxis2_title="Frequency (GHz)", - yaxis2_title="Phase (rad)", + xaxis_title="Frequency [GHz]", + yaxis_title="Signal [a.u.]", + xaxis2_title="Frequency [GHz]", + yaxis2_title="Phase [rad]", ) figures.append(fig) diff --git a/src/qibocal/protocols/characterization/dispersive_shift_qutrit.py b/src/qibocal/protocols/characterization/dispersive_shift_qutrit.py index 1b388d34c..ebeb83a92 100644 --- a/src/qibocal/protocols/characterization/dispersive_shift_qutrit.py +++ b/src/qibocal/protocols/characterization/dispersive_shift_qutrit.py @@ -14,7 +14,6 @@ from qibocal.protocols.characterization.utils import ( GHZ_TO_HZ, HZ_TO_GHZ, - V_TO_UV, lorentzian, lorentzian_fit, table_dict, @@ -139,7 +138,7 @@ def _acquisition( dict( freq=sequence.get_qubit_pulses(qubit).ro_pulses[0].frequency + delta_frequency_range, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, ), ) @@ -193,7 +192,7 @@ def _plot(data: DispersiveShiftQutritData, qubit, fit: DispersiveShiftQutritResu horizontal_spacing=0.1, vertical_spacing=0.1, subplot_titles=( - "MSR (uV)", + "Signal [a.u.]", "phase (rad)", ), ) @@ -220,7 +219,7 @@ def _plot(data: DispersiveShiftQutritData, qubit, fit: DispersiveShiftQutritResu fig.add_trace( go.Scatter( x=frequencies, - y=q_data.msr * V_TO_UV, + y=q_data.signal, opacity=opacity, name=f"{label}", showlegend=True, @@ -288,7 +287,7 @@ def _plot(data: DispersiveShiftQutritData, qubit, fit: DispersiveShiftQutritResu fig.update_layout( showlegend=True, xaxis_title="Frequency (GHz)", - yaxis_title="MSR (uV)", + yaxis_title="Signal [a.u.]", xaxis2_title="Frequency (GHz)", yaxis2_title="Phase (rad)", ) diff --git a/src/qibocal/protocols/characterization/flipping.py b/src/qibocal/protocols/characterization/flipping.py index 054c4ed1b..820321d5b 100644 --- a/src/qibocal/protocols/characterization/flipping.py +++ b/src/qibocal/protocols/characterization/flipping.py @@ -15,8 +15,6 @@ from qibocal.config import log from qibocal.protocols.characterization.utils import table_dict, table_html -from .utils import V_TO_UV - @dataclass class FlippingParameters(Parameters): @@ -40,7 +38,7 @@ class FlippingResults(Results): """Raw fitting output.""" -FlippingType = np.dtype([("flips", np.float64), ("msr", np.float64)]) +FlippingType = np.dtype([("flips", np.float64), ("signal", np.float64)]) @dataclass @@ -75,7 +73,6 @@ def _acquisition( data (:class:`FlippingData`) """ - # create a DataUnits object to store MSR, phase, i, q and the number of flips data = FlippingData( resonator_type=platform.resonator_type, pi_pulse_amplitudes={ @@ -120,7 +117,7 @@ def _acquisition( (qubit), dict( flips=np.array([flips]), - msr=np.array([result.magnitude]), + signal=np.array([result.magnitude]), ), ) @@ -147,7 +144,7 @@ def _fit(data: FlippingData) -> FlippingResults: for qubit in qubits: qubit_data = data[qubit] pi_pulse_amplitude = data.pi_pulse_amplitudes[qubit] - voltages = qubit_data.msr + voltages = qubit_data.signal flips = qubit_data.flips y_min = np.min(voltages) # Guessing period using Fourier transform @@ -225,7 +222,7 @@ def _plot(data: FlippingData, qubit, fit: FlippingResults = None): fig.add_trace( go.Scatter( x=qubit_data.flips, - y=qubit_data.msr * V_TO_UV, + y=qubit_data.signal, opacity=1, name="Voltage", showlegend=True, @@ -271,7 +268,7 @@ def _plot(data: FlippingData, qubit, fit: FlippingResults = None): showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title="Flips (dimensionless)", - yaxis_title="MSR (uV)", + yaxis_title="Signal [a.u.]", ) figures.append(fig) diff --git a/src/qibocal/protocols/characterization/flux_dependence/qubit_crosstalk.py b/src/qibocal/protocols/characterization/flux_dependence/qubit_crosstalk.py index 4bfb7eff4..556d908bc 100644 --- a/src/qibocal/protocols/characterization/flux_dependence/qubit_crosstalk.py +++ b/src/qibocal/protocols/characterization/flux_dependence/qubit_crosstalk.py @@ -42,9 +42,9 @@ class QubitCrosstalkData(QubitFluxData): ) """Raw data acquired for (qubit, qubit_flux) pairs saved in nested dictionaries.""" - def register_qubit(self, qubit, flux_qubit, freq, bias, msr, phase): + def register_qubit(self, qubit, flux_qubit, freq, bias, signal, phase): """Store output for single qubit.""" - ar = utils.create_data_array(freq, bias, msr, phase, dtype=QubitFluxType) + ar = utils.create_data_array(freq, bias, signal, phase, dtype=QubitFluxType) if (qubit, flux_qubit) in self.data: self.data[qubit, flux_qubit] = np.rec.array( np.concatenate((self.data[qubit, flux_qubit], ar)) @@ -144,7 +144,7 @@ def _acquisition( data.register_qubit( qubit, flux_qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + qd_pulses[qubit].frequency, bias=delta_bias_range + sweetspot, diff --git a/src/qibocal/protocols/characterization/flux_dependence/qubit_flux_dependence.py b/src/qibocal/protocols/characterization/flux_dependence/qubit_flux_dependence.py index 61b900ed7..50d882871 100644 --- a/src/qibocal/protocols/characterization/flux_dependence/qubit_flux_dependence.py +++ b/src/qibocal/protocols/characterization/flux_dependence/qubit_flux_dependence.py @@ -61,7 +61,7 @@ class QubitFluxResults(Results): [ ("freq", np.float64), ("bias", np.float64), - ("msr", np.float64), + ("signal", np.float64), ("phase", np.float64), ] ) @@ -85,10 +85,10 @@ class QubitFluxData(Data): data: dict[QubitId, npt.NDArray[QubitFluxType]] = field(default_factory=dict) """Raw data acquired.""" - def register_qubit(self, qubit, freq, bias, msr, phase): + def register_qubit(self, qubit, freq, bias, signal, phase): """Store output for single qubit.""" self.data[qubit] = utils.create_data_array( - freq, bias, msr, phase, dtype=QubitFluxType + freq, bias, signal, phase, dtype=QubitFluxType ) @@ -166,7 +166,7 @@ def _acquisition( sweetspot = qubits[qubit].sweetspot data.register_qubit( qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + qd_pulses[qubit].frequency, bias=delta_bias_range + sweetspot, @@ -205,13 +205,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)] diff --git a/src/qibocal/protocols/characterization/flux_dependence/resonator_crosstalk.py b/src/qibocal/protocols/characterization/flux_dependence/resonator_crosstalk.py index a88a54cda..c14c188e1 100644 --- a/src/qibocal/protocols/characterization/flux_dependence/resonator_crosstalk.py +++ b/src/qibocal/protocols/characterization/flux_dependence/resonator_crosstalk.py @@ -45,9 +45,9 @@ class ResCrosstalkData(ResonatorFluxData): ) """Raw data acquired for (qubit, qubit_flux) pairs saved in nested dictionaries.""" - def register_qubit(self, qubit, flux_qubit, freq, bias, msr, phase): + def register_qubit(self, qubit, flux_qubit, freq, bias, signal, phase): """Store output for single qubit.""" - ar = utils.create_data_array(freq, bias, msr, phase, dtype=ResFluxType) + ar = utils.create_data_array(freq, bias, signal, phase, dtype=ResFluxType) if (qubit, flux_qubit) in self.data: self.data[qubit, flux_qubit] = np.rec.array( np.concatenate((self.data[qubit, flux_qubit], ar)) @@ -134,7 +134,7 @@ def _acquisition( data.register_qubit( qubit, flux_qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + ro_pulses[qubit].frequency, bias=delta_bias_range + sweetspot, diff --git a/src/qibocal/protocols/characterization/flux_dependence/resonator_flux_dependence.py b/src/qibocal/protocols/characterization/flux_dependence/resonator_flux_dependence.py index cbe3d0acf..d2535e684 100644 --- a/src/qibocal/protocols/characterization/flux_dependence/resonator_flux_dependence.py +++ b/src/qibocal/protocols/characterization/flux_dependence/resonator_flux_dependence.py @@ -62,7 +62,7 @@ class ResonatorFluxResults(Results): [ ("freq", np.float64), ("bias", np.float64), - ("msr", np.float64), + ("signal", np.float64), ("phase", np.float64), ] ) @@ -91,10 +91,10 @@ class ResonatorFluxData(Data): data: dict[QubitId, npt.NDArray[ResFluxType]] = field(default_factory=dict) """Raw data acquired.""" - def register_qubit(self, qubit, freq, bias, msr, phase): + def register_qubit(self, qubit, freq, bias, signal, phase): """Store output for single qubit.""" self.data[qubit] = utils.create_data_array( - freq, bias, msr, phase, dtype=ResFluxType + freq, bias, signal, phase, dtype=ResFluxType ) @@ -165,7 +165,7 @@ def _acquisition( sweetspot = qubits[qubit].sweetspot data.register_qubit( qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + ro_pulses[qubit].frequency, bias=delta_bias_range + sweetspot, @@ -223,13 +223,13 @@ def _fit(data: ResonatorFluxData) -> ResonatorFluxResults: biases = qubit_data.bias frequencies = qubit_data.freq - msr = qubit_data.msr + signal = qubit_data.signal if data.resonator_type == "3D": - msr = -msr + signal = -signal frequencies, biases = utils.image_to_curve( - frequencies, biases, msr, msr_mask=0.5 + frequencies, biases, signal, signal_mask=0.5 ) bare_resonator_frequency = data.bare_resonator_frequency[ diff --git a/src/qibocal/protocols/characterization/flux_dependence/utils.py b/src/qibocal/protocols/characterization/flux_dependence/utils.py index 1feb3befb..3169cf0c2 100644 --- a/src/qibocal/protocols/characterization/flux_dependence/utils.py +++ b/src/qibocal/protocols/characterization/flux_dependence/utils.py @@ -4,7 +4,7 @@ from scipy.special import mathieu_a, mathieu_b from sklearn.linear_model import Ridge -from ..utils import GHZ_TO_HZ, HZ_TO_GHZ, V_TO_UV, table_dict, table_html +from ..utils import GHZ_TO_HZ, HZ_TO_GHZ, table_dict, table_html FLUX_PARAMETERS = { "Xi": "Constant to map flux to bias [V]", @@ -33,14 +33,14 @@ def is_crosstalk(data): return all(isinstance(key, tuple) for key in data.data.keys()) -def create_data_array(freq, bias, msr, phase, dtype): +def create_data_array(freq, bias, signal, phase, dtype): """Create custom dtype array for acquired data.""" size = len(freq) * len(bias) ar = np.empty(size, dtype=dtype) frequency, biases = np.meshgrid(freq, bias) ar["freq"] = frequency.ravel() ar["bias"] = biases.ravel() - ar["msr"] = msr.ravel() + ar["signal"] = signal.ravel() ar["phase"] = phase.ravel() return np.rec.array(ar) @@ -53,12 +53,12 @@ def flux_dependence_plot(data, fit, qubit): if not data.__class__.__name__ == "CouplerSpectroscopyData": subplot_titles = ( - "MSR [V]", + "Signal [a.u.]", "Phase [rad]", ) else: subplot_titles = ( - "MSR [V] Qubit" + str(qubit), + "Signal [a.u.] Qubit" + str(qubit), "Phase [rad] Qubit" + str(qubit), ) @@ -70,26 +70,28 @@ def flux_dependence_plot(data, fit, qubit): subplot_titles=subplot_titles, ) frequencies = qubit_data.freq * HZ_TO_GHZ - msr = qubit_data.msr + signal = qubit_data.signal if data.__class__.__name__ == "ResonatorFluxData": - msr_mask = 0.5 + signal_mask = 0.5 if data.resonator_type == "3D": - msr = -msr + signal = -signal elif ( data.__class__.__name__ == "QubitFluxData" or data.__class__.__name__ == "CouplerSpectroscopyData" ): - msr_mask = 0.3 + signal_mask = 0.3 if data.resonator_type == "2D": - msr = -msr + signal = -signal - frequencies1, biases1 = image_to_curve(frequencies, qubit_data.bias, msr, msr_mask) + frequencies1, biases1 = image_to_curve( + frequencies, qubit_data.bias, signal, signal_mask + ) fig.add_trace( go.Heatmap( x=frequencies, y=qubit_data.bias, - z=qubit_data.msr * V_TO_UV, + z=qubit_data.signal, colorbar_x=0.46, ), row=1, @@ -245,19 +247,19 @@ def flux_crosstalk_plot(data, qubit): cols=len(all_qubit_data), horizontal_spacing=0.3 / len(all_qubit_data), vertical_spacing=0.1, - subplot_titles=len(all_qubit_data) * ("MSR [V]",), + subplot_titles=len(all_qubit_data) * ("Signal [a.u.]",), ) for col, (flux_qubit, qubit_data) in enumerate(all_qubit_data.items()): frequencies = qubit_data.freq * HZ_TO_GHZ - msr = qubit_data.msr + signal = qubit_data.signal if data.resonator_type == "2D": - msr = -msr + signal = -signal fig.add_trace( go.Heatmap( x=frequencies, y=qubit_data.bias, - z=qubit_data.msr * V_TO_UV, + z=qubit_data.signal, ), row=1, col=col + 1, @@ -444,14 +446,14 @@ def feature(x, order=3): return np.power(x, np.arange(order + 1).reshape(1, -1)) -def image_to_curve(x, y, z, msr_mask=0.5, alpha=1e-5, order=50): +def image_to_curve(x, y, z, signal_mask=0.5, alpha=1e-5, order=50): """ Extracts a feature characterized by min(z(x, y)). It considers all the data and applies Ridge regression on a polynomial ansatz in x. This allows obtaining a set of points describing the feature as y vs x. Args: x (ndarray) frequencies y (ndarray) bias - z (ndarray) msr + z (ndarray) signal Returns: y_pred (ndarray) frequencies @@ -474,7 +476,7 @@ def image_to_curve(x, y, z, msr_mask=0.5, alpha=1e-5, order=50): znorm = (z - zmin) / (zmax - zmin) # Mask out region - mask = znorm < msr_mask + mask = znorm < signal_mask z = np.argwhere(mask) weights = znorm[mask] / float(znorm.max()) # Column indices diff --git a/src/qibocal/protocols/characterization/qubit_spectroscopy.py b/src/qibocal/protocols/characterization/qubit_spectroscopy.py index a25a134d6..696810550 100644 --- a/src/qibocal/protocols/characterization/qubit_spectroscopy.py +++ b/src/qibocal/protocols/characterization/qubit_spectroscopy.py @@ -101,14 +101,13 @@ def _acquisition( # retrieve the results for every qubit for qubit, ro_pulse in ro_pulses.items(): - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulse.serial] # store the results data.register_qubit( ResSpecType, (qubit), dict( - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + qd_pulses[qubit].frequency, ), diff --git a/src/qibocal/protocols/characterization/qubit_spectroscopy_ef.py b/src/qibocal/protocols/characterization/qubit_spectroscopy_ef.py index f45d3c101..59f9d5f93 100644 --- a/src/qibocal/protocols/characterization/qubit_spectroscopy_ef.py +++ b/src/qibocal/protocols/characterization/qubit_spectroscopy_ef.py @@ -137,14 +137,13 @@ def _acquisition( # retrieve the results for every qubit for qubit, ro_pulse in ro_pulses.items(): - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulse.serial] # store the results data.register_qubit( ResSpecType, (qubit), dict( - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + qd_pulses[qubit].frequency, ), diff --git a/src/qibocal/protocols/characterization/rabi/amplitude_msr.py b/src/qibocal/protocols/characterization/rabi/amplitude_signal.py similarity index 96% rename from src/qibocal/protocols/characterization/rabi/amplitude_msr.py rename to src/qibocal/protocols/characterization/rabi/amplitude_signal.py index ce0b1ca9c..37d7c47ec 100644 --- a/src/qibocal/protocols/characterization/rabi/amplitude_msr.py +++ b/src/qibocal/protocols/characterization/rabi/amplitude_signal.py @@ -32,7 +32,7 @@ class RabiAmplitudeVoltResults(RabiAmplitudeResults): RabiAmpVoltType = np.dtype( - [("amp", np.float64), ("msr", np.float64), ("phase", np.float64)] + [("amp", np.float64), ("signal", np.float64), ("phase", np.float64)] ) """Custom dtype for rabi amplitude.""" @@ -102,7 +102,7 @@ def _acquisition( (qubit), dict( amp=qd_pulses[qubit].amplitude * qd_pulse_amplitude_range, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, ), ) @@ -120,7 +120,7 @@ def _fit(data: RabiAmplitudeVoltData) -> RabiAmplitudeVoltResults: qubit_data = data[qubit] rabi_parameter = qubit_data.amp - voltages = qubit_data.msr + voltages = qubit_data.signal y_min = np.min(voltages) y_max = np.max(voltages) @@ -179,5 +179,5 @@ def _update(results: RabiAmplitudeVoltResults, platform: Platform, qubit: QubitI update.drive_amplitude(results.amplitude[qubit], platform, qubit) -rabi_amplitude_msr = Routine(_acquisition, _fit, _plot, _update) +rabi_amplitude_signal = Routine(_acquisition, _fit, _plot, _update) """RabiAmplitude Routine object.""" diff --git a/src/qibocal/protocols/characterization/rabi/ef.py b/src/qibocal/protocols/characterization/rabi/ef.py index ac632be4a..2bb9b4807 100644 --- a/src/qibocal/protocols/characterization/rabi/ef.py +++ b/src/qibocal/protocols/characterization/rabi/ef.py @@ -10,21 +10,21 @@ from qibocal import update from qibocal.auto.operation import Qubits, Routine -from . import amplitude_msr, utils +from . import amplitude_signal, utils @dataclass -class RabiAmplitudeEFParameters(amplitude_msr.RabiAmplitudeVoltParameters): +class RabiAmplitudeEFParameters(amplitude_signal.RabiAmplitudeVoltParameters): """RabiAmplitudeEF runcard inputs.""" @dataclass -class RabiAmplitudeEFResults(amplitude_msr.RabiAmplitudeVoltResults): +class RabiAmplitudeEFResults(amplitude_signal.RabiAmplitudeVoltResults): """RabiAmplitudeEF outputs.""" @dataclass -class RabiAmplitudeEFData(amplitude_msr.RabiAmplitudeVoltData): +class RabiAmplitudeEFData(amplitude_signal.RabiAmplitudeVoltData): """RabiAmplitude data acquisition.""" @@ -92,11 +92,11 @@ def _acquisition( for qubit in qubits: result = results[ro_pulses[qubit].serial] data.register_qubit( - amplitude_msr.RabiAmpVoltType, + amplitude_signal.RabiAmpVoltType, (qubit), dict( amp=qd_pulses[qubit].amplitude * qd_pulse_amplitude_range, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, ), ) @@ -112,9 +112,9 @@ def _plot(data: RabiAmplitudeEFData, qubit, fit: RabiAmplitudeEFResults = None): def _update(results: RabiAmplitudeEFResults, platform: Platform, qubit: QubitId): - """Update RX2 amplitude_msr""" + """Update RX2 amplitude_signal""" update.drive_12_amplitude(results.amplitude[qubit], platform, qubit) -rabi_amplitude_ef = Routine(_acquisition, amplitude_msr._fit, _plot, _update) +rabi_amplitude_ef = Routine(_acquisition, amplitude_signal._fit, _plot, _update) """RabiAmplitudeEF Routine object.""" diff --git a/src/qibocal/protocols/characterization/rabi/length_sequences.py b/src/qibocal/protocols/characterization/rabi/length_sequences.py index b10399834..1e1bc0aed 100644 --- a/src/qibocal/protocols/characterization/rabi/length_sequences.py +++ b/src/qibocal/protocols/characterization/rabi/length_sequences.py @@ -5,7 +5,7 @@ from qibocal.auto.operation import Qubits, Routine -from .length_msr import ( +from .length_signal import ( RabiLengthVoltData, RabiLengthVoltParameters, RabiLenVoltType, @@ -76,7 +76,7 @@ def _acquisition( (qubit), dict( length=np.array([duration]), - msr=np.array([result.magnitude]), + signal=np.array([result.magnitude]), phase=np.array([result.phase]), ), ) diff --git a/src/qibocal/protocols/characterization/rabi/length_msr.py b/src/qibocal/protocols/characterization/rabi/length_signal.py similarity index 96% rename from src/qibocal/protocols/characterization/rabi/length_msr.py rename to src/qibocal/protocols/characterization/rabi/length_signal.py index 72b30c6ee..d771920ae 100644 --- a/src/qibocal/protocols/characterization/rabi/length_msr.py +++ b/src/qibocal/protocols/characterization/rabi/length_signal.py @@ -32,7 +32,7 @@ class RabiLengthVoltResults(RabiLengthResults): RabiLenVoltType = np.dtype( - [("length", np.float64), ("msr", np.float64), ("phase", np.float64)] + [("length", np.float64), ("signal", np.float64), ("phase", np.float64)] ) """Custom dtype for rabi amplitude.""" @@ -107,7 +107,7 @@ def _acquisition( (qubit), dict( length=qd_pulse_duration_range, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, ), ) @@ -124,7 +124,7 @@ def _fit(data: RabiLengthVoltData) -> RabiLengthVoltResults: for qubit in qubits: qubit_data = data[qubit] rabi_parameter = qubit_data.length - voltages = qubit_data.msr + voltages = qubit_data.signal y_min = np.min(voltages) y_max = np.max(voltages) @@ -182,5 +182,5 @@ def _plot(data: RabiLengthVoltData, fit: RabiLengthVoltResults, qubit): return utils.plot(data, qubit, fit) -rabi_length_msr = Routine(_acquisition, _fit, _plot, _update) +rabi_length_signal = Routine(_acquisition, _fit, _plot, _update) """RabiLength Routine object.""" diff --git a/src/qibocal/protocols/characterization/rabi/utils.py b/src/qibocal/protocols/characterization/rabi/utils.py index 0efda1405..4caa2c293 100644 --- a/src/qibocal/protocols/characterization/rabi/utils.py +++ b/src/qibocal/protocols/characterization/rabi/utils.py @@ -2,7 +2,7 @@ import plotly.graph_objects as go from plotly.subplots import make_subplots -from ..utils import COLORBAND, COLORBAND_LINE, V_TO_UV, table_dict, table_html +from ..utils import COLORBAND, COLORBAND_LINE, table_dict, table_html def rabi_amplitude_fit(x, p0, p1, p2, p3): @@ -44,7 +44,7 @@ def plot(data, qubit, fit): horizontal_spacing=0.1, vertical_spacing=0.1, subplot_titles=( - "MSR (uV)", + "Signal [a.u.]", "phase (rad)", ), ) @@ -55,7 +55,7 @@ def plot(data, qubit, fit): fig.add_trace( go.Scatter( x=rabi_parameters, - y=qubit_data.msr * V_TO_UV, + y=qubit_data.signal, opacity=1, name="Voltage", showlegend=True, @@ -87,7 +87,7 @@ def plot(data, qubit, fit): fig.add_trace( go.Scatter( x=rabi_parameter_range, - y=fitting(rabi_parameter_range, *params) * V_TO_UV, + y=fitting(rabi_parameter_range, *params), name="Fit", line=go.scatter.Line(dash="dot"), marker_color="rgb(255, 130, 67)", @@ -108,7 +108,7 @@ def plot(data, qubit, fit): showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title=title, - yaxis_title="MSR (uV)", + yaxis_title="Signal [a.u.]", xaxis2_title=title, yaxis2_title="Phase (rad)", ) diff --git a/src/qibocal/protocols/characterization/ramsey_sequences.py b/src/qibocal/protocols/characterization/ramsey_sequences.py index 843e34f55..547b97597 100644 --- a/src/qibocal/protocols/characterization/ramsey_sequences.py +++ b/src/qibocal/protocols/characterization/ramsey_sequences.py @@ -43,9 +43,6 @@ def _acquisition( params.delay_between_pulses_step, ) - # create a DataUnits object to store the results, - # DataUnits stores by default MSR, phase, i, q - # additionally include wait time and t_max data = RamseyData( n_osc=params.n_osc, t_max=params.delay_between_pulses_end, diff --git a/src/qibocal/protocols/characterization/ramsey_msr.py b/src/qibocal/protocols/characterization/ramsey_signal.py similarity index 87% rename from src/qibocal/protocols/characterization/ramsey_msr.py rename to src/qibocal/protocols/characterization/ramsey_signal.py index 10e36d183..a201e4784 100644 --- a/src/qibocal/protocols/characterization/ramsey_msr.py +++ b/src/qibocal/protocols/characterization/ramsey_signal.py @@ -20,16 +20,16 @@ fitting, ramsey_fit, ) -from .utils import GHZ_TO_HZ, V_TO_UV, table_dict, table_html +from .utils import GHZ_TO_HZ, table_dict, table_html @dataclass -class RamseyMSRParameters(RamseyParameters): +class RamseySignalParameters(RamseyParameters): """Ramsey runcard inputs.""" @dataclass -class RamseyMSRResults(Results): +class RamseySignalResults(Results): """Ramsey outputs.""" frequency: dict[QubitId, tuple[float, Optional[float]]] @@ -42,21 +42,21 @@ class RamseyMSRResults(Results): """Raw fitting output.""" -RamseyMSRType = np.dtype([("wait", np.float64), ("msr", np.float64)]) +RamseySignalType = np.dtype([("wait", np.float64), ("signal", np.float64)]) """Custom dtype for coherence routines.""" @dataclass -class RamseyMSRData(RamseyData): +class RamseySignalData(RamseyData): """Ramsey acquisition outputs.""" - def register_qubit(self, qubit, wait, msr): + def register_qubit(self, qubit, wait, signal): """Store output for single qubit.""" # to be able to handle the non-sweeper case - shape = (1,) if np.isscalar(msr) else msr.shape - ar = np.empty(shape, dtype=RamseyMSRType) + shape = (1,) if np.isscalar(signal) else signal.shape + ar = np.empty(shape, dtype=RamseySignalType) ar["wait"] = wait - ar["msr"] = msr + ar["signal"] = signal if qubit in self.data: self.data[qubit] = np.rec.array(np.concatenate((self.data[qubit], ar))) else: @@ -72,10 +72,10 @@ def waits(self): def _acquisition( - params: RamseyMSRParameters, + params: RamseySignalParameters, platform: Platform, qubits: Qubits, -) -> RamseyMSRData: +) -> RamseySignalData: """Data acquisition for Ramsey Experiment (detuned).""" # create a sequence of pulses for the experiment # RX90 - t - RX90 - MZ @@ -106,7 +106,7 @@ def _acquisition( params.delay_between_pulses_step, ) - data = RamseyMSRData( + data = RamseySignalData( n_osc=params.n_osc, t_max=params.delay_between_pulses_end, detuning_sign=+1, @@ -138,7 +138,7 @@ def _acquisition( data.register_qubit( qubit, wait=waits, - msr=result.magnitude, + signal=result.magnitude, ) else: @@ -169,12 +169,12 @@ def _acquisition( data.register_qubit( qubit, wait=wait, - msr=result.magnitude, + signal=result.magnitude, ) return data -def _fit(data: RamseyMSRData) -> RamseyMSRResults: +def _fit(data: RamseySignalData) -> RamseySignalResults: r""" Fitting routine for Ramsey experiment. The used model is .. math:: @@ -189,9 +189,9 @@ def _fit(data: RamseyMSRData) -> RamseyMSRResults: for qubit in qubits: qubit_data = data[qubit] qubit_freq = data.qubit_freqs[qubit] - msr = qubit_data["msr"] + signal = qubit_data["signal"] try: - popt, perr = fitting(waits, msr) + popt, perr = fitting(waits, signal) except: popt = POPT_EXCEPTION perr = PERR_EXCEPTION @@ -213,10 +213,10 @@ def _fit(data: RamseyMSRData) -> RamseyMSRResults: popt[2] * GHZ_TO_HZ / (2 * np.pi * data.t_max), ) - return RamseyMSRResults(freq_measure, t2_measure, delta_phys_measure, popts) + return RamseySignalResults(freq_measure, t2_measure, delta_phys_measure, popts) -def _plot(data: RamseyMSRData, qubit, fit: RamseyMSRResults = None): +def _plot(data: RamseySignalData, qubit, fit: RamseySignalResults = None): """Plotting function for Ramsey Experiment.""" figures = [] @@ -225,12 +225,12 @@ def _plot(data: RamseyMSRData, qubit, fit: RamseyMSRResults = None): qubit_data = data.data[qubit] waits = data.waits - msr = qubit_data["msr"] + signal = qubit_data["signal"] fig = go.Figure( [ go.Scatter( x=waits, - y=msr * V_TO_UV, + y=signal, opacity=1, name="Voltage", showlegend=True, @@ -251,8 +251,7 @@ def _plot(data: RamseyMSRData, qubit, fit: RamseyMSRResults = None): float(fit.fitted_parameters[qubit][2]), float(fit.fitted_parameters[qubit][3]), float(fit.fitted_parameters[qubit][4]), - ) - * V_TO_UV, + ), name="Fit", line=go.scatter.Line(dash="dot"), ) @@ -277,7 +276,7 @@ def _plot(data: RamseyMSRData, qubit, fit: RamseyMSRResults = None): showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title="Time (ns)", - yaxis_title="MSR [uV]", + yaxis_title="Signal [a.u.]", ) figures.append(fig) @@ -285,5 +284,5 @@ def _plot(data: RamseyMSRData, qubit, fit: RamseyMSRResults = None): return figures, fitting_report -ramsey_msr = Routine(_acquisition, _fit, _plot, _update) +ramsey_signal = Routine(_acquisition, _fit, _plot, _update) """Ramsey Routine object.""" diff --git a/src/qibocal/protocols/characterization/resonator_punchout.py b/src/qibocal/protocols/characterization/resonator_punchout.py index 773e7fe3e..c6c8b4159 100644 --- a/src/qibocal/protocols/characterization/resonator_punchout.py +++ b/src/qibocal/protocols/characterization/resonator_punchout.py @@ -14,15 +14,7 @@ from qibocal import update from qibocal.auto.operation import Data, Parameters, Qubits, Results, Routine -from .utils import ( - GHZ_TO_HZ, - HZ_TO_GHZ, - V_TO_UV, - fit_punchout, - norm, - table_dict, - table_html, -) +from .utils import GHZ_TO_HZ, HZ_TO_GHZ, fit_punchout, norm, table_dict, table_html @dataclass @@ -59,7 +51,7 @@ class ResonatorPunchoutResults(Results): [ ("freq", np.float64), ("amp", np.float64), - ("msr", np.float64), + ("signal", np.float64), ("phase", np.float64), ] ) @@ -77,14 +69,14 @@ class ResonatorPunchoutData(Data): data: dict[QubitId, npt.NDArray[ResPunchoutType]] = field(default_factory=dict) """Raw data acquired.""" - def register_qubit(self, qubit, freq, amp, msr, phase): + def register_qubit(self, qubit, freq, amp, signal, phase): """Store output for single qubit.""" size = len(freq) * len(amp) frequency, amplitude = np.meshgrid(freq, amp) ar = np.empty(size, dtype=ResPunchoutType) ar["freq"] = frequency.ravel() ar["amp"] = amplitude.ravel() - ar["msr"] = msr.ravel() + ar["signal"] = signal.ravel() ar["phase"] = phase.ravel() self.data[qubit] = np.rec.array(ar) @@ -134,9 +126,6 @@ def _acquisition( type=SweeperType.FACTOR, ) - # create a DataUnits object to store the results, - # DataUnits stores by default MSR, phase, i, q - # additionally include resonator frequency and attenuation data = ResonatorPunchoutData( amplitudes=amplitudes, resonator_type=platform.resonator_type, @@ -156,11 +145,11 @@ def _acquisition( # retrieve the results for every qubit for qubit, ro_pulse in ro_pulses.items(): - # average msr, phase, i and q over the number of shots defined in the runcard + # average signal, phase, i and q over the number of shots defined in the runcard result = results[ro_pulse.serial] data.register_qubit( qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + ro_pulse.frequency, amp=amplitude_range * amplitudes[qubit], @@ -185,7 +174,7 @@ def _plot(data: ResonatorPunchoutData, qubit, fit: ResonatorPunchoutResults = No horizontal_spacing=0.1, vertical_spacing=0.2, subplot_titles=( - "Normalised MSR", + "Normalised Signal [a.u.]", "phase (rad)", ), ) @@ -195,15 +184,15 @@ def _plot(data: ResonatorPunchoutData, qubit, fit: ResonatorPunchoutResults = No n_amps = len(np.unique(qubit_data.amp)) n_freq = len(np.unique(qubit_data.freq)) for i in range(n_amps): - qubit_data.msr[i * n_freq : (i + 1) * n_freq] = norm( - qubit_data.msr[i * n_freq : (i + 1) * n_freq] + qubit_data.signal[i * n_freq : (i + 1) * n_freq] = norm( + qubit_data.signal[i * n_freq : (i + 1) * n_freq] ) fig.add_trace( go.Heatmap( x=frequencies, y=amplitudes, - z=qubit_data.msr * V_TO_UV, + z=qubit_data.signal, colorbar_x=0.46, ), row=1, diff --git a/src/qibocal/protocols/characterization/resonator_punchout_attenuation.py b/src/qibocal/protocols/characterization/resonator_punchout_attenuation.py index 6202c75ba..f3df657e0 100644 --- a/src/qibocal/protocols/characterization/resonator_punchout_attenuation.py +++ b/src/qibocal/protocols/characterization/resonator_punchout_attenuation.py @@ -14,15 +14,7 @@ from qibocal import update from qibocal.auto.operation import Data, Parameters, Qubits, Results, Routine -from .utils import ( - GHZ_TO_HZ, - HZ_TO_GHZ, - V_TO_UV, - fit_punchout, - norm, - table_dict, - table_html, -) +from .utils import GHZ_TO_HZ, HZ_TO_GHZ, fit_punchout, norm, table_dict, table_html @dataclass @@ -57,7 +49,7 @@ class ResonatorPunchoutAttenuationResults(Results): [ ("freq", np.float64), ("att", np.float64), - ("msr", np.float64), + ("signal", np.float64), ("phase", np.float64), ] ) @@ -73,14 +65,14 @@ class ResonatorPunchoutAttenuationData(Data): data: dict[QubitId, npt.NDArray[ResPunchoutAttType]] = field(default_factory=dict) """Raw data acquired.""" - def register_qubit(self, qubit, freq, att, msr, phase): + def register_qubit(self, qubit, freq, att, signal, phase): """Store output for single qubit.""" size = len(freq) * len(att) ar = np.empty(size, dtype=ResPunchoutAttType) frequency, attenuation = np.meshgrid(freq, att) ar["freq"] = frequency.ravel() ar["att"] = attenuation.ravel() - ar["msr"] = msr.ravel() + ar["signal"] = signal.ravel() ar["phase"] = phase.ravel() self.data[qubit] = np.rec.array(ar) @@ -139,11 +131,10 @@ def _acquisition( # retrieve the results for every qubit for qubit in qubits: - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulses[qubit].serial] data.register_qubit( qubit, - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + ro_pulses[qubit].frequency, att=attenuation_range, @@ -180,7 +171,7 @@ def _plot( horizontal_spacing=0.1, vertical_spacing=0.2, subplot_titles=( - "Normalised MSR", + "Normalised Signal [a.u.]", "phase (rad)", ), ) @@ -191,15 +182,15 @@ def _plot( n_att = len(np.unique(qubit_data.att)) n_freq = len(np.unique(qubit_data.freq)) for i in range(n_att): - qubit_data.msr[i * n_freq : (i + 1) * n_freq] = norm( - qubit_data.msr[i * n_freq : (i + 1) * n_freq] + qubit_data.signal[i * n_freq : (i + 1) * n_freq] = norm( + qubit_data.signal[i * n_freq : (i + 1) * n_freq] ) fig.add_trace( go.Heatmap( x=frequencies, y=attenuations, - z=qubit_data.msr * V_TO_UV, + z=qubit_data.signal, colorbar_x=0.46, ), row=1, diff --git a/src/qibocal/protocols/characterization/resonator_spectroscopy.py b/src/qibocal/protocols/characterization/resonator_spectroscopy.py index d748c6787..da78d617b 100644 --- a/src/qibocal/protocols/characterization/resonator_spectroscopy.py +++ b/src/qibocal/protocols/characterization/resonator_spectroscopy.py @@ -58,7 +58,7 @@ class ResonatorSpectroscopyResults(Results): ResSpecType = np.dtype( - [("freq", np.float64), ("msr", np.float64), ("phase", np.float64)] + [("freq", np.float64), ("signal", np.float64), ("phase", np.float64)] ) """Custom dtype for resonator spectroscopy.""" @@ -135,14 +135,13 @@ def _acquisition( # retrieve the results for every qubit for qubit in qubits: - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulses[qubit].serial] # store the results data.register_qubit( ResSpecType, (qubit), dict( - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + ro_pulses[qubit].frequency, ), diff --git a/src/qibocal/protocols/characterization/resonator_spectroscopy_attenuation.py b/src/qibocal/protocols/characterization/resonator_spectroscopy_attenuation.py index 2b2343164..efc457571 100644 --- a/src/qibocal/protocols/characterization/resonator_spectroscopy_attenuation.py +++ b/src/qibocal/protocols/characterization/resonator_spectroscopy_attenuation.py @@ -126,14 +126,13 @@ def _acquisition( # retrieve the results for every qubit for qubit in qubits: - # average msr, phase, i and q over the number of shots defined in the runcard result = results[ro_pulses[qubit].serial] # store the results data.register_qubit( ResSpecType, (qubit), dict( - msr=result.magnitude, + signal=result.magnitude, phase=result.phase, freq=delta_frequency_range + ro_pulses[qubit].frequency, ), diff --git a/src/qibocal/protocols/characterization/signal_experiments/time_of_flight_readout.py b/src/qibocal/protocols/characterization/signal_experiments/time_of_flight_readout.py index aa94c3040..8bc51e8da 100644 --- a/src/qibocal/protocols/characterization/signal_experiments/time_of_flight_readout.py +++ b/src/qibocal/protocols/characterization/signal_experiments/time_of_flight_readout.py @@ -134,7 +134,7 @@ def _plot(data: TimeOfFlightReadoutData, qubit, fit: TimeOfFlightReadoutResults) showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title="Sample", - yaxis_title="MSR (uV)", + yaxis_title="Signal [a.u.]", ) if fit is not None: fig.add_vline( @@ -152,7 +152,7 @@ def _plot(data: TimeOfFlightReadoutData, qubit, fit: TimeOfFlightReadoutResults) showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title="Sample", - yaxis_title="MSR (uV)", + yaxis_title="Signal [a.u.]", ) figures.append(fig) diff --git a/src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py b/src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py index 1a2c9e8b5..f75e96c45 100644 --- a/src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py +++ b/src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py @@ -209,13 +209,13 @@ def _fit(data: ChevronData) -> ChevronResults: times = np.unique(data[pair].length) for qubit in pair: - msr = data[pair].prob_low if pair[0] == qubit else data[pair].prob_high - msr_matrix = msr.reshape(len(times), len(amps)).T + signal = data[pair].prob_low if pair[0] == qubit else data[pair].prob_high + signal_matrix = signal.reshape(len(times), len(amps)).T # guess amplitude computing FFT - amplitude, index, delta = fit_flux_amplitude(msr_matrix, amps, times) + amplitude, index, delta = fit_flux_amplitude(signal_matrix, amps, times) # estimate duration by rabi curve at amplitude previously estimated - y = msr_matrix[index, :].ravel() + y = signal_matrix[index, :].ravel() popt, _ = curve_fit(cos, times, y, p0=[delta, 0, np.mean(y), np.mean(y)]) diff --git a/src/qibocal/protocols/characterization/two_qubit_interaction/cz_virtualz.py b/src/qibocal/protocols/characterization/two_qubit_interaction/cz_virtualz.py index aac273781..e450a57de 100644 --- a/src/qibocal/protocols/characterization/two_qubit_interaction/cz_virtualz.py +++ b/src/qibocal/protocols/characterization/two_qubit_interaction/cz_virtualz.py @@ -379,7 +379,7 @@ def _plot(data: CZVirtualZData, fit: CZVirtualZResults, qubit): uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis1_title="theta [rad] + virtual phase[rad]", xaxis2_title="theta [rad] + virtual phase [rad]", - yaxis_title="MSR[V]", + yaxis_title="Signal [a.u.]", ) fig2.update_layout( @@ -388,7 +388,7 @@ def _plot(data: CZVirtualZData, fit: CZVirtualZResults, qubit): uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis1_title="theta [rad] + virtual phase[rad]", xaxis2_title="theta [rad] + virtual phase[rad]", - yaxis_title="MSR[V]", + yaxis_title="Signal [a.u.]", ) return [fig1, fig2], fitting_report diff --git a/src/qibocal/protocols/characterization/two_qubit_interaction/utils.py b/src/qibocal/protocols/characterization/two_qubit_interaction/utils.py index 41912bd89..89a38c6bb 100644 --- a/src/qibocal/protocols/characterization/two_qubit_interaction/utils.py +++ b/src/qibocal/protocols/characterization/two_qubit_interaction/utils.py @@ -27,7 +27,7 @@ def fit_flux_amplitude(matrix, amps, times): The FFT also gives a first estimate for the duration of the CZ gate. Args: - matrix (np.ndarray): msr matrix + matrix (np.ndarray): signal matrix amps (np.ndarray): amplitudes swept times (np.ndarray): duration swept diff --git a/src/qibocal/protocols/characterization/utils.py b/src/qibocal/protocols/characterization/utils.py index 39f898bff..17a1f355b 100644 --- a/src/qibocal/protocols/characterization/utils.py +++ b/src/qibocal/protocols/characterization/utils.py @@ -63,7 +63,7 @@ def lorentzian(frequency, amplitude, center, sigma, offset): def lorentzian_fit(data, resonator_type=None, fit=None): frequencies = data.freq * HZ_TO_GHZ - voltages = data.msr * V_TO_UV + voltages = data.signal model_Q = lmfit.Model(lorentzian) # Guess parameters for Lorentzian max or min @@ -123,7 +123,7 @@ def spectroscopy_plot(data, qubit, fit: Results = None): fig.add_trace( go.Scatter( x=frequencies, - y=qubit_data.msr * 1e6, + y=qubit_data.signal, opacity=1, name="Frequency", showlegend=True, @@ -198,7 +198,7 @@ def spectroscopy_plot(data, qubit, fit: Results = None): showlegend=True, uirevision="0", # ``uirevision`` allows zooming while live plotting xaxis_title="Frequency (GHz)", - yaxis_title="MSR (uV)", + yaxis_title="Signal [a.u.]", xaxis2_title="Frequency (GHz)", yaxis2_title="Phase (rad)", ) @@ -257,11 +257,11 @@ def fit_punchout(data: Data, fit_type: str): freqs = np.unique(qubit_data.freq) nvalues = len(np.unique(qubit_data[fit_type])) nfreq = len(freqs) - msrs = np.reshape(qubit_data.msr, (nvalues, nfreq)) + signals = np.reshape(qubit_data.signal, (nvalues, nfreq)) if data.resonator_type == "3D": - peak_freqs = freqs[np.argmax(msrs, axis=1)] + peak_freqs = freqs[np.argmax(signals, axis=1)] else: - peak_freqs = freqs[np.argmin(msrs, axis=1)] + peak_freqs = freqs[np.argmin(signals, axis=1)] max_freq = np.max(peak_freqs) min_freq = np.min(peak_freqs) @@ -276,11 +276,15 @@ def fit_punchout(data: Data, fit_type: str): if fit_type == "amp": if data.resonator_type == "3D": ro_val = getattr(qubit_data, fit_type)[ - np.argmax(qubit_data.msr[np.where(qubit_data.freq == freq_lp)[0]]) + np.argmax( + qubit_data.signal[np.where(qubit_data.freq == freq_lp)[0]] + ) ] else: ro_val = getattr(qubit_data, fit_type)[ - np.argmin(qubit_data.msr[np.where(qubit_data.freq == freq_lp)[0]]) + np.argmin( + qubit_data.signal[np.where(qubit_data.freq == freq_lp)[0]] + ) ] else: high_att_max = np.max( diff --git a/tests/runcards/protocols.yml b/tests/runcards/protocols.yml index a82e143de..2b4366b93 100644 --- a/tests/runcards/protocols.yml +++ b/tests/runcards/protocols.yml @@ -234,9 +234,9 @@ actions: step_amp_factor: 0.1 pulse_length: 30 - - id: rabi msr + - id: rabi signal priority: 0 - operation: rabi_amplitude_msr + operation: rabi_amplitude_signal update: false parameters: min_amp_factor: 0.0 @@ -268,9 +268,9 @@ actions: pulse_amplitude: 0.5 nshots: 1024 - - id: rabi length msr + - id: rabi length signal priority: 0 - operation: rabi_length_msr + operation: rabi_length_signal parameters: pulse_duration_start: 4 pulse_duration_end: 84 @@ -297,9 +297,9 @@ actions: delay_before_readout_step: 2000 nshots: 1024 - - id: t1_msr + - id: t1_signal priority: 0 - operation: t1_msr + operation: t1_signal parameters: delay_before_readout_start: 0 delay_before_readout_end: 20_000 @@ -322,9 +322,9 @@ actions: readouts: 10 nshots: 10 - - id: zeno_msr + - id: zeno_signal priority: 00 - operation: zeno_msr + operation: zeno_signal parameters: readouts: 10 nshots: 10 @@ -338,9 +338,9 @@ actions: delay_between_pulses_step: 100 nshots: 10 - - id: t2_msr + - id: t2_signal priority: 0 - operation: t2_msr + operation: t2_signal parameters: delay_between_pulses_start: 16 delay_between_pulses_end: 20000 @@ -366,9 +366,9 @@ actions: n_osc: 2 nshots: 10 - - id: ramsey_msr + - id: ramsey_signal priority: 0 - operation: ramsey_msr + operation: ramsey_signal parameters: delay_between_pulses_start: 0 delay_between_pulses_end: 50 @@ -376,9 +376,9 @@ actions: n_osc: 2 nshots: 10 - - id: ramsey_msr_detuned + - id: ramsey_signal_detuned priority: 0 - operation: ramsey_msr + operation: ramsey_signal parameters: delay_between_pulses_start: 0 delay_between_pulses_end: 50 @@ -461,9 +461,9 @@ actions: delay_between_pulses_step: 1 nshots: 10 - - id: spin_echo_msr + - id: spin_echo_sequence priority: 0 - operation: spin_echo_msr + operation: spin_echo_sequence parameters: delay_between_pulses_start: 0 delay_between_pulses_end: 5