import sympy


def rref (A):
    """Compute the reduced row echelon for the matrix A. Returns
    returns a tuple of two elements. The first is the reduced row
    echelon form, and the second is a list of indices of the pivot columns.
    """
    m = sympy.Matrix (A)
    return m.rref()