def METHOD_NAME(r, etaA, etaB, hbar):
    """Tests the log_negativity for two modes states following Eq. 13 of https://arxiv.org/pdf/quant-ph/0506124.pdf"""
    cov = (hbar / 2) * two_mode_squeezing(2 * r, 0)
    _, cov_lossy = passive_transformation(np.zeros([4]), cov, np.diag([etaA, etaB]), hbar=hbar)
    cov_xpxp = xxpp_to_xpxp(cov_lossy) / (hbar / 2)
    alpha = cov_xpxp[:2, :2]
    gamma = cov_xpxp[2:, :2]
    beta = cov_xpxp[2:, 2:]
    invariant = np.linalg.det(alpha) + np.linalg.det(beta) - 2 * np.linalg.det(gamma)
    detcov = np.linalg.det(cov_xpxp)
    expected = -np.log(np.sqrt((invariant - np.sqrt(invariant**2 - 4 * detcov)) / 2))
    obtained = log_negativity(cov_lossy, modes_A=[0], hbar=hbar)
    assert np.allclose(expected, obtained)