Quanlse/QHamiltonian.py
def verifyWaveListObj(self, waveJob: QJob) -> bool:
        """
        Check whether the QWaveList object is valid for this QHam object.

        :param waveJob: QWaveList to be checked
        :return: true of false indicating its validity
        """
        for key in waveJob.ctrlOperators.keys():
            if isinstance(waveJob.ctrlOperators[key], list):
                ops = waveJob.ctrlOperators[key]
            elif isinstance(waveJob.ctrlOperators[key], QOperator):
                ops = [waveJob.ctrlOperators[key]]
            else:
                raise Error.ArgumentError("The input QWaveList object is invalid!")
            # Check every operator
            for op in ops:
                if op.onSubSys >= self._subSysNum:
                    return False
                if isinstance(self._sysLevel, int):
                    if max(op.matrix.shape) > self._sysLevel:
                        return False
                else:
                    if max(op.matrix.shape) > self._sysLevel[op.onSubSys]:
                        return False
        return True

        Check whether the QWaveList object is valid for this QHam object.

        :param waveJob: QWaveList to be checked
        :return: true of false indicating its validity
        
Check whether the QWaveList object is valid for this QHam object.
Check whether the QWaveList object is valid for this QHam object .
def verifyWaveListObj(self, waveJob: QJob) -> bool:
        for key in waveJob.ctrlOperators.keys():
            if isinstance(waveJob.ctrlOperators[key], list):
                ops = waveJob.ctrlOperators[key]
            elif isinstance(waveJob.ctrlOperators[key], QOperator):
                ops = [waveJob.ctrlOperators[key]]
            else:
                raise Error.ArgumentError("The input QWaveList object is invalid!")
            for op in ops:
                if op.onSubSys >= self._subSysNum:
                    return False
                if isinstance(self._sysLevel, int):
                    if max(op.matrix.shape) > self._sysLevel:
                        return False
                else:
                    if max(op.matrix.shape) > self._sysLevel[op.onSubSys]:
                        return False
        return True
def verifyWaveListObj ( self , waveJob : QJob ) -> bool : for key in waveJob . ctrlOperators . keys ( ) : if isinstance ( waveJob . ctrlOperators [ key ] , list ) : ops = waveJob . ctrlOperators [ key ] elif isinstance ( waveJob . ctrlOperators [ key ] , QOperator ) : ops = [ waveJob . ctrlOperators [ key ] ] else : raise Error . ArgumentError ( "The input QWaveList object is invalid!" ) for op in ops : if op . onSubSys >= self . _subSysNum : return False if isinstance ( self . _sysLevel , int ) : if max ( op . matrix . shape ) > self . _sysLevel : return False else : if max ( op . matrix . shape ) > self . _sysLevel [ op . onSubSys ] : return False return True
Check whether the QWaveList object is valid for this QHam object.
Check whether the QWaveList object is valid for this QHam object .
"""
        Check whether the QWaveList object is valid for this QHam object.

        :param waveJob: QWaveList to be checked
        :return: true of false indicating its validity
        """ # Check every operator
true of false indicating its validity
true of false indicating its validity
self
waveJob
QJob
QWaveList to be checked
QWaveList to be checked