Care is needed when dealing with multivalued functions because identities that hold for positive scalars can fail in the complex plane. For example, it is not always true that (z−1)1/2(z+1)1/2=(z2−1)1/2 or log(z1z2)=logz1+logz2 for all z,z1,z2∈C. Here, the square root is the principal square root (the one lying in the right half-plane) and the logarithm is the principal logarithm (the one with imaginary part in (−π,π]).
A powerful tool for dealing with multivalued complex functions is the unwinding number, defined for z∈C by
U(z)=2πiz−logez.
The unwinding number provides a correction term for the putative identity logez=z, in that
z=logez+2πiU(z)(∗)
for all z.
A useful formula for the unwinding number is
U(z)=⌈2πImz−π⌉,
where ⌈⋅⌉ is the ceiling function, which returns the smallest integer greater than or equal to its argument. It follows that U(z)=0 if and only if Imz∈(−π,π]. Hence logez=z if and only if Imz∈(−π,π].
The unwinding number provides correction terms for various identities. For example, for z1,z2∈C, replacing z by logz1±logz2 in (∗), we have
Note that in textbooks one can find identities such as log(z1z2)=logz1+logz2, in which each occurrence of log is interpreted as a possibly different branch. For computational purposes we want formulas that contain a specific branch, usually the principal branch.
An application of the unwinding number to matrix functions is in computing the logarithm of a 2×2 upper triangular matrix. For any function f, we have
Assuming that we have an accurate atanh function this formula will provide an accurate value of f[λ1,λ2] provided that z is not too close to ±1 (the singularities of atanh) and not too large. This formula is used in the MATLAB function logm.
Matrix Unwinding Function
The unwinding number leads to the matrix unwinding function, defined for A∈Cn×n by
U(A)=2πiA−logeA.
Here, log is the principal matrix logarithm, defined by the property that its eigenvalues have imaginary parts in the interval (−π,π]. It can be shown that U(A)=0 if and only if the imaginary parts of all the eigenvalues of A lie in the interval (−π,π]. Furthermore, U(A) is a diagonalizable matrix with integer eigenvalues.
In general, if A is real then U(A) is pure imaginary as long as A has no eigenvalue with imaginary part that is an odd multiple of π.
The matrix unwinding function is useful for providing correction terms for matrix identities involving multivalued functions. Here are four useful matrix identities, along with cases in which the correction term vanishes. See Aprahamian and Higham (2014) for proofs.
For nonsingular A and α,β∈C,
(Aα)β=Aαβe−2βπiU(αlogA).
If β is an integer then the correction term is I. If α∈(−1,1] and β=1/α then U(αlogA)=0 and so
(Aα)1/α=A,α∈[−1,1],
and this equation is obviously true for α=−1, too.
If A and B are nonsingular and AB=BA then
log(AB±1)=logA±logB−2πiU(logA±logB).
If argλi+argμi∈(−π,π] for every eigenvalue λi of A and the corresponding eigenvalue μi of B (there is a correspondence because of the commutativity of A and B, which implies that they are simultaneously unitarily diagonalizable), then log(AB±1)=logA±logB.
If A and B are nonsingular and AB=BA then for any α∈C,
(AB)α=AαBαe−2παiU(logA+logB).
If α is an integer or the eigenvalues of A and B have arguments in (−π/2,π/2] then (AB)α=AαBα.
For nonsingular A and α∈C.
logAα=αlogA−2πiU(αlogA).
If α∈(−1,1] then logAα=αlogA, and this equation also holds for α=−1 if A has no negative eigenvalues.
The matrix unwinding function can be computed by an adaptation of the Schur–Parlett algorithm. The algorithm computes a Schur decomposition and re-orders it into a block form with eigenvalues having the same unwinding number in the same diagonal block. The unwinding function of each diagonal block is then a multiple of the identity and the off-diagonal blocks are obtained by the block Parlett recurrence. This approach gives more accurate results than directly evaluating U(A) from its definition in terms of the matrix logarithm and natrix exponential. A MATLAB code unwindm is available at https://github.com/higham/unwinding
Matrix Argument Reduction
The matrix unwinding function can be of use computationally for reducing the size of the imaginary parts of the eigenvalues of a matrix. The function
mod(A)=A−2πiU(A)
has eigenvalues λ with Imλ∈(−π,π]. Using mod(A) in place of A can be useful in computing the matrix exponential by the scaling and squaring algorithm because eA=emod(A) and mod(A) can have a much smaller norm than A, giving potential reductions in cost. Combined with the Schur decomposition-based algorithm for U(A) mentioned above, this idea leads to a numerical method for eA. See Aprahamian and Higham (2014) for details.
Round Trip Relations
If you apply a matrix function and then its inverse do you get back to where you started, that is, is f−1(f(z))=z? In principle yes, but if the inverse is multivalued the answer is not immediate. The matrix unwinding function is useful for analyzing such round trip relations. As an example, if A has no eigenvalues with real part of the form kπ for an integer k, then
acos(cosA)=(A−2πU(iA))sign(A−2πU(iA)).
Here, acos is the principal arc cosine defined in Aprahamian and Higham (2016), where this result and analogous results for the arc sine, arc hyperbolic cosine, and arc hyperbolic sine are derived; and sign is the matrix sign function.
History
The unwinding number was introduced by Corless, Hare and Jeffrey in 1996, to help implement computer algebra over the complex numbers. It was generalized to the matrix case by Aprahamian and Higham (2014).
References
This is a minimal set of references, which contain further useful references within.