  Quantum optimal control problems are typically solved by gradient-based
algorithms such as GRAPE, which suffer from exponential growth in storage with
increasing number of qubits and linear growth in memory requirements with
increasing number of time steps. These memory requirements are a barrier for
simulating large models or long time spans. We have created a nonstandard
automatic differentiation technique that can compute gradients needed by GRAPE
by exploiting the fact that the inverse of a unitary matrix is its conjugate
transpose. Our approach significantly reduces the memory requirements for
GRAPE, at the cost of a reasonable amount of recomputation. We present
benchmark results based on an implementation in JAX.
