Page 1 of 1

About Grape module

Posted: Thu Aug 12, 2021 12:19 am
by yunwei
So is the grape module only for the first-order derivatives? Or it also contains second-order? Or user can set up

Re: About Grape module

Posted: Thu Aug 12, 2021 7:52 am
by kuprov
It has second order derivatives. Call it with four output parameters to get the Hessian:

http://spindynamics.org/wiki/index.php?title=Grape.m

The mathematics is described here:

https://aip.scitation.org/doi/10.1063/1.4949534

Re: About Grape module

Posted: Mon Aug 16, 2021 9:41 pm
by yunwei
I see. But can I choose to only use gradient optimization without the hessian?

Re: About Grape module

Posted: Tue Aug 17, 2021 7:34 am
by kuprov
We have taken that the pure gradient descent option out - its performance is always much inferior to BFGS. If for some reason you would like to force gradient descent (bad idea), call optimal control functions like grape_xy manually in a loop and use the gradients that they return to take a step manually.