Please note that I am looking for numerical algorithms that will tell me what the operator is that minimizes a problem.

I have a 2x2 complex hermitian operator that is a function of two variables, so $\tilde{O} = \tilde{O}(x,y)$. I will not have this operator in a closed form, but rather as the output of a numberical simulation who's inputs are just $x$ and $y$. I want to find out which values of $x$ and $y$ will allow me to map a given vector $\psi_{in}$ to another given vector $\phi_{1}$. I feel that some kind of gradient descent algorithm is in order. For instance, I can define

$d = | \tilde{O}(x,y)\psi_{in} - \phi_{1} |$

Now I can minimize this value over the two input values $x$ and $y$. So I would have an equation like this:

$ \frac{\partial^2 d}{\partial_x \partial_y} = \frac{\partial^2 | \tilde{O}(x,y)\psi_{in} - \phi_{1} |}{\partial_x \partial_y} $

We might do some minimization from here but I am not sure how to procede and I feel there is a simpler numerical recipe that someone might know of.

Any help will be most appreciated.