Classical and Quantum Optimization for Scientific Computation