  We present a conjugate-gradient method for the ground-state optimization of
projected entangled-pair states (PEPS) in the thermodynamic limit, as a direct
implementation of the variational principle within the PEPS manifold. Our
optimization is based on an efficient and accurate evaluation of the gradient
of the global energy functional by using effective corner environments, and is
robust with respect to the initial starting points. It has the additional
advantage that physical and virtual symmetries can be straightforwardly
implemented. We provide the tools to compute static structure factors directly
in momentum space, as well as the variance of the Hamiltonian. We benchmark our
method on Ising and Heisenberg models, and show a significant improvement on
the energies and order parameters as compared to algorithms based on
imaginary-time evolution.
