Quanlse/QWaveform.py
def quasiSquareErf(t: Union[int, float], a: float, l: float, r: float, sk: float = None, t0: Union[int, float] = 0.,
                   freq: float = None, phase: float = None, phase0: float = None) -> QWaveform:
    """
    Return the sample pulse with a quasi-square envelope.

    :param t: pulse duration
    :param a: pulse amplitude
    :param l: quasiSquare wave function parameter
    :param r: quasiSquare wave function parameter
    :param sk: quasiSquare wave function parameter
    :param t0: pulse start time
    :param freq: pulse frequency shift shift (will not accumulate during the entire pulse execution)
    :param phase: pulse phase shift (will accumulate during the entire pulse execution)
    :param phase0: pulse phase shift (will not accumulate during the entire pulse execution)
    :return: returned quasi square QWaveform object
    """

    def func(_t, args):
        """ The quasi square error function """
        _a, _l, _r, _sk = args
        if _sk is None:
            _sk = _a * 0.3
        if _a == 0.0:
            return 0.0
        t1i = _l
        t2i = _r
        pulse = 0.25 * _a * (1 + erf(sqrt(pi) * _sk / _a * (_t - t1i)))
        pulse = pulse * (1 - erf(sqrt(pi) * _sk / _a * (_t - t2i)))
        return pulse

    wave = QWaveform(f=func, t0=t0, t=t, args=(a, l, r, sk), freq=freq, phase=phase, phase0=phase0)
    wave.name = "quasi_square_erf"
    return wave

    Return the sample pulse with a quasi-square envelope.

    :param t: pulse duration
    :param a: pulse amplitude
    :param l: quasiSquare wave function parameter
    :param r: quasiSquare wave function parameter
    :param sk: quasiSquare wave function parameter
    :param t0: pulse start time
    :param freq: pulse frequency shift shift (will not accumulate during the entire pulse execution)
    :param phase: pulse phase shift (will accumulate during the entire pulse execution)
    :param phase0: pulse phase shift (will not accumulate during the entire pulse execution)
    :return: returned quasi square QWaveform object
    
Return the sample pulse with a quasi-square envelope.
Return the sample pulse with a quasi - square envelope .
def quasiSquareErf(t: Union[int, float], a: float, l: float, r: float, sk: float = None, t0: Union[int, float] = 0.,
                   freq: float = None, phase: float = None, phase0: float = None) -> QWaveform:
    def func(_t, args):
        _a, _l, _r, _sk = args
        if _sk is None:
            _sk = _a * 0.3
        if _a == 0.0:
            return 0.0
        t1i = _l
        t2i = _r
        pulse = 0.25 * _a * (1 + erf(sqrt(pi) * _sk / _a * (_t - t1i)))
        pulse = pulse * (1 - erf(sqrt(pi) * _sk / _a * (_t - t2i)))
        return pulse
    wave = QWaveform(f=func, t0=t0, t=t, args=(a, l, r, sk), freq=freq, phase=phase, phase0=phase0)
    wave.name = "quasi_square_erf"
    return wave
def quasiSquareErf ( t : Union [ int , float ] , a : float , l : float , r : float , sk : float = None , t0 : Union [ int , float ] = 0. , freq : float = None , phase : float = None , phase0 : float = None ) -> QWaveform : def func ( _t , args ) : """ The quasi square error function """ _a , _l , _r , _sk = args if _sk is None : _sk = _a * 0.3 if _a == 0.0 : return 0.0 t1i = _l t2i = _r pulse = 0.25 * _a * ( 1 + erf ( sqrt ( pi ) * _sk / _a * ( _t - t1i ) ) ) pulse = pulse * ( 1 - erf ( sqrt ( pi ) * _sk / _a * ( _t - t2i ) ) ) return pulse wave = QWaveform ( f = func , t0 = t0 , t = t , args = ( a , l , r , sk ) , freq = freq , phase = phase , phase0 = phase0 ) wave . name = "quasi_square_erf" return wave
Return the sample pulse with a quasi-square envelope.
Return the sample pulse with a quasi - square envelope .
"""
    Return the sample pulse with a quasi-square envelope.

    :param t: pulse duration
    :param a: pulse amplitude
    :param l: quasiSquare wave function parameter
    :param r: quasiSquare wave function parameter
    :param sk: quasiSquare wave function parameter
    :param t0: pulse start time
    :param freq: pulse frequency shift shift (will not accumulate during the entire pulse execution)
    :param phase: pulse phase shift (will accumulate during the entire pulse execution)
    :param phase0: pulse phase shift (will not accumulate during the entire pulse execution)
    :return: returned quasi square QWaveform object
    """ """ The quasi square error function """
returned quasi square QWaveform object
returned quasi square QWaveform object
t
Union[int, float]
None
a
float
None
l
float
quasiSquare wave function parameter
quasiSquare wave function parameter
r
float
quasiSquare wave function parameter
quasiSquare wave function parameter
sk
float
quasiSquare wave function parameter
quasiSquare wave function parameter
t0
Union[int, float]
pulse start time
pulse start time
freq
float
pulse frequency shift shift (will not accumulate during the entire pulse execution)
pulse frequency shift shift ( will not accumulate during the entire pulse execution )
phase
float
pulse phase shift (will accumulate during the entire pulse execution)
pulse phase shift ( will accumulate during the entire pulse execution )
phase0
float
pulse phase shift (will not accumulate during the entire pulse execution)
pulse phase shift ( will not accumulate during the entire pulse execution )