approx_gradient#

cuqi.utilities.approx_gradient(func, x, epsilon=1e-06)#

Approximates the gradient of callable scalar function func evaluated at point x. The approximation is done using finite differences with step size epsilon.