def andreev_conductance(smatrix, normal_lead=1):
    """The Andreev conductance is N - R_ee + R_he."""
    r_ee = smatrix.transmission((normal_lead, 0), (normal_lead, 0))
    r_he = smatrix.transmission((normal_lead, 1), (normal_lead, 0))
    N_e = smatrix.submatrix((normal_lead, 0), (normal_lead, 0)).shape[0]
    return N_e - r_ee + r_he