# Best/simplest way to calculate sparse Hessian

**URL:** <https://discourse.julialang.org/t/best-simplest-way-to-calculate-sparse-hessian/58629>\
**Category:** General Usage\
**Tags:** sparse, ad\
**Created:** [April 5, 2021, 5:23pm UTC](https://discourse.julialang.org/t/best-simplest-way-to-calculate-sparse-hessian/58629 "2021-04-05T17:23:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [April 21, 2021, 7:16pm UTC](https://discourse.julialang.org/t/best-simplest-way-to-calculate-sparse-hessian/58629/3 "2021-04-21T19:16:33Z")

</div>

We almost have it, but we don’t. We have automated Hessian sparsity detection in SparsityDetection.jl and Symbolics.jl. We have acyclic coloring of Hessian sparsities. But we don’t have the Hessian differentiation piece, which uses the former two and implements the symmetric compression/decompression. That will go into SparseDiffTools.jl, and I believe there’s already an issue tracking its development.

That said, the better way is to use Symbolics.jl to trace it and generate an analytical Hessian. If this is viable, it’ll be a lot faster even than sparse diff.

---

_[View the full topic](https://discourse.julialang.org/t/best-simplest-way-to-calculate-sparse-hessian/58629)._
