Lably
Skip to content

Bartels–Stewart algorithm

Algorithm in numerical linear algebra

  • 2 min read
  • 4 chapters

Explore on Lably

ToursExplore Lably’s 3D tours

The algorithm

Let X,C∈Rm×n, and assume that the eigenvalues of A are distinct from the eigenvalues of B. Then, the matrix equation AX−XB=C has a unique solution. The Bartels–Stewart algorithm computes X by applying the following steps:

1.Compute the real Schur decompositions

R=UTAU,
S=VTBTV.

The matrices R and S are block-upper triangular matrices, with diagonal blocks of size 1×1 or 2×2.

2. Set F=UTCV.

3. Solve the simplified system RY−YST=F, where Y=UTXV. This can be done using forward substitution on the blocks. Specifically, if sk−1,k=0, then

(R−skkI)yk=fk+∑j=k+1nskjyj,

where yk is the kth column of Y. When sk−1,k≠0, columns [yk−1∣yk] should be concatenated and solved for simultaneously.

4. Set X=UYVT.

Computational cost

Using the QR algorithm, the real Schur decompositions in step 1 require approximately 10(m3+n3) flops, so that the overall computational cost is 10(m3+n3)+2.5(mn2+nm2).

Simplifications and special cases

In the special case where B=−AT and C is symmetric, the solution X will also be symmetric. This symmetry can be exploited so that Y is found more efficiently in step 3 of the algorithm.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Topics in mathematics