Skip to content

SNZ waveform generation function misunderstands `amp_B`

When I was trying to perform calibrating SNZ CZ by sweeping amp_B, I found the waveform generation result is wrong,

numerical representation

graphical representation

where the first arm's stop amplitude is not amp_A * amp_B, but amp_A * (1 - amp_B).


As I step into the sudden_net_zero, I found that this bug originates from the closure function _square.

def _square(t, start: float, stop: float, start_amp=1, stop_amp=0):
    """square pulses with a start and stop using a heaviside function."""
    return np.heaviside(
        np.around(t - start, decimals=12), start_amp
    ) - np.heaviside(np.around(t - stop, decimals=12), stop_amp)

At the stop timing, the amplitude is start_amp - stop_amp, which deviates from the definition of _square.