code: def blockcirculant(A):
      
  
      r, c = A[0].shape
      B = np.zeros((len(A) * r, len(A) * c), dtype=A[0].dtype)
      for k in range(len(A)):
          for l in range(len(A)):
              kl = np.mod(k + l, len(A))
              B[r*kl:r*(kl + 1), c*k:c*(k + 1)] = A[l]
      return B
docs: Construct a block circulant matrix from a tuple of arrays. This is a
      block-matrix variant of :func:`scipy.linalg.circulant`.
  
      Parameters
      ----------
      A : tuple of array_like
        Tuple of arrays corresponding to the first block column of the output
        block matrix
  
      Returns
      -------
      B : ndarray
        Output array