def success_probability_to_polarization(s, n):
    """
    Maps a success probablity s for an n-qubit circuit to
    the polarization, defined by p = (s - 1/2^n)/(1 - 1/2^n)
    """
    return (s - 1 / 2**n) / (1 - 1 / 2**n)