Quanlse/QWaveform.py
def appendWave(self, operators: Union[QOperator, Callable, List[QOperator], List[Callable]] = None,
                   onSubSys: Union[int, List[int]] = None, waves: Union[QWaveform, List[QWaveform]] = None,
                   strength: Union[int, float] = 1.0, freq: Optional[Union[int, float]] = None,
                   phase: Optional[Union[int, float]] = None, phase0: Optional[Union[int, float]] = None,
                   name: str = None, tag: str = None, shift: float = 0.0, compact: bool = True):
        """
        This method appends control terms and waveforms to a QJob object. Unlike `addWave()`, this function will append
        the waveform in the end of the existing waveforms, hence ignore the `t0` parameter of rhe `QWaveform` object.

        :param operators: wave operator
        :param onSubSys: what subsystem the wave is acting upon
        :param waves: a QWaveform object
        :param strength: wave strength
        :param freq: wave frequency shift
        :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)
        :param name: a user-given name to the wave
        :param tag: wave tag indicating purpose
        :param shift: time shift of the added wave
        :param compact: the added wave will be left aligned in specified control terms if True.
        :return: None
        """
        # When searching for the waves, we do not filter the waves by the tags.
        wavesDict = self.searchWave(operators, onSubSys, names=name)
        maxTime = 0.
        if compact:
            # When compact is True, the wave will be appended to the final time of the existed waves from the
            #     specific control term.
            for waveKey in wavesDict.keys():
                if len(wavesDict[waveKey]) > 0:
                    for waveform in wavesDict[waveKey]:
                        if waveform.flag & QWAVEFORM_FLAG_ALWAYS_ON > 0:
                            continue
                        if waveform.seq is not None:
                            finalNs = waveform.t0 + len(waveform.seq) * self.dt
                        else:
                            finalNs = waveform.t0 + waveform.t
                        if maxTime < finalNs:
                            maxTime = finalNs
        else:
            # When compact is False, the wave will the appended to the final time of all existed waves of all
            #     control terms.
            maxTime, _ = self.computeMaxTime()

        # Finally, the start time of the appended wave is the maxTime plus the time shift value.
        t0 = maxTime + shift
        self.addWave(operators, onSubSys, waves, t0, strength, freq, phase, phase0, name, tag, None)

        This method appends control terms and waveforms to a QJob object. Unlike `addWave()`, this function will append
        the waveform in the end of the existing waveforms, hence ignore the `t0` parameter of rhe `QWaveform` object.

        :param operators: wave operator
        :param onSubSys: what subsystem the wave is acting upon
        :param waves: a QWaveform object
        :param strength: wave strength
        :param freq: wave frequency shift
        :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)
        :param name: a user-given name to the wave
        :param tag: wave tag indicating purpose
        :param shift: time shift of the added wave
        :param compact: the added wave will be left aligned in specified control terms if True.
        :return: None
        
This method appends control terms and waveforms to a QJob object.
This method appends control terms and waveforms to a QJob object .
def appendWave(self, operators: Union[QOperator, Callable, List[QOperator], List[Callable]] = None,
                   onSubSys: Union[int, List[int]] = None, waves: Union[QWaveform, List[QWaveform]] = None,
                   strength: Union[int, float] = 1.0, freq: Optional[Union[int, float]] = None,
                   phase: Optional[Union[int, float]] = None, phase0: Optional[Union[int, float]] = None,
                   name: str = None, tag: str = None, shift: float = 0.0, compact: bool = True):
        wavesDict = self.searchWave(operators, onSubSys, names=name)
        maxTime = 0.
        if compact:
            for waveKey in wavesDict.keys():
                if len(wavesDict[waveKey]) > 0:
                    for waveform in wavesDict[waveKey]:
                        if waveform.flag & QWAVEFORM_FLAG_ALWAYS_ON > 0:
                            continue
                        if waveform.seq is not None:
                            finalNs = waveform.t0 + len(waveform.seq) * self.dt
                        else:
                            finalNs = waveform.t0 + waveform.t
                        if maxTime < finalNs:
                            maxTime = finalNs
        else:
            maxTime, _ = self.computeMaxTime()
        t0 = maxTime + shift
        self.addWave(operators, onSubSys, waves, t0, strength, freq, phase, phase0, name, tag, None)
def appendWave ( self , operators : Union [ QOperator , Callable , List [ QOperator ] , List [ Callable ] ] = None , onSubSys : Union [ int , List [ int ] ] = None , waves : Union [ QWaveform , List [ QWaveform ] ] = None , strength : Union [ int , float ] = 1.0 , freq : Optional [ Union [ int , float ] ] = None , phase : Optional [ Union [ int , float ] ] = None , phase0 : Optional [ Union [ int , float ] ] = None , name : str = None , tag : str = None , shift : float = 0.0 , compact : bool = True ) : wavesDict = self . searchWave ( operators , onSubSys , names = name ) maxTime = 0. if compact : for waveKey in wavesDict . keys ( ) : if len ( wavesDict [ waveKey ] ) > 0 : for waveform in wavesDict [ waveKey ] : if waveform . flag & QWAVEFORM_FLAG_ALWAYS_ON > 0 : continue if waveform . seq is not None : finalNs = waveform . t0 + len ( waveform . seq ) * self . dt else : finalNs = waveform . t0 + waveform . t if maxTime < finalNs : maxTime = finalNs else : maxTime , _ = self . computeMaxTime ( ) t0 = maxTime + shift self . addWave ( operators , onSubSys , waves , t0 , strength , freq , phase , phase0 , name , tag , None )
This method appends control terms and waveforms to a QJob object.
This method appends control terms and waveforms to a QJob object .
"""
        This method appends control terms and waveforms to a QJob object. Unlike `addWave()`, this function will append
        the waveform in the end of the existing waveforms, hence ignore the `t0` parameter of rhe `QWaveform` object.

        :param operators: wave operator
        :param onSubSys: what subsystem the wave is acting upon
        :param waves: a QWaveform object
        :param strength: wave strength
        :param freq: wave frequency shift
        :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)
        :param name: a user-given name to the wave
        :param tag: wave tag indicating purpose
        :param shift: time shift of the added wave
        :param compact: the added wave will be left aligned in specified control terms if True.
        :return: None
        """ # When searching for the waves, we do not filter the waves by the tags. # When compact is True, the wave will be appended to the final time of the existed waves from the #     specific control term. # When compact is False, the wave will the appended to the final time of all existed waves of all #     control terms. # Finally, the start time of the appended wave is the maxTime plus the time shift value.
None
self
operators
Union[QOperator, Callable, List[QOperator], List[Callable]]
None
onSubSys
Union[int, List[int]]
None
waves
Union[QWaveform, List[QWaveform]]
a QWaveform object
a QWaveform object
strength
Union[int, float]
None
freq
Optional[Union[int, float]]
wave frequency shift
wave frequency shift
phase
Optional[Union[int, float]]
pulse phase shift (will accumulate during the entire pulse execution)
pulse phase shift ( will accumulate during the entire pulse execution )
phase0
Optional[Union[int, float]]
pulse phase shift (will not accumulate during the entire pulse execution)
pulse phase shift ( will not accumulate during the entire pulse execution )
name
str
a user-given name to the wave
a user - given name to the wave
tag
str
wave tag indicating purpose
wave tag indicating purpose
shift
float
time shift of the added wave
time shift of the added wave
compact
bool
the added wave will be left aligned in specified control terms if True.
the added wave will be left aligned in specified control terms if True .