NLA-lib Explorer

Principal angles between subspaces

Library · Source module

Principal angles between subspaces

The principal angles between the column spaces of two matrices \mathbf{X} and \mathbf{Y} are NLAlib.principalAngle X Y k, written \theta_k(\mathbf{X}, \mathbf{Y}), k = 0, 1, \dots, in non-decreasing order. Their cosines are the singular values of the product \mathbf{P}_{\mathbf{X}}\mathbf{P}_{\mathbf{Y}} of the two orthogonal projectors; for matrices \mathbf{U}, \mathbf{V} with orthonormal columns these are the singular values of \mathbf{U}^{\mathsf{H}}\mathbf{V}. The sines are the singular values of (\mathbf{I} - \mathbf{P}_{\mathbf{X}})\mathbf{P}_{\mathbf{Y}}. The tangents are the singular values of the tangent matrix, in NLAlib.Matrix.Subspaces.Tangent.

The angle depends only on the column spaces, so \mathbf{X} and \mathbf{Y} may be orthonormal frames, arbitrary bases, or the projectors themselves. Beyond the smaller of the two dimensions the angle is \pi / 2.

Statements about distances between subspaces are made with the matrices, in a norm: \|(\mathbf{I} - \mathbf{P})\mathbf{Q}\|_2, \|(\mathbf{I} - \mathbf{P})\mathbf{Q}\|_{\mathsf{F}}. This file identifies those norms with the angles.

Main definitions

* NLAlib.principalAngle: the k-th principal angle between two column spaces.

Main results

* NLAlib.HasOrthonormalCols.principalAngle_mul_left, NLAlib.principalAngle_submatrix_equiv: invariance under an isometry of the ambient space and under relabelling. * NLAlib.cos_principalAngle, NLAlib.HasOrthonormalCols.cos_principalAngle: cosines. * NLAlib.singularValues_one_sub_rangeProjector_mul_rangeProjector: sines. * NLAlib.specNorm_one_sub_rangeProjector_mul_rangeProjector, NLAlib.specNorm_rangeProjector_sub_rangeProjector: the largest angle as a distance.

Declarations