Erregistroa posta elektronikoz bidali: Hamiltonian engineering with constrained optimization for quantum sensing and control