Text this: Solving Optimization Problems on Hermitian Matrix Functions with Applications