  Optimal control is highly desirable in many current quantum systems,
especially to realize tasks in quantum information processing. We introduce a
method based on differentiable programming to leverage explicit knowledge of
the differential equations governing the dynamics of the system. In particular,
a control agent is represented as a neural network that maps the state of the
system at a given time to a control pulse. The parameters of this agent are
optimized via gradient information obtained by direct differentiation through
both the neural network \emph{and} the differential equation of the system.
This fully differentiable reinforcement learning approach ultimately yields
time-dependent control parameters optimizing a desired figure of merit. We
demonstrate the method's viability and robustness to noise in eigenstate
preparation tasks for three systems: a~single qubit, a~chain of qubits, and a
quantum parametric oscillator.
