Computational graphs for matrix functions

Elias Jarlebring, Massimiliano Fasi, Emil Ringh
7/26/2021
10 citations
math.NA

Official code: matrixfunctions/GraphMatFun.jl (18 stars, Julia, MIT, last commit 2026-10-06). 1 more implementation below.

Abstract

Many numerical methods for evaluating matrix functions can be naturally viewed as computational graphs. Rephrasing these methods as directed acyclic graphs (DAGs) is a particularly effective approach to study existing techniques, improve them, and eventually derive new ones.

Show full abstract

The accuracy of these matrix techniques can be characterized by the accuracy of their scalar counterparts, thus designing algorithms for matrix functions can be regarded as a scalar-valued optimization problem. The derivatives needed during the optimization can be calculated automatically by exploiting the structure of the DAG, in a fashion analogous to backpropagation. This paper describes GraphMatFun.jl, a Julia package that offers the means to generate and manipulate computational graphs, optimize their coefficients, and generate Julia, MATLAB, and C code to evaluate them efficiently at a matrix argument. The software also provides tools to estimate the accuracy of a graph-based algorithm and thus obtain numerically reliable methods. For the exponential, for example, using a particular form (degree-optimal) of polynomials produces implementations that in many cases are cheaper, in terms of computational cost, than the Padé-based techniques typically used in mathematical software. The optimized graphs and the corresponding generated code are available online.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
matrixfunctions/GraphMatFun.jlOfficial18JuliaMIT2026-10-06
matrixfunctions/GraphMatFunDataOfficial3CMIT2021-08-16
MIT

Computation graphs for matrix functions

181JuliaMar 3, 20211 months agoMIT
MIT

Data files and scripts for GraphMatFun.jl

30C, JuliaJun 17, 20215 years agoMIT

Similar Papers

Cite this paper

@article{jarlebring2021computational,
  title  = {Computational graphs for matrix functions},
  author = {Elias Jarlebring and Massimiliano Fasi and Emil Ringh},
  year   = {2021},
  eprint = {2107.12198},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2107.12198}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2107.12198.svg)](https://codeofpaper.com/paper/2107.12198)

Discussion