  We consider the defocusing $\dot H^1$-critical nonlinear Schr\"odinger
equation in all dimensions ($n\geq 3$) with a quadratic potential $V(x)=\pm
\tfrac12 |x|^2$. We show global well-posedness for radial initial data obeying
$\nabla u_0(x), xu_0(x) \in L^2$. In view of the potential $V$, this is the
natural energy space. In the repulsive case, we also prove scattering.
  We follow the approach pioneered by Bourgain and Tao in the case of no
potential; indeed, we include a proof of their results that incorporates a
couple of simplifications discovered while treating the problem with quadratic
potential.
