ForwardDiff.jl icon indicating copy to clipboard operation
ForwardDiff.jl copied to clipboard

Hessian should be symmetric

Open dpsanders opened this issue 8 years ago • 1 comments

The Hessian of a function f is a symmetric matrix if f is smooth enough. Is there a way of having this information made available? I guess not just by returning a SymmetricMatrix, due to type stability.

dpsanders avatar Aug 22 '17 22:08 dpsanders

I have the same problem. I have obtained non-symmetric hessian matrices when using ForwardDiff.hessian. This problem seems to appear when the dimension is higher than 3.

A hackish workaround I am currently using is replacing the lower diagonal by the upper diagonal, but this is a suboptimal strategy.

FJRubio67 avatar Jan 12 '24 16:01 FJRubio67