  Quantum optimal control is a set of methods for designing time-varying
electromagnetic fields to perform operations in quantum technologies. This
tutorial paper introduces the basic elements of this theory based on the
Pontryagin maximum principle, in a physicist-friendly way. An analogy with
classical Lagrangian and Hamiltonian mechanics is proposed to present the main
results used in this field. Emphasis is placed on the different numerical
algorithms to solve a quantum optimal control problem. Several examples ranging
from the control of two-level quantum systems to that of Bose-Einstein
Condensates (BEC) in a one-dimensional optical lattice are studied in detail,
using both analytical and numerical methods. Codes based on shooting method and
gradient-based algorithms are provided. The connection between optimal
processes and the quantum speed limit is also discussed in two-level quantum
systems. In the case of BEC, the experimental implementation of optimal control
protocols is described, both for two-level and many-level cases, with the
current constraints and limitations of such platforms. This presentation is
illustrated by the corresponding experimental results.
