Operator Scaling via Geodesically Convex Optimization, Invariant Theory and Polynomial Identity Testing