def transform_pauli_moments_to_bit(mean_p, var_p):
    """
    Changes the first of a Pauli operator to the moments of a bit (a Bernoulli process).

    E.g. if the original mean is on [-1, +1] the returned mean is on [0, 1].

    :param mean_p: mean of some Pauli operator
    :param var_p: variance of a Pauli operator
    :return: bit mean and variance.
    """
    mean_out = (mean_p + 1) / 2
    var_out = var_p / 4
    return mean_out, var_out