  We present an approach for solving optimal Dirichlet boundary control
problems of nonlinear optics by using deep learning. For computing high
resolution approximations of the solution to the nonlinear wave model, we
propose higher order space-time finite element methods in combination with
collocation techniques. Thereby, $C^{l}$-regularity in time of the global
discrete is ensured. The resulting simulation data is used to train solution
operators that effectively leverage the higher regularity of the training data.
The solution operator is represented by Fourier Neural Operators and Gated
Recurrent Units and can be used as the forward solver in the optimal Dirichlet
boundary control problem. The proposed algorithm is implemented and tested on
modern high-performance computing platforms, with a focus on efficiency and
scalability. The effectiveness of the approach is demonstrated on the problem
of generating Terahertz radiation in periodically poled Lithium Niobate, where
the neural network is used as the solver in the optimal control setting to
optimize the parametrization of the optical input pulse and maximize the yield
of $0.3\,$THz-frequency radiation. We exploit the periodic layering of the
crystal to design the neural networks. The networks are trained to learn the
propagation through one period of the layers. The recursive application of the
network onto itself yields an approximation to the full problem. Our results
indicate that the proposed method can achieve a significant speedup in
computation time compared to classical methods. A comparison of our results to
experimental data shows the potential to revolutionize the way we approach
optimization problems in nonlinear optics.
