code: def as_2d(self):
          
          if not self.isdiagonal:
              return self.x
          return np.diag(self.x.flatten())
docs: get a 2D representation of x.  If not self.isdiagonal, simply
          return reference to self.x, otherwise, constructs and returns
          a 2D, diagonal ndarray
  
          Returns
          -------
          numpy.ndarray : numpy.ndarray