# Structure and Sparsity Detection

Using the tracing system provided by Symbolics.jl expressions, Symbolics.jl can automatically detect the sparsity patterns of Julia functions in an efficient way. This functionality is described in more detail in the paper:

@article{gowda2019sparsity,
title={Sparsity Programming: Automated Sparsity-Aware Optimizations in Differentiable Programming},
author={Gowda, Shashi and Ma, Yingbo and Churavy, Valentin and Edelman, Alan and Rackauckas, Christopher},
year={2019}
}

Please cite this work if the functionality is used.

## Sparsity Detection

Symbolics.jacobian_sparsityFunction
jacobian_sparsity(ops::AbstractVector, vars::AbstractVector)

Return the sparsity pattern of the Jacobian of an array of expressions with respect to an array of variable expressions.

source
jacobian_sparsity(op!,output::Array{T},input::Array{T}) where T<:Number

Return the sparsity pattern of the Jacobian of the mutating function op!(output,input,args...).

source
Symbolics.hessian_sparsityFunction
hessian_sparsity(ops::AbstractVector, vars::AbstractVector)

Return the sparsity pattern of the Hessian of an array of expressions with respect to an array of variable expressions.

source