Quanlse/QWaveform.py
def waveFunctionToSequence(self, dt: float, maxEndTime: float = None) -> 'QWaveform':
        """
        Transform the function in QWaveform object to a sequence.

        :param dt: AWG sampling time
        :param maxEndTime: maximum ending time
        :return: returned QWaveform object
        """

        if self.func is not None:
            if dt is not None:
                _dt = dt
            elif self.dt is not None:
                _dt = self.dt
            else:
                raise Error.ArgumentError("Argument dt is not specified, please input dt.")
            seqList = []
            # QWAVEFORM_FLAG_ALWAYS_ON flag
            if self.flag & QWAVEFORM_FLAG_ALWAYS_ON:
                if maxEndTime is None:
                    print("Warning: QWaveform object with QWAVEFORM_FLAG_ALWAYS_ON flag"
                          " will become useless after serialization. You can input maxE"
                          "ndTime to serialize this object.")
                    endTimeDt = 0
                else:
                    endTimeDt = int(maxEndTime / _dt)
            else:
                endTimeDt = int(self.t / _dt)
            # Generate sequence
            for nowDt in range(endTimeDt):
                nowNs = nowDt * dt + _dt / 2
                seqList.append(self(nowNs))
            wave = sequence(t0=self.t0, seq=seqList, freq=self.freq, phase=self.phase)
            wave.tag = self.tag
            wave.flag = self.flag
            wave.dt = _dt
            return wave
        elif self.seq is not None:
            return copy.deepcopy(self)

        Transform the function in QWaveform object to a sequence.

        :param dt: AWG sampling time
        :param maxEndTime: maximum ending time
        :return: returned QWaveform object
        
Transform the function in QWaveform object to a sequence.
Transform the function in QWaveform object to a sequence .
def waveFunctionToSequence(self, dt: float, maxEndTime: float = None) -> 'QWaveform':
        if self.func is not None:
            if dt is not None:
                _dt = dt
            elif self.dt is not None:
                _dt = self.dt
            else:
                raise Error.ArgumentError("Argument dt is not specified, please input dt.")
            seqList = []
            if self.flag & QWAVEFORM_FLAG_ALWAYS_ON:
                if maxEndTime is None:
                    print("Warning: QWaveform object with QWAVEFORM_FLAG_ALWAYS_ON flag"
                          " will become useless after serialization. You can input maxE"
                          "ndTime to serialize this object.")
                    endTimeDt = 0
                else:
                    endTimeDt = int(maxEndTime / _dt)
            else:
                endTimeDt = int(self.t / _dt)
            for nowDt in range(endTimeDt):
                nowNs = nowDt * dt + _dt / 2
                seqList.append(self(nowNs))
            wave = sequence(t0=self.t0, seq=seqList, freq=self.freq, phase=self.phase)
            wave.tag = self.tag
            wave.flag = self.flag
            wave.dt = _dt
            return wave
        elif self.seq is not None:
            return copy.deepcopy(self)
def waveFunctionToSequence ( self , dt : float , maxEndTime : float = None ) -> 'QWaveform' : if self . func is not None : if dt is not None : _dt = dt elif self . dt is not None : _dt = self . dt else : raise Error . ArgumentError ( "Argument dt is not specified, please input dt." ) seqList = [ ] if self . flag & QWAVEFORM_FLAG_ALWAYS_ON : if maxEndTime is None : print ( "Warning: QWaveform object with QWAVEFORM_FLAG_ALWAYS_ON flag" " will become useless after serialization. You can input maxE" "ndTime to serialize this object." ) endTimeDt = 0 else : endTimeDt = int ( maxEndTime / _dt ) else : endTimeDt = int ( self . t / _dt ) for nowDt in range ( endTimeDt ) : nowNs = nowDt * dt + _dt / 2 seqList . append ( self ( nowNs ) ) wave = sequence ( t0 = self . t0 , seq = seqList , freq = self . freq , phase = self . phase ) wave . tag = self . tag wave . flag = self . flag wave . dt = _dt return wave elif self . seq is not None : return copy . deepcopy ( self )
Transform the function in QWaveform object to a sequence.
Transform the function in QWaveform object to a sequence .
"""
        Transform the function in QWaveform object to a sequence.

        :param dt: AWG sampling time
        :param maxEndTime: maximum ending time
        :return: returned QWaveform object
        """ # QWAVEFORM_FLAG_ALWAYS_ON flag # Generate sequence
returned QWaveform object
returned QWaveform object
self
dt
float
AWG sampling time
AWG sampling time
maxEndTime
float
maximum ending time
maximum ending time