Optimal control and machine learning of quantum device dynamics | Synapse