def error_j(Dj,Pap,Pdc,PolError,exp_loss_jt):
    """
    Calculates the conditional probability for a pulse of intensity mu_j
    to cause an error, after sifting, in the time slot t.
    Defined as e_k in Sec. IV of [1].

    Parameters
    ----------
    Dj : float, array
        Expected detection rate.
    Pap : float
        Probability of an afterpulse event.
    Pdc : float
        Dark count probability.
    PolError : float
        Errors in polarisation basis.
    exp_loss_jt : float, array
        Loss, per intensity per time slot, decay function.

    Returns
    -------
    float, array
        Error rate per intensity per time slot.

    """
    return Pdc + (0.5*Pap*Dj) + PolError*(1 - exp_loss_jt)