Quantum Algorithms for Optimization and Polynomial Systems Solving over Finite Fields