def METHOD_NAME(a: np.ndarray, b: np.ndarray) -> np.ndarray:
    """Calculate the square distance between `a` and `b`. 
    Args:
        a: a matrix with dimension D x N
        b: a matrix with dimension D x N
    Returns:
        A numeric value for the difference between a and b. 
    """
    aa = np.sum(a ** 2, axis=0)
    bb = np.sum(b ** 2, axis=0)
    ab = a.T.dot(b)
    aa_repmat = matlib.repmat(aa[:, None], 1, b.shape[1])
    bb_repmat = matlib.repmat(bb[None, :], a.shape[1], 1)
    dist = abs(aa_repmat + bb_repmat - 2 * ab)
    return dist