Best practices for optimization problems with ODE solves and eigen calls

I am working on an optimization which has the following structure

  1. Build some Hamiltonian large matrices which are functions of the parameters I am optimizing over
  2. Project onto the lowest couple of energy levels
  3. Calculate some propagators (basically solve an ODE)
  4. Calculate some cost function based off the results

I am wondering if there are any recommendations for how do this well! Currently I am using SciML Optimization.jl with NelderMead but have also had some slightly better success with NonlinearSolve’s LevenbergMarquardt + AutoFiniteDiff.

I think the main questions are:

  1. Has anyone run into similar optimization problems and if so, what works? What are some other solvers / techniques that might be good for this type of problem.
  2. Ideally, I would be able to use Forward or Reverse autodiff. However, this does not work because of the eigen decomposition. Is there any way to get this to work?

Hi, could you provide a minimal example of the differentiation failures you’re running into? Ideally with vaguely realistic problem sizes and sparsities