docs: def getTransitionMatrix(self,probabilities=True):
          """
          If self.P has been given already, we will reuse it and convert it to a sparse csr matrix if needed.
          Otherwise, we will generate it using the direct or indirect method.         
          Since most solution methods use a probability matrix, this is the default setting. 
          By setting probabilities=False we can also return a rate matrix.
          """
          if self.P is not None:               
              if isspmatrix(self.P): 
                  if not isspmatrix_csr(self.P):
                      self.P = self.P.tocsr() 
              else:
                  assert isinstance(self.P, np.ndarray) and self.P.ndim==2 and self.P.shape[0]==self.P.shape[1],'P needs to be a 2d numpy array with an equal number of columns and rows'                     
                  self.P = csr_matrix(self.P)   
                  
          elif self.direct == True:
              self.P = self.directInitialMatrix()
              
          else:
              self.P = self.indirectInitialMatrix(self.initialState)   
  
          if probabilities:    
              P = self.convertToProbabilityMatrix(self.P)
          else: 
              P = self.convertToRateMatrix(self.P)   
          
          return P