code: def restrict(self, index_array):
          
          new_shape = index_array.shape[0], index_array.shape[0]
          return OnFlySymMatrix(self.get_row, new_shape, DC_start=self.DC_start,
                                DC_end=self.DC_end,
                                rows=self.rows, restrict_array=index_array)
docs: Generate a view restricted to a subset of indices.