Gradient Flows for Optimization in Quantum Information and Quantum Dynamics:. Foundations and Applications