Skip to content

Commit

Permalink
change envelop from Custom to Rectangular
Browse files Browse the repository at this point in the history
  • Loading branch information
ElStabilini committed Jan 17, 2025
1 parent b2fffa5 commit b46680e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/qibocal/protocols/two_qubit_interaction/cryoscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from qibolab import (
AcquisitionType,
AveragingMode,
Custom,
Delay,
Platform,
Pulse,
PulseSequence,
Rectangular,
)
from scipy.optimize import least_squares
from scipy.signal import lfilter, lfilter_zi
Expand All @@ -24,12 +24,12 @@
from qibocal.protocols.ramsey.utils import fitting
from qibocal.protocols.utils import table_dict, table_html

FULL_WAVEFORM = np.concatenate([np.zeros(10), np.ones(90)])
"""Full waveform to be played."""
START = 10
"""Flux pulse start"""
# FULL_WAVEFORM = np.concatenate([np.zeros(10), np.ones(90)])
# """Full waveform to be played."""
# START = 10
# """Flux pulse start"""
SAMPLING_RATE = 1
"""Instrument sampling rate in GHz""" # CONTROLLARE UNITA' DI MISURA
"""Instrument sampling rate in GSamples"""


@dataclass
Expand Down Expand Up @@ -96,7 +96,7 @@ def generate_sequences(
flux_pulse = Pulse(
duration=duration,
amplitude=params.flux_pulse_amplitude,
envelope=Custom(i_=FULL_WAVEFORM[:duration], q_=np.zeros(duration)),
envelope=Rectangular(), # =Custom(i_=FULL_WAVEFORM[:duration], q_=np.zeros(duration)),
)

# create the sequences
Expand Down Expand Up @@ -247,9 +247,10 @@ def _acquisition(


def residuals(params, step_response, t):
start = 0
g, tau, exp_amplitude = params
expmodel = step_response / (g * (1 + exp_amplitude * np.exp(-(t - START) / tau)))
return expmodel - FULL_WAVEFORM[: len(t)]
expmodel = step_response / (g * (1 + exp_amplitude * np.exp(-(t - start) / tau)))
return expmodel - np.ones(len(t))


def exponential_params(step_response, acquisition_time):
Expand Down Expand Up @@ -400,7 +401,7 @@ def _plot(data: CryoscopeData, fit: CryoscopeResults, target: QubitId):
fig.add_trace(
go.Scatter(
x=duration,
y=FULL_WAVEFORM,
y=np.ones(len(duration)),
name="exepcted waveform",
),
)
Expand Down

0 comments on commit b46680e

Please sign in to comment.