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
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

Structure Detection

Symbolics.islinearFunction
islinear(ex, u)

Check if an expression is linear with respect to a list of variable expressions.

source
Symbolics.isaffineFunction
isaffine(ex, u)

Check if an expression is affine with respect to a list of variable expressions.

source