  The Yang-Mills gradient flow and the observable E(t), defined by the square
of the field strength tensor at t>0, are calculated at finite lattice spacing
and tree-level in the gauge coupling. Improvement of the flow, the gauge action
and the observable are all considered. The results are relevant for two
purposes. First, the discretization of the flow, gauge action and observable
can be chosen in such a way that $O(a^2)$, $O(a^4)$ or even $O(a^6)$
improvement is achieved. Second, simulation results using arbitrary
discretizations can be tree-level improved by the perturbatively calculated
correction factor normalized to one in the continuum limit.
