  In this article, we derive a new, fast, and robust preconditioned iterative
solution strategy for the all-at-once solution of optimal control problems with
time-dependent PDEs as constraints, including the heat equation and the
non-steady convection--diffusion equation. After applying an
optimize-then-discretize approach, one is faced with continuous first-order
optimality conditions consisting of a coupled system of PDEs. As opposed to
most work in preconditioning the resulting discretized systems, where a
(first-order accurate) backward Euler method is used for the discretization of
the time derivative, we employ a (second-order accurate) Crank--Nicolson method
in time. We apply a carefully tailored invertible transformation for
symmetrizing the matrix, and then derive an optimal preconditioner for the
saddle-point system obtained. The key components of this preconditioner are an
accurate mass matrix approximation, a good approximation of the Schur
complement, and an appropriate multigrid process to apply this latter
approximation---these are constructed using our work in transforming the matrix
system. We prove the optimality of the approximation of the Schur complement
through bounds on the eigenvalues, and test our solver against a widely-used
preconditioner for the linear system arising from a backward Euler
discretization. These demonstrate the effectiveness and robustness of our
solver with respect to mesh-sizes, regularization parameter, and diffusion
coefficient.
