WorksMathematics
A Fast and Stable Square-Root-Free Unitary Core-Chasing Algorithm
Abstract
Symmetric and unitary matrices are among the most important classes of structured matrices admitting efficient and stable eigenvalue algorithms. Notable examples include structure-preserving variants of the QR algorithm and their square-root-free counterparts. For unitary matrices, these algorithms were historically derived from recurrence relations for orthogonal polynomials on the unit circle. A matrix-based derivation using core chasing was later given in [3]; this family of algorithms is backward stable, but the underlying symmetries needed to cast out the square roots were not identified, and the question of structured backward stability was left open. In this paper we present a matrix-based derivation of the symmetric unitary core-chasing algorithm and use it to obtain a square-root-free variant. We give a matrix-based proof of backward stability and show that strict structured backward stability is impossible in general. Open-source Fortran code and numerical experiments demonstrate that the combination of exploiting the symmetry and removing the square roots reduces computation time without degrading accuracy.
Introduction
This project began with an observation. Among all the different types of structured matrices that admit fast algorithms for computing eigenvalues, symmetric tridiagonal matrices and unitary upper Hessenberg matrices possess a number of very similar algorithms. For both classes there exist fast versions of Francis’ implicitly-shifted QR algorithm [7, 12] and fast divide-and-conquer algorithms [6, 15]. There are also Krylov methods based on short recurrences [4, 18], bisection methods [5, 20], and Jacobi methods [10, 17], though, in general, these apply to full matrices.
In the case of the QR algorithm, the similarities between these two classes of matrices run even deeper. For both classes, the recursions used in each QR iteration are not unique, leading to multiple versions of the “same” algorithm. In the case of unitary matrices, many variants have been proposed, though not all of them are stable [1, 3, 12, 13, 14, 21, 22, 23, 24]. Additionally, for both classes of matrices there exist square-root-free versions, which avoid computing the square roots needed to normalize the similarity transformations. When done correctly, removing the costly square roots gives an even more efficient algorithm for computing eigenvalues, without sacrificing backward stability. For symmetric tridiagonal matrices, the first square-root-free algorithm was proposed by Ortega and Kaiser in 1963 [19], and later improved by Pal, Walker, and Kahan in 1968 [20 Section 8.15]. Further versions were introduced and their stability analyzed in [8].
Developing square-root-free algorithms for unitary upper Hessenberg matrices is more complicated than for symmetric tridiagonal matrices, since the transforming matrices are necessarily complex. In the original unitary QR algorithm by Gragg [12], cancellation errors due to the necessary complex arithmetic made the algorithm unstable. In [13, 14], Gragg introduced an alternative formulation of his original algorithm and showed experimentally that it was stable. This same reformulation also made it possible to develop a square-root-free unitary QR algorithm, similar to the symmetric case. In [21, 22, 23], Stewart reviewed several variants of the QR algorithm for unitary upper Hessenberg matrices and gave a detailed stability analysis of a stabilized recurrence-based formulation, including square-root-free variants.
In [3], the authors unified many of the existing unitary QR algorithms by interpreting them as unitary core-chasing algorithms [2]. This point of view allows the same algorithms to be derived from a strictly matrix-based analysis, as opposed to one based on recurrence relations for orthogonal polynomials on the unit circle. It also allows one to show that, in exact arithmetic, many of the seemingly different variants of the QR algorithm for unitary upper Hessenberg-like matrices are identical. The matrix-based analysis further aids in simplifying the proof of backward stability. However, the additional symmetries needed to derive a square-root-free unitary core-chasing algorithm were not identified in [3], and the question of structured backward stability was not addressed.
This paper addresses these details, starting in § 2, where we show that the core-chasing formulation of the unitary QR algorithm contains a previously unnoticed symmetry. This symmetry is generated by the first fusion in a single-shift core-chasing step and is preserved, in exact arithmetic, by a symmetric turnover. We also discuss its relation with the QR algorithm for symmetric tridiagonal matrices.
In § 3 we study what happens when the core transformations are only nearly-unitary, as occurs when using floating-point arithmetic. In this setting, the naïve symmetric turnover formulas can be unstable, and one must use a modified formula analogous to Gragg’s stabilized recurrence. We prove that the resulting symmetric turnover is nearly exact for nearly-unitary data.
In § 4 we show how the symmetry in the turnover can be used to derive a square-root-free unitary core-chasing algorithm and how to preserve the nearly-unitariness of the core transformations without computing additional square roots.
In § 5 we analyze the floating-point implementation. We prove that both the symmetric and square-root-free turnovers are stable in a forward sense for nearly-unitary floating-point input, and then show how this forward error can be converted into a backward error result for the turnover. We also show that a strict structured backward error result is impossible in general.
Finally, in § 6 we present numerical experiments that demonstrate the practical effects of removing square roots, and compare the symmetric and square-root-free algorithms with LAPACK and the unitary core-chasing algorithm in [3].
The Unitary Core-Chasing Algorithm
The key to the efficiency of the core-chasing algorithms for unitary upper Hessenberg matrices in [3] is to first factor the matrix into a product of elementary matrices called core transformations.
Core transformations
The core transformation is an unitary matrix which is equal to the identity matrix everywhere except for the submatrix at the intersection of rows and columns and . Apart from a few exceptions, in this paper we will use core transformations that are complex Givens’ rotations, whose entry is real and nonnegative. In this case, the core transformation can be parameterized by a complex number and a nonnegative real number such that
Since working with core transformations often involves working directly with their nontrivial diagonal blocks, we will use the notation to denote any submatrices needed to perform the operations. For example, we use the notation to signify the submatrix at the intersection of rows and columns and ,
Similarly, we use to denote the nontrivial diagonal block of the product,
A fundamental result, essential to all fast unitary QR algorithms, is that every unitary upper Hessenberg matrix can be factored into a product of core transformations as
The last core transformation is equal to the identity matrix everywhere except for the last diagonal entry, and is not, strictly speaking, a rotation
This factorization implies that can be stored using data, equivalent to the linear storage needed for symmetric tridiagonal matrices. Gragg showed using recurrence relations that, just as in the symmetric case, this factorization can be used to perform a single step of Francis’ implicitly-shifted QR algorithm in flops. Since this factorization is the same one that is used in all core-chasing algorithms [2], it immediately admits a fast core-chasing algorithm for unitary upper Hessenberg matrices.
Unitary core-chasing
Given a complex shift , , an iteration of the unitary core-chasing algorithm begins by constructing a core transformation such that , , and performing the similarity transformation ,
The last equality holds since whenever .
The core transformation is constructed so that its first column is parallel to the first column of . Since is upper Hessenberg, its first column has only two nonzero entries, . Such a can be constructed as follows,
where , and . The first similarity transformation is then simplified by fusing the product into a new core transformation . After applying this first similarity transform, the matrix is no longer upper Hessenberg due to the factor on the right,
The rest of the iteration consists of returning this product to upper Hessenberg form through a sequence of turnovers and similarity transformations.
Given a product of three core transformations of the form , a turnover is a refactorization into a product of three new core transformations of the form such that,
When , and are unitary, the turnover can always be computed stably in flops by computing the QR factorization of a unitary matrix [2].
The iteration continues by computing a turnover of the product ,
and performing a similarity transformation with the computed matrix ,
This process is continued a total of times, resulting in the following product,
Although is not a rotation, the product can be refactored via a turnover as , where and have the same form as . Performing a similarity transformation with the matrix gives the following,
Thus, a single iteration of the unitary core-chasing algorithm directly computes the factorization for the resulting unitary upper Hessenberg matrix ,
where and .
Symmetry in the unitary core-chasing algorithm
The majority of the work in a single unitary core-chasing iteration comes from computing the turnovers. In the algorithm presented in [3] this is done via a QR factorization of a unitary matrix. While this can be done stably using a single square root, it requires explicitly forming most of the submatrix and multiplying these entries by two rotations. Here it will be shown that the arithmetic needed to perform a turnover can be reduced by taking advantage of a previously unknown symmetry present in the core transformations. This symmetry comes from the special form of the initial transforming matrix and is maintained throughout the entire iteration.
Recall that given a unimodular shift , the core transformation is constructed so that its first column is parallel to the first column of ,
where . Thus, the parameters that generate are shifted and scaled versions of the parameters that generate . The initial similarity transform requires the fusion of the product . Given that both matrices are core transformations, computing the fusion requires computing the product of their initial diagonal blocks.
To see the structure in the initial fusion we first separate the diagonal shifts in ,
Then, we compute the products of the initial diagonal blocks
Now we can rewrite the first similarity transformation and fusion as follows,
The matrix is still a core transformation but the off-diagonal entries of are no longer strictly real. However, their phase is and the connection to remains via the parameters and .
Symmetry in the turnover
In order for this symmetry to be useful it must be preserved by the turnover. If that were the case, there would exist core transformations , and such that
Then, applying the similarity transformation defined by would give the next step in the iteration,
and the product would have the same structure as the previous turnover, thus preserving the symmetry.
Unfortunately, the existence of the shift in breaks the symmetry just enough to require the introduction of an extra parameter. Theorem 2.1 shows that with the addition of this new parameter, the symmetry in the turnover is preserved throughout the entire core-chasing step.
Theorem 2.1 (Symmetric Turnover). Given unimodular complex numbers and , complex numbers and , and nonnegative real numbers and such that
and , define the following,
if :
else:
Then, the following products are equivalent,
Proof. Define and as follows
It is enough to show that . Using and , together with and , becomes
In the case , define and as follows,
The matrices and are designed to create zeros in the (3, 1) and (1, 3) entries of , respectively, so that
Assume that . Then and, since is unitary, . This implies that ; since , we also have . Therefore,
and
For , notice that for , the entries of and are continuous in as long as the phase of is unchanged,
Since for , by continuity, .
In the case , use to rewrite as,
Now implies that and the condition implies , so the expression for reduces to
By construction
which gives
This completes the proof.
Theorem 2.1 shows that the product can be refactored into a new set of core transformations,
where is the same as except for the unimodular factors and , and computing a similarity transform with the matrix preserves the structure of the initial similarity transform, only one row lower and one column to the right,
Repeating this process times completes a single step of the unitary core-chasing algorithm,
Connection to symmetric tridiagonal QR
The formulas in Theorem 2.1 are possible thanks to the special structure of unitary upper Hessenberg matrices. Symmetric tridiagonal matrices also possess a similar structure that allows for the efficient implementation of Francis’ single-shift QR algorithm. Even though the algorithm is not a core-chasing algorithm in the sense of [2], the structure is remarkably similar. As an illustrative example, consider the following symmetric tridiagonal matrix,
Given a real shift , the QR iteration begins by applying the similarity transform where is the following core transformation,
with , and . The effect of this similarity transform is to create a nonzero bulge in the and entries of ,
The algorithm proceeds by constructing a core transformation that removes the bulge and returns the matrix to tridiagonal form,
Moving over to gives the equivalent of a turnover for symmetric tridiagonal matrices,
The following formulas can be used to compute the entries of and the first row and column of in exact arithmetic1,
As we can see, these formulas are similar in structure to those used in the symmetric turnover for unitary matrices, with the main differences being the need for complex arithmetic and the phase-tracking variable in the unitary case.
Nearly-Unitary Matrices
Although the results of Theorem 2.1 allow us to compute the turnover efficiently in exact arithmetic, the current formulas are not stable and do not permit the development of a square-root-free symmetric turnover. The instabilities come from the fact that the floating-point representations of the parameters and can no longer be guaranteed to satisfy exactly, and from the possibility of cancellation when computing the turnover in floating-point arithmetic.
Similar numerical instabilities were present in Gragg’s first unitary QR algorithm [12] based on recurrence relations for Szegő polynomials. In [14], Gragg introduced a new change of variables for these relations that appeared to remove these instabilities and also allowed for a square-root-free implementation, though no proof was given. A proof of stability of these recurrence-based algorithms was given by Stewart in [23].
In this and the following sections, we will show that a similar change of variables to that found in [14] can be used to stabilize the symmetric turnover and to develop a square-root-free implementation. We will also show that these versions of the symmetric turnover are stable when applied to matrices that are only nearly-unitary in floating-point arithmetic.
A change of variables
In its current form, the symmetric turnover is not stable and does not allow for a square-root-free implementation. The main impediment is the formula for ,
When computed in floating-point arithmetic, the product followed by the addition with is prone to cancellation as the following example illustrates.
Example 3.1 (Instability of the Symmetric Turnover Before Changing Variables). Let denote the unit roundoff for double precision and let denote rounding to nearest. Define
and consider the floating-point input parameters
Since
and
the input parameters are unitary to working precision. The corresponding input product is diagonal and satisfies
Now compute the symmetric turnover in floating-point arithmetic using the formulas in Theorem 2.1. The first intermediate quantity is
Since , floating-point evaluation gives
Since
It follows that
The remaining output parameters are
The corresponding computed output product satisfies
Consequently,
Both nonzero diagonal entries of the leading term have modulus one, and hence
Thus, even though the input parameters represent core transformations that are unitary to working precision, evaluation of the symmetric turnover in Theorem 2.1 can produce an error in the resulting product.
In addition to the possibility of cancellation, the square-root-free turnover that we develop in the next section requires computing directly from , something the current formula for does not easily allow.
Fortunately, both of these problems are avoidable if we make a few changes of variables. The first change is to express in polar form, . Applying this change to and factoring out gives the following,
We then introduce the additional variables and , defined by
which allows us to rewrite as,
The expression for uses only multiplication, which aids stability and the development of a square-root-free version. The formula for , however, can still suffer cancellation when . Using another idea from [14], we can derive an alternative formula for by multiplying by ,
where we used . This gives the following alternatives for computing ,
The branch conditions are chosen so that there is never cancellation in or . Gragg suggested without proof that this alternative formulation for was stable because it uses in the case which implies and . As we will see later, the reason for the improved stability is more subtle.
For now we continue rewriting the symmetric turnover formulas using , and the polar decompositions and :
Notice that is no longer explicitly computed, since we can update and directly using and the other input variables.
Let , and be inputs of the symmetric turnover, after applying the preceding change of variables,
and , and be the corresponding outputs,
where the values of and have been replaced by and , respectively. Corollary 3.2 shows how to compute the symmetric turnover using the revised formulas.
Corollary 3.2 (Symmetric Turnover). Given unimodular complex numbers , and , a complex number , and nonnegative real numbers , and such that
and , define the following,
if :
else:
Then,
Proof. The principal difference with the symmetric turnover formulas in Theorem 2.1 is the addition of the variables and . In the branch, the definition of requires that . For unitary inputs both formulas for give the same result. Using the branch, notice that , thus . Therefore, . When , and is not uniquely defined, so it is set equal to 1 for simplicity. The rest of the proof follows directly from Theorem 2.1 and the previously discussed changes of variables.
Nearly-unitary matrices
Just as in the symmetric tridiagonal case, the symmetry in the unitary core-chasing algorithm comes directly from the underlying unitary structure of the core transformations. Unlike the symmetric case, representing matrices that are exactly unitary is typically not possible using floating-point numbers. Take for example . Define and to be their nearest floating-point number approximations, then in exact arithmetic , but , since is irrational.
Fortunately, even though , there exists such that . If is not too large, say on the order of machine precision, we can think of the parameters and as representing a core transformation that is nearly-unitary.
We say that the core transformation is nearly-unitary if there exists such that
and, equivalently, that the corresponding parameters and are nearly-unitary if
We refer to as the unitary defect for the parameters and .2
Since the symmetric turnover is only defined for unitary matrices, we need to analyze what happens when the input core transformations are only nearly-unitary. While the analysis that follows is true for any modest value of , in practice is on the order of machine precision and the constant in the term is on the order of .
Fortunately, as the following theorem demonstrates, if the inputs to the symmetric turnover are nearly-unitary, then the outputs are also nearly-unitary and the products and are close.
Theorem 3.3 (Exactness of Symmetric Turnover for Nearly-Unitary Inputs). Assume that the inputs of Corollary 3.2 are nearly-unitary for . Then, for sufficiently small, the corresponding outputs are also nearly-unitary with respect to the same and
Proof. Since the inputs are nearly-unitary, their unitary defects are all real and ,
For sufficiently small, the unitary defects are all strictly less than 1 in absolute value, so we can project the nearly-unitary inputs onto nearby inputs that represent exactly unitary core transformations as follows,
The same can be taken sufficiently small such that the projected inputs also satisfy
Now let , and be the input core transformations to the symmetric turnover defined in terms of the projected parameters , , , , , and . Then, it follows directly that
Since , , , , , and represent core transformations that are exactly unitary, applying the symmetric turnover from Corollary 3.2 results in outputs , , , , and that correspond to the exactly unitary core transformations , and which satisfy
To finish the proof we must show that the outputs of applying the symmetric turnover to the nearly-unitary inputs are also nearly-unitary, and that the corresponding core transformations , and satisfy
To show this, we apply the symmetric turnover from Corollary 3.2 to the nearly-unitary inputs and track how the relative errors from projecting them to the exactly unitary inputs propagate. The first step is to compute ,
This says that when is sufficiently small, the relative errors introduced from projecting the nearly-unitary inputs translate into small relative errors in the parameter computed using the exactly unitary inputs. What is not shown explicitly is that this relative error is real and positive. That is because the projections were performed using real, positive scalars. Since and differ by a real positive multiple, the sign of and are the same, which preserves the branch structure. When we have that
where we used the fact that there is no cancellation in . When we have
where we used the fact that and are orthogonal and that there is no cancellation in . Although the relative errors from projecting the inputs were real, the relative error between and is, in general, complex. The last internal parameter is ,
where we used the fact that there is no cancellation when computing the sum of squares and that the square-root preserves small relative errors for sufficiently small.
Even though the relative errors in are complex, the relative error between and is real and positive, so the branch condition on is preserved. Applying a similar analysis to the output variables in both branches yields the following,
Apart from , the relative errors introduced by projecting the nearly-unitary inputs resulted in similar relative errors between these outputs and the exactly unitary ones. Even with the absolute error in , this shows that for sufficiently small , the outputs of the symmetric turnover applied to nearly-unitary inputs are also nearly-unitary. Moreover, the corresponding core transformations satisfy
Combining this with the previous results gives
which completes the proof.
Theorem 3.3 can be seen as a type of mixed stability result for the symmetric turnover for data that is only nearly-unitary. Namely, there exist nearby exactly unitary inputs whose outputs are close to the outputs computed using the nearly-unitary data.
Two formulas for
We conclude this section with an explanation of why the alternative formula for proposed by Gragg is needed for stability, even when computing in exact arithmetic. Recall that in the proof of Corollary 3.2 we used the fact that implies to show that is always well-defined. For inputs that are only nearly-unitary, the formula does not guarantee this in general. Take, for example,
for . Then, and , but . So even though . Since we should instead use the alternative formula for ,
Using this definition, as expected.
For unitary core transformations, both formulas for are equal, so the instability can only be seen for nearly-unitary inputs. As this example illustrates, must imply so that is also 0. The alternative formula for guarantees that this cannot happen, thus avoiding this potential instability.
A Square-Root-Free Symmetric Turnover
In this section we show how to compute the symmetric turnover from Corollary 3.2 implicitly without computing any square roots. This result is similar to the square-root-free QR algorithms for symmetric tridiagonal matrices [8, 19] and to the rational QR algorithms for unitary matrices [14, 23].
In this section we also show how to control the growth of the unitary defects of the iteration parameters throughout the core-chasing steps. This involves projecting the nearly-unitary outputs of the symmetric and square-root-free turnovers onto nearby, nearly-unitary outputs with smaller defects. Since the defects are small, this projection can be done without computing any square roots using a degree-one Taylor polynomial.
Casting out the square roots
In the branch, the symmetric turnover in Corollary 3.2 computes two square roots,
To avoid computing these square roots, we should work with and directly, which requires that we square all variables that depend on and . For this gives,
Notice that , , and are all unchanged. For the remaining variables, we compute their squares using , and the squares of the inputs. We can simplify this further if we combine and into a new variable . Defining the corresponding output , the symmetric turnover reduces to
The phase tracking variable has been absorbed by and is no longer explicitly needed. The following corollary shows that computing the symmetric turnover without square roots is equivalent to computing the turnover using square roots for a corresponding set of unsquared inputs.
Corollary 4.1 (Square-Root-Free Symmetric Turnover). Given unimodular complex numbers , and , a complex number , and nonnegative real numbers , and such that and , define the following,
if :
else:
Then, for
and
where the square roots are chosen so that the real variables are nonnegative and
Proof. The result follows directly from Corollary 3.2.
Corollary 4.1 says that we can implicitly compute the symmetric turnover without square roots if we work with , , and directly. While this saves two expensive square-root computations, it comes at a cost. Namely, we no longer store the or explicitly, and without we cannot compute eigenvectors. When calculating eigenvalues, , and the eigenvalues are recovered using the . Since the are computed explicitly, the eigenvalues can be computed without using square roots.
Square-root-free renormalization
In the original unitary QR algorithm in [12] Gragg noted an instability caused by a gradual increase in the unitary defect for the pair and . A practical solution is to project the parameters back onto the unit circle after every iteration. If the unitary defect is small, then the projection errors are small and relative,
Theorem 3.3 says that the outputs of the symmetric turnover are nearly-unitary whenever the inputs are. Although not given explicitly, even for inputs with unitary defects on the order of machine precision, the defects of the output variables are, in the worst case, on the order of 10 times larger.
Since we also need to renormalize in the square-root-free turnover, we would prefer to avoid computing these additional square roots if possible. One option is to compute the defects and check if they are below some threshold. If they are small enough, the renormalization step can be skipped. Otherwise, renormalization is performed using square roots. While this may save computing some of the square roots, there is no guarantee that they can be avoided in general. A more universal approach is to use the fact that the defects are small and approximate with a degree-one Taylor polynomial. For sufficiently small, the Taylor remainder theorem says that
So, if and are nearly-unitary with defect , then
are nearly-unitary with defect .
For defects on the order of machine precision, renormalizing using a degree one Taylor polynomial is sufficient for reducing any growth in the defects to an acceptable level. Even in exact arithmetic, we cannot expect the defects to be smaller than the unit roundoff since and will also be approximated by floating-point numbers.
This formula for renormalization requires computing the defect , which is susceptible to cancellation. An alternative formula that avoids this cancellation first computes then renormalizes via the formulas,
For the square-root-free turnover, we have to renormalize instead of . Using a degree-one Taylor polynomial, this becomes
where and . Similarly, first order renormalization for the variables , and as follows
The variables and , as well as and , are normalized by construction and therefore do not need to be renormalized. The results of Theorem 3.3 still apply for the turnovers with renormalization since the first order corrections introduce at most relative errors. Algorithms 4.1 and 4.2 give pseudocode for computing the symmetric and square-root-free turnovers with renormalization.
Algorithm 4.1: Symmetric Turnover with Renormalization
Require: u, v, c, s, σ, γ, ρ
t = γσ
if Re(t) ≥ 0 then
z = 1 + t
else
z = (v² + 2 Im(t)i)/(1 − t)
end if
n = √(c²|z|² + v²)
if n > 0 then
c̄ = c|z|/n
σ̄ = −ρσz̄/|z|
s̄ = v/n
ū = ρ(s²u − γσ²c²)
v̄ = ns
else
c̄ = 0
σ̄ = 1
s̄ = 1
ū = ρu
v̄ = 0
end if
γ̄ = −ργ
Renormalization
x = |ū|² + v̄²
ū = ū(3 − x)/2
v̄ = v̄(3 − x)/2
σ̄ = σ̄(3 − |σ̄|²)/2
γ̄ = γ̄(3 − |γ̄|²)/2
return ū, v̄, c̄, s̄, σ̄, γ̄
Algorithm 4.2: Square-Root-Free Symmetric Turnover with Renormalization
Require: u, vv, cc, ss, ω, ρ
t = ωu
if Re(t) ≥ 0 then
z = 1 + t
else
z = (vv + 2 Im(t)i)/(1 − t)
end if
zz = Re(z)² + Im(z)²
nn = cc · zz + vv
if nn > 0 then
c̄c = cc · zz/nn
ω̄ = −ρωz²/zz
s̄s = vv/nn
ū = ρ(ss · u − cc · ω)
v̄v = nn · ss
else
c̄c = 0
ω̄ = 1
s̄s = 1
ū = ρu
v̄v = 0
end if
Renormalization
x = |ū|² + v̄v
ū = ū(3 − x)/2
v̄v = v̄v(2 − x)
ω̄ = ω̄(3 − |ω̄|²)/2
return ū, v̄v, c̄c, s̄s, ω̄
Numerical Stability
In this section we will show that the symmetric and square-root-free turnovers in Algorithms 4.1 and 4.2 are backward stable, which is enough to guarantee that the entire core-chasing iteration is backward stable [2]. We will also show in Example 5.4 that even in exact arithmetic we cannot expect the turnover to be exact for matrices that are only nearly-unitary. Since the floating-point representations of the core transformations are almost never exactly unitary, we cannot expect any sort of structured backward error result, at least not in a strict sense. Instead we will prove normwise backward stability for the input core transformations to the turnover.
Forward stability
The first result is a mixed forward-backward error result when computing the turnover in floating-point arithmetic. Our analysis assumes that the standard axioms of floating-point arithmetic hold. See [16], for example. Let be the unit roundoff. Then, for floating-point numbers and , possibly complex, we assume the following,
The following lemma shows that both the symmetric and square-root-free turnovers are forward stable.
Lemma 5.1 (Forward Stability of Algorithm Algorithm 4.1). Assume the matrices , and are stored in floating point and nearly-unitary with defects, and let , and be the outputs of the symmetric turnover computed via Algorithm 4.1. Then,
Proof. The first step is to compute from the inputs , and . Since this is done via complex multiplication, it follows that
Unlike Theorem 3.3, the relative error is complex in general. So, even though the relative errors in are small, the relative errors in and may be large. This means that does not necessarily preserve the branch structure for computing , except in the case .
To avoid this complication, the forward error in can be interpreted as a backward error for the input . Assume and define as
Then, and . Next, define and using and the other unperturbed inputs,
It follows immediately that
Applying Algorithm 4.1 to the inputs , , , , , and in exact arithmetic gives outputs and , and corresponding matrices and that satisfy
To complete the proof it is enough to show that
from which it follows that
In exact arithmetic, the first step in the turnover using is
So using in exact arithmetic produces the same value for as using in floating-point arithmetic. This means that the branching condition for is maintained. For ,
For the branch ,
Since and are real, and are orthogonal, so their rounding errors are real and orthogonal and there is no cancellation. Therefore, the rounding errors in satisfy
Applying a similar analysis to , , , and gives
before renormalization. For and , extra care has to be taken to account for the difference between and ,
Thus, before renormalization, the and variables are close. Since they are also nearly-unitary with defects, the errors introduced from renormalization, including the additional rounding errors, are relative and , and the outputs remain within of each other.
Lemma 5.1 says that computing Algorithm 4.1 in floating-point arithmetic gives a factorization that is still within of the product of the inputs as long as their nearly-unitary defects are also . As the following corollary shows, the same is true for the square-root-free turnover in Algorithm 4.2.
Corollary 5.2 (Forward Stability of Algorithm 4.2). Assume the matrices , and are stored in floating point and nearly-unitary with defects, and let , and be the outputs of the symmetric turnover computed implicitly via Algorithm 4.2. Then,
Proof. The proof follows from Lemma 5.1 and the arguments in Theorem 3.3 and Corollary 4.1.
Backward stability
We are now ready to show backward stability of the symmetric and square-root-free turnovers. The following theorem shows that the previous forward error results can be interpreted as backward errors in the input matrices, as long as they are nearly-unitary.
Theorem 5.3 (Backward Stability of Algorithms 4.1 and 4.2). Let , and , and , and be as in Lemma 5.1 and Corollary 5.2. Then, there exists such that,
Proof. By Lemma 5.1, there exists such that
Since and are nearly-unitary, and exist and are also nearly-unitary with defects. Define as,
Then,
which completes the proof. □
Theorem 5.3 says that computing the symmetric turnover in floating-point arithmetic for inputs that are nearly-unitary with defects computes a factorization that is exact for a nearby input matrix . This means that the symmetric turnover and the entire core-chasing step are backward stable [2]. While is a core transformation, is almost surely not, which means the errors in are not confined to the nontrivial block . Example 5.4 shows that we cannot expect structured errors for nearly-unitary matrices, so this result is not surprising.
Structured backward error
The question remains as to whether the backward stability in Theorem 5.3 can be further refined into a form of structured backward stability. In the strictest sense this would mean mapping the forward errors in the computed outputs to backward errors on the input parameters that define the core transformations. The following example shows that the symmetric turnover is not, in general, exact for nearly-unitary matrices. This immediately implies that for computed outputs that are only nearly-unitary, there is no way to convert forward errors in the outputs of the turnover into backward errors on the inputs.
Example 5.4 (Impossibility of Structured Backward Error for Nearly-Unitary Outputs). For , define the following nearly-unitary output parameters of the symmetric turnover,
These parameters are all nearly-unitary, so the following product is also nearly-unitary,
Suppose there exist input parameters , , , , and such that
Expanding the product of the input factors gives
Comparing the entries gives , and hence . Comparing the entries then gives . Since , this implies . However, comparing the entries gives
Since , the right-hand side is nonzero, contradicting . Therefore there exist no input parameters such that
In particular, the nearly-unitary output factors cannot, in general, be interpreted as the exact symmetric turnover of nearby nearly-unitary input core transformations.
Example 5.4 shows that we cannot expect the symmetric turnover to be exact when working with inputs that are only nearly-unitary, even when computed in exact arithmetic. Since the forward errors caused by computing in floating-point arithmetic will almost surely result in outputs that are only nearly-unitary, we cannot expect to be able to find perturbed inputs that make the turnover exact.
Numerical Experiments
In this section we present several numerical experiments to illustrate the effects of removing the square roots from the computations.
Square roots are expensive
The goal of our first experiment is to show why removing square roots is so important. While it is true that the double-precision operations , , and can all be computed with the same high relative accuracy, the latency, or number of clock cycles it takes to execute each operation, can be quite different, even for modern processors. The results published in [9] suggest that the operations and require on average 2–5 times more cycles than the operations and for real, double-precision variables.
Figure 6.1 shows the total clock time for computing sequential operations of each type on an Intel Core i7-4790 processor. Here we clearly see that and require more time on average than and when executed sequentially.
Figure 6.1. Total compute time in seconds for executing sequential, real, double-precision operations of each type on an Intel Core i7-4790 processor.
Square-root-free unitary core-chasing
Our second experiment compares the runtime and accuracy of using four different methods to compute the roots of unity, i.e., the zeros of the polynomial . This can be reformulated as a unitary upper Hessenberg eigenvalue problem using the companion matrix. The four methods we compare are the dense QR algorithm for complex upper Hessenberg matrices zhseqr from LAPACK, the unitary core-chasing algorithm from [3], denoted UQR, and Algorithms 4.1 and 4.2, denoted SYMUQR and RFUQR, respectively. The code for the methods UQR, SYMUQR, and RFUQR is available at github.com/eiscor/eiscor.
Figure 6.2 plots the average runtime and the worst forward error in the computed roots of unity. From the plot of average runtime we can see the difference between the complexity of dense QR from LAPACK and the algorithms that exploit the special unitary upper Hessenberg structure. From the plot of worst-case forward errors in the computed eigenvalues we can see that all four methods have comparable accuracy, computing approximate eigenvalues that are within a modest multiple of machine precision of the true roots.

Figure 6.2. Runtime and accuracy for computing the roots of unity using four different algorithms.
Table 6.1 gives the runtime and accuracy of the four methods for the specific value . From the last three columns it is clear that exploiting the unitary upper Hessenberg structure greatly reduces the overall runtime when compared to LAPACK. The last two columns also show that exploiting symmetry and removing square roots can further reduce the total runtime, even when compared to other methods that exploit this structure.
| LAPACK | UQR | SYMUQR | RFUQR | |
| Runtime (sec) | 629 | 1.02 | 0.85 | 0.65 |
| Accuracy |
Table 6.1. Runtime and accuracy of the four methods for the case .
Conclusions
In this article we presented a matrix-based derivation of a square-root-free unitary core-chasing algorithm for computing eigenvalues of unitary upper Hessenberg matrices. The derivation is based on a symmetry in the turnover operation used in the unitary core-chasing algorithm from [3], which reduces the arithmetic needed to perform the core-chasing step and exposes the connection with square-root-free QR algorithms for symmetric tridiagonal matrices. We showed that the naïve symmetric turnover formulas can be unstable when the core transformations are only nearly-unitary, as occurs in floating-point arithmetic, and introduced a change of variables, analogous to Gragg’s stabilized recurrence, that avoids this cancellation and leads to a stable symmetric turnover for nearly-unitary data. The same change of variables also makes it possible to derive a square-root-free version of the algorithm. The floating-point analysis shows that both the symmetric and square-root-free turnovers are stable for nearly-unitary input, and that the resulting forward error can be converted into a local backward error result for the turnover, although a strict structured backward error result is impossible in general. Finally, the numerical experiments demonstrate that the combination of exploiting the symmetry in the turnover and casting out square roots gives accuracy comparable to LAPACK and to the unitary core-chasing algorithm in [3], while reducing the overall runtime.
Acknowledgments. OpenAI ChatGPT was used during the preparation of this manuscript to assist with checking mathematical derivations, exploring examples, literature searches, and improving the presentation of the manuscript. All mathematical arguments, references, computations, and conclusions were independently reviewed and verified by the authors. The authors assume responsibility for all content.
References
References
- [1]G. S. Ammar, W. B. Gragg, and L. Reichel, On the eigenproblem for orthogonal matrices, in Proc. 25th IEEE Conf. Decision Control, 1986, pp. 1963–1966, https://doi.org/10.1109/CDC.1986.267356.
- [2]J. L. Aurentz, T. Mach, L. Robol, R. Vandebril, and D. S. Watkins, Core-chasing Algorithms for the Eigenvalue Problem, SIAM, Philadelphia, PA, 2018, https://doi.org/10.1137/1.9781611975345.
- [3]J. L. Aurentz, T. Mach, R. Vandebril, and D. S. Watkins, Fast and stable unitary QR algorithm, Electron. Trans. Numer. Anal., 44 (2015), pp. 327–341, https://etna.ricam.oeaw.ac.at/volumes/2011-2020/vol44/pp327-341.dir/pp327-341.pdf.
- [4]B. Bohnhorst, Ein Lanczos-ähnliches Verfahren zur Lösung des unitären Eigenwertproblems, PhD thesis, Universität Bielefeld, 1993, https://pub.uni-bielefeld.de/record/1784310.
- [5]A. Bunse-Gerstner, An algorithm for the unitary eigenproblem, Numer. Math., 45 (1984), pp. 1–12, https://doi.org/10.1007/BF01389710.
- [6]J. J. M. Cuppen, A divide-and-conquer method for the symmetric tridiagonal eigenproblem, Numer. Math., 36 (1980), pp. 177–195, https://doi.org/10.1007/BF01396757.
- [7]A. Dubrulle, R. S. Martin, and J. H. Wilkinson, The implicit QL algorithm, Numer. Math., 12 (1968), pp. 377–383, https://doi.org/10.1007/BF02161260.
- [8]Y. S. Feng, Stability analysis of some root-free QR algorithms for symmetric tridiagonal matrices, PhD thesis, University of California-Berkeley, 1991, https://www.proquest.com/dissertations-theses/stability-analysis-root-free-qr-algorithms/docview/303926557.
- [9]A. Fog, Instruction tables: Lists of instruction latencies, throughputs, and micro-operation breakdowns for Intel, AMD, and VIA CPUs, 2025, https://www.agner.org/optimize/instruction_tables.pdf.
- [10]H. H. Goldstine and L. P. Horwitz, A procedure for the diagonalization of normal matrices, J. ACM, 6 (1959), pp. 176–195, https://doi.org/10.1145/320964.320975.
- [11]G. H. Golub and C. F. Van Loan, Matrix Computations, Johns Hopkins University Press, Baltimore, MD, 4th ed., 2013, https://doi.org/10.56021/9781421407944.
- [12]W. B. Gragg, The QR algorithm for unitary Hessenberg matrices, J. Comput. Appl. Math., 16 (1986), pp. 1–8, https://doi.org/10.1016/0377-0427(86)90169-X.
- [13]W. B. Gragg, Stabilization of the UHQR algorithm, tech. report, Naval Postgraduate School, 1997, https://apps.dtic.mil/sti/pdfs/ADA329745.pdf.
- [14]W. B. Gragg, Stabilization of the UHQR algorithm, Adv. Comput. Math., 10 (1999), pp. 139–154, https://doi.org/10.1023/A:101893927025.
- [15]W. B. Gragg and L. Reichel, A divide and conquer method for unitary and orthogonal eigenproblems, Numer. Math., 57 (1990), pp. 695–718, https://doi.org/10.1007/BF01386438.
- [16]N. J. Higham, Accuracy and Stability of Numerical Algorithms, SIAM, Philadelphia, PA, 2002, https://doi.org/10.1137/1.9780898718027.
- [17]C. G. J. Jacob, Über einige Verfahren die in der theorie der säcularstörungen vorkommenden gleichungen numerisch aufzulösen, J. Reine Angew. Math., 30 (1846), pp. 51–94, https://eudml.org/doc/147275.
- [18]C. Lanczos, An Iteration Method for the Solution of the Eigenvalue Problem of Linear Differential and Integral Operators, U.S. Government Printing Office, Washington, DC, 1950, https://resolver.caltech.edu/CaltechAUTHORS:20140819-111140202.DOI
- [19]J. M. ORTEGA AND H. F. KAISER, The LL^T and QR methods for symmetric tridiagonal matrices, Comput. J., 6 (1963), pp. 99–101, https://doi.org/10.1093/comjnl/6.1.99.
- [20]B. N. PARLETT, The Symmetric Eigenvalue Problem, SIAM, Philadelphia, PA, 1998, https://doi.org/10.1137/1.9781611971163.
- [21]M. STEWART, An error analysis of a unitary Hessenberg QR algorithm, Technical Report TR-CS-98-11, The Australian National University, Canberra, Australia, Dec. 1998, http://hdl.handle.net/1885/40737. Joint Computer Science Technical Report Series, Department of Computer Science, Faculty of Engineering and Information Technology, and Computer Sciences Laboratory, Research School of Information Sciences and Engineering.
- [22]M. STEWART, Stability properties of several variants of the unitary Hessenberg QR algorithm, Contemp. Math., 281 (2001), pp. 57–72, https://doi.org/10.1090/conm/281/04649.
- [23]M. STEWART, An error analysis of a unitary Hessenberg QR algorithm, SIAM J. Matrix Anal. Appl., 28 (2006), pp. 40–47, https://doi.org/10.1137/04061948X.
- [24]T. WANG AND W. B. GRAGG, Convergence of the shifted QR algorithm for unitary Hessenberg matrices, Math. Comp., 71 (2002), pp. 1473–1496, https://doi.org/10.1090/S0025-5718-01-01387-4.
