def compute_log_moment(q, sigma, steps, lmbd, verify=False, verbose=False):
    'Compute the log moment of Gaussian mechanism for given parameters.\n\n  Args:\n    q: the sampling ratio.\n    sigma: the noise sigma.\n    steps: the number of steps.\n    lmbd: the moment order.\n    verify: if False, only compute the symbolic version. If True, computes\n      both symbolic and numerical solutions and verifies the results match.\n    verbose: if True, print out debug information.\n  Returns:\n    the log moment with type np.float64, could be np.inf.\n  '
    moment = compute_a(sigma, q, lmbd, verbose=verbose)
    if verify:
        mp.dps = 50
        moment_a_mp = compute_a_mp(sigma, q, lmbd, verbose=verbose)
        moment_b_mp = compute_b_mp(sigma, q, lmbd, verbose=verbose)
        np.testing.assert_allclose(moment, moment_a_mp, rtol=1e-10)
        if (not np.isinf(moment_a_mp)):
            np.testing.assert_array_less(moment_b_mp, moment_a_mp)
    if np.isinf(moment):
        return np.inf
    else:
        return (np.log(moment) * steps)
Compute the log moment of Gaussian mechanism for given parameters.

Args:
  q: the sampling ratio.
  sigma: the noise sigma.
  steps: the number of steps.
  lmbd: the moment order.
  verify: if False, only compute the symbolic version. If True, computes
    both symbolic and numerical solutions and verifies the results match.
  verbose: if True, print out debug information.
Returns:
  the log moment with type np.float64, could be np.inf.
def compute_log_moment(q, sigma, steps, lmbd, verify=False, verbose=False):
    'Compute the log moment of Gaussian mechanism for given parameters.\n\n  Args:\n    q: the sampling ratio.\n    sigma: the noise sigma.\n    steps: the number of steps.\n    lmbd: the moment order.\n    verify: if False, only compute the symbolic version. If True, computes\n      both symbolic and numerical solutions and verifies the results match.\n    verbose: if True, print out debug information.\n  Returns:\n    the log moment with type np.float64, could be np.inf.\n  '
    moment = compute_a(sigma, q, lmbd, verbose=verbose)
    if verify:
        mp.dps = 50
        moment_a_mp = compute_a_mp(sigma, q, lmbd, verbose=verbose)
        moment_b_mp = compute_b_mp(sigma, q, lmbd, verbose=verbose)
        np.testing.assert_allclose(moment, moment_a_mp, rtol=1e-10)
        if (not np.isinf(moment_a_mp)):
            np.testing.assert_array_less(moment_b_mp, moment_a_mp)
    if np.isinf(moment):
        return np.inf
    else:
        return (np.log(moment) * steps)