Parametric optimization by using a canonical observable realization