BASIS_COMPARE
Compare two basis sets.


BASIS_COMPARE is a FORTRAN90 program which compares the amount of overlap between two basis sets.

In an M-dimensional space, a set of N orthonormal vectors U is provided, which span some subspace. We let Q be the M by N matrix whose columns are an orthogonal basis for the span of the vectors U(1:N). (We'll assume for now that the vectors U are linearly independent. Otherwise, Q could actually have fewer "interesting" columns than U.)

One or more M-vectors V are then considered. For each V, it is desired to know the proportion of the vector that lies within and outside the subspace spanned by U. V admits an orthogonal decomposition of the form:


        V = V1 + V2
      
where

The values

must lie between 0 and 1; their squares must sum to 1, and indicate the portion of V which lies within the U subspace, and the portion which lies in the orthogonal complement. Equivalently, the angle THETA between V and the subspace is determined by

        TAN ( THETA ) = BETA / ALPHA.
      

To compute ALPHA, we realize that Q' * V produces the N by 1 vector of projection coefficients of V onto each U(I). Therefore, V1, the orthogonal projection of V into U is Q * ( Q' * V ):


        V1 =       Q * Q'   * V
      
and the "remainder" is:

        V2 = ( I - Q * Q' ) * V
      
from which we can determine ALPHA and BETA, and finally THETA.

Such sets are computed, for example, by CVT_BASIS_FLOW, POD_BASIS_FLOW, and SVD_BASIS, However, somewhat inconveniently, these programs are working with velocities, and store each vector in a pair of columns. For now, we have set up the program to expect the input data to have this format. Moreover, rather than comparing the two bases directly, we read in one basis to use as U, and then each vector of the other basis is checked against U. Also, U and V already consist of orthonormal columns, so the QR factorization of U is simply


        U = Q * R = U * I.
      

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

BASIS_COMPARE is available in a FORTRAN90 version.

Related Data and Programs:

CVT_BASIS_FLOW, a FORTRAN90 program which extracts a basis from a set of velocity snapshots using CVT methods.

POD_BASIS_FLOW, a FORTRAN90 program which extracts a basis from a set of velocity snapshots using POD methods.

SVD_BASIS, a FORTRAN90 program which extracts a basis from any set of vectors, using POD methods.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the FORTRAN90 source codes.


Last revised on 26 November 2006.