def nose_hoover_energy(Q, xi, N, kb, T, lns):
    """Computes the Nose Hoover energy contribution given by

    E = xi*xi*Q/2 + 3NkbTlns
    """
    energy = 0.5*Q*xi**2 + 3*N*kb*T*lns
    return energy