Cataloguing Software for Matrix Functions

I began working on functions of matrices just over thirty years ago, when I was an MSc student, my original interest being in the matrix square root. In those days relatively little research had been done on the topic and no software for evaluating matrix functions was generally available. Since then interest in matrix functions has grown greatly.

Functions of interest include the exponential, the logarithm, and real powers, along with all kinds of trigonometric functions and some less generally known functions such as the sign function and the unwinding function.

Gil Strang at the Advances in Matrix Functions and Matrix Equations Workshop in Manchester, April 2013.

A large amount of software for evaluating matrix functions now exists, covering many languages (C++, Fortran, Julia, Python, …) and problem solving environments (GNU Octave, Maple, Mathematica, MATLAB, R, Scilab, …). Some of it is part of a core product or package, while other codes are available individually on researchers’ web sites. It is hard to keep up with what is available.

Edvin Deadman and I therefore decided to produce a catalogue of matrix function software, which is available in the form of MIMS EPrint 2014.8. We have organized the catalogue by language/package and documented the algorithms that are implemented. The EPrint also contains a summary of the rapidly growing number of applications in which matrix functions are used, including some that we discovered only recently, and a list of what we regard as the best current algorithms.

Producing the catalogue took more work than I expected. Many packages are rather poorly documented and we sometimes had to delve deep into documentation or source code in order to find out which algorithms had been implemented.

One thing our survey shows is that the most complete and up to date collection of codes for matrix functions currently available is that in the NAG Library, which contains over 40 codes all implementing state of the art algorithms. This is no accident. We recently completed a three year Knowledge Transfer Partnership (KTP) funded by the Technology Strategy Board, the University of Manchester, and EPSRC, whose purpose was to translate matrix function algorithms into software for the NAG Engine (the underlying code base from which all NAG products are built) and to embed processes and expertise in developing matrix functions software into the company. Edvin was the Associate employed on the project and wrote all the codes, which are in Fortran.

A video about the KTP project been made by the University of Manchester and more information about the project can be obtained from Edvin’s posts at the NAG blog:

We intend to update the catalogue from time to time and welcome notification of errors and omissions.

How To Typeset an Ellipsis in a Mathematical Expression

In mathematical typesetting we often use an ellipsis (three dots) to denote omission in an expression. It’s well known to \LaTeX users that an ellipsis is not typed as three dots, but rather as \dots or \cdots. The vertically centered \cdots is used between operators that sit above the baseline, such as +, -, = and \le. Ground level dots are produced by \dots and are used in a list or to indicate a product.

Recently the question arose of whether to write

$a_1$, $a_2$, \dots, $a_n$


$a_1, a_2, \dots, a_n$

The difference between these two does not show up well if I allow WordPress to interpret the \LaTeX, but as this PDF file shows the first of these two alternatives produces more space after the commas.

I don’t discuss this question in my Handbook of Writing for the Mathematical Sciences, nor does the SIAM Style Guide offer an opinion (it implies that the copy editor should stet whatever the author chooses).

As usual, Knuth offers some good advice. On page 172 of the TeXbook he gives the example

The coefficients $c_1$, $c_2$, \dots, $c_n$ are positive.

the justification for which is that the commas belong to the sentence, not the formula. (He uses \ldots, which I have translated to \dots, as used in \LaTeX.) In Exercise 18.17 he notes that this is preferred to $c_1, c_2, \dots, c_n$ because the latter leaves too little space after the commas and also does not allow line breaks after the commas. But he notes that in a more terse example such as

Clearly $a_i<b_i$ \ $(i=1,2,\dots,n)$

the tighter spacing is fine. Indeed I would always write $i=1,2,\dots,n$, because $i=1$, $2$, \dots, $n$ would be logically incorrect. Likewise, there is no alternative in the examples

$D = \diag(d_1,d_2,\dots,d_n)$ 

Looking back over my own writing I find that when typesetting a list within a sentence I have used both forms and not been consistent—and no copy editor has ever queried it. Does it matter? Not really. But in future I will try to follow Knuth’s advice.