pint.templates.lceprimitives.edep_gradientļƒ

pint.templates.lceprimitives.edep_gradient(self, grad_func, phases, log10_ens=3, free=False)[source]ļƒ

Return the analytic gradient of a general LCEPrimitive.

The evaluation is similar to the non-energy dependent version, and since this is a linear model, application of the chain rule simply returns the gradient at the indicated parameters, but weighted by the difference in (log) energy.

However, there is one complication. Because of the bounds enforced by ā€œ_make_pā€, the gradient for the slope parameters vanishes at some energies when the bound has saturated. These entries should be zeroed.