1
$\begingroup$

I am using Qiskit's SPSA optimization algorithm to find the ground state energy of various lattices (Fermi-Hubbard model) by running different circuits through it and having the algorithm modify the angles of the gates (these are the parameters). My files are large and I run them on a computer cluster at my university, but the time needed for the algorithm to converge properly is more than the time allotted for my jobs so they stop prematurely. I save the most recent parameters in each iteration for use in the next run of the program.

Ideally, using the previous parameters should allow the converger to start where it left off in the previous run. Specifically, I pass the array into the "initial_point" variable in the SPSA function given here. However, whenever I reuse these parameters, the optimizer starts from the beginning and takes the same lengthy amount of time to converge; it seems as if reusing the parameters has no effect on it. I am performing some tests to ensure that the correct parameters are being passed in but am relatively sure that this is not a problem.

I would appreciate advice on how to correctly implement this.

$\endgroup$

1 Answer 1

2
$\begingroup$

SPSA has no early termination and will always do maxiter iterations, and it does 25 points (50 functional objective calls) up front for calibration. If you want to just do one iteration, as you already know you have the optimal point, then COBYLA optimizer with maxiter=1 would be the minimum amount of evaluations. It's possible too to specify things for SPSA such that it skips the default calibration, also you can do a termination checker which would allow it to stop ahead of maxiter - or just reduce maxiter - the docs you linked have more info.

$\endgroup$
1
  • $\begingroup$ I looked in the SPSA documentation but couldn't find any reference to specifying the method for SPSA to skip the default calibration, could you point to the specific section? Also, I do not think changing maxiter or doing a termination checker to stop the code will work, since my problem is that the converger doesn't seem to "pick up" where it left off when I use the same parameters. I am always doing ~70000 iterations. $\endgroup$ Commented Feb 29 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.