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.
    """

    # We import sympy here because it is slow to load and would slow down the initial
    # start up of tellurium
    m = sympy.Matrix(A)
    return m.rref()