Quanlse/QHamiltonian.py
def buildCollapseCache(self) -> None:
        r"""
        Generate and save the cache of the collapse operators.

        :return: None
        """

        levelList = []

        if isinstance(self.sysLevel, list):
            levelList = self.sysLevel

        elif isinstance(self.sysLevel, int):
            levelList = [self.sysLevel for _ in range(self.subSysNum)]

        cList = self._collapseList

        cacheList = []

        for index, operators in cList.items():
            matList = [identity(level) for level in levelList]

            for operator in operators:
                matList[index] = operator
                mat = tensor(matList)
                cacheList.append(mat)

        self._collapseOperators = cacheList
r"""
        Generate and save the cache of the collapse operators.

        :return: None
        
r"""
Generate and save the cache of the collapse operators.
r " " " Generate and save the cache of the collapse operators .
def buildCollapseCache(self) -> None:
        levelList = []
        if isinstance(self.sysLevel, list):
            levelList = self.sysLevel
        elif isinstance(self.sysLevel, int):
            levelList = [self.sysLevel for _ in range(self.subSysNum)]
        cList = self._collapseList
        cacheList = []
        for index, operators in cList.items():
            matList = [identity(level) for level in levelList]
            for operator in operators:
                matList[index] = operator
                mat = tensor(matList)
                cacheList.append(mat)
        self._collapseOperators = cacheList
def buildCollapseCache ( self ) -> None : levelList = [ ] if isinstance ( self . sysLevel , list ) : levelList = self . sysLevel elif isinstance ( self . sysLevel , int ) : levelList = [ self . sysLevel for _ in range ( self . subSysNum ) ] cList = self . _collapseList cacheList = [ ] for index , operators in cList . items ( ) : matList = [ identity ( level ) for level in levelList ] for operator in operators : matList [ index ] = operator mat = tensor ( matList ) cacheList . append ( mat ) self . _collapseOperators = cacheList
r"""
Generate and save the cache of the collapse operators.
r " " " Generate and save the cache of the collapse operators .
r"""
        Generate and save the cache of the collapse operators.

        :return: None
        """
None
self