We apply automatic differentiation (widely used in deep learning) and a simple Bloch simulation to efficiently optimize any sequence that can be simulated. Automatic differentiation allows us to ...