We report on recent progress in the numerical optimisation of quantum control systems using OptimalControl.jl. Although the package is designed to optimise general control systems governed by ordinary differential equations, it naturally accommodates quantum problems described by finite-dimensional Schrödinger equations evolving on Lie groups — specifically, bilinear dynamical systems whose state trajectories lie on unitary groups and are expressed compactly in terms of tensor products of complex matrices.
A well-established Julia ecosystem for quantum optimal control already exists, with packages such as QuantumControl.jl, Krotov.jl, and GRAPE.jl providing mature, quantum-tailored implementations of the GRAPE and Krotov algorithms. These methods are effective for a broad class of problems and can accommodate extensions such as free final time or path constraints on controls and states, typically via penalisation of the cost functional. However, penalisation-based approaches offer no rigorous guarantee of constraint satisfaction and can introduce significant ill-conditioning. Our motivation is complementary: to leverage state-of-the-art nonlinear programming solvers that treat such constraints directly, as genuine algebraic equalities and inequalities arising from the transcription of the continuous-time optimal control problem — including additional optimisation variables such as free final time or parameters of the system.
OptimalControl.jl offers a high-level, expressive modelling interface that allows users to specify dynamics, objectives, and constraints in a form close to mathematical notation, with no compromise on performance. Problems are transcribed via direct methods into large-scale sparse nonlinear programmes, which are solved using interior-point methods on both CPU and GPU, exploiting automatic differentiation through ExaModels.jl and MadNLP.jl. Crucially, the framework also supports the combination of direct and indirect methods: direct transcription is used first to identify the qualitative structure of the optimal solution, after which indirect shooting methods — based on the Pontryagin Maximum Principle — can be applied to refine the solution to arbitrary numerical precision.
We present preliminary results on the optimisation of small quantum systems modelling nitrogen-vacancy (NV) centres in diamond. These systems, comprising an electron spin coupled to one or more nuclear spins via hyperfine interaction, are naturally described with bilinear dynamics driven by bounded microwave controls. The combination of hard amplitude constraints, partial controllability (nuclear spins are driven only indirectly through the electron spin), and the need for various costs functionals for gate synthesis makes NV centres a compelling benchmark for our approach. We discuss the formulation of these problems within OptimalControl.jl, and compare the results and computational performance against existing quantum-specific methods.