code: def cut_matrix(self, n):
          
          cm = np.zeros((n, n))
  
          for part in self.partition:
              from_, to = self.direction.order(part.mechanism, part.purview)
              # All indices external to this part
              external = tuple(set(self.indices) - set(to))
              cm[np.ix_(from_, external)] = 1
  
          return cm
docs: The matrix of connections that are severed by this cut.