def split(mat): 
    """ 
    Splits a given matrix into quarters. 
    Input: nxn matrix 
    Output: tuple containing 4 n/2 x n/2 matrices corresponding to a11, a12, a21, a22
    """
    row, col = mat.shape 
    row2, col2 = row // 2, col // 2
    return mat[:row2,:col2], mat[:row2,col2:], mat[row2:,:col2], mat[row2:,col2:]