Solution (source code)

= Solution

For a <variation> of the covariant <metric tensor>, $\delta g^{\alpha\beta}=-g^{\alpha\mu}g^{\beta\nu}\delta g_{\mu\nu}$ and $\delta\sqrt{-g}=\tfrac12\sqrt{-g}\,g^{\mu\nu}\delta g_{\mu\nu}$. Writing $\mathcal L=-\tfrac12g^{\alpha\beta}\partial_\alpha\phi\partial_\beta\phi-V$, one obtains
$$
\delta S=\frac12\int d^4x\sqrt{-g}\left\{\partial^\mu\phi\partial^\nu\phi+g^{\mu\nu}\mathcal L\right\}\delta g_{\mu\nu}.
$$
The specified metric-variation convention therefore gives
$$
\boxed{T^{\mu\nu}=\partial^\mu\phi\partial^\nu\phi-g^{\mu\nu}\left(\tfrac12\partial_\alpha\phi\partial^\alpha\phi+V\right).}
$$
For $\phi=\phi(t)$, its invariant gradient square is $-\dot\phi^2$. Hence $T^{00}=\dot\phi^2-(\dot\phi^2/2-V)=\dot\phi^2/2+V$, while $T^{ij}=a^{-2}\delta^{ij}(\dot\phi^2/2-V)$ and $T^{0i}=0$. Lowering one index makes $T^\mu{}_{\nu}=\operatorname{diag}(-\rho,P,P,P)$, with
$$
\boxed{\rho=\frac12\dot\phi^2+V(\phi),\qquad P=\frac12\dot\phi^2-V(\phi).}
$$
<Potential energy> has negative <pressure>, whereas scalar <kinetic energy> contributes positive <pressure>. This sign distinction is what permits accelerated expansion.