romtools.vector_space.utils.orthogonalizer#

The OrthogonalizerClass is used to orthogonalize a basis at the end of the construction of a vector space. Specifically, given a basis .. math:

\boldsymbol \Phi \in \mathbb{R}^{N \times K}

the orthogonalizer will compute a new, orthogonalized basis \(\boldsymbol \Phi_{\*}\) where .. math:

\boldsymbol \Phi_{\*}^T \mathbf{W} \boldsymbol \Phi_{\*} = \mathbf{I}.

In the above, \(\mathbf{W}\) is a weighting matrix (typically the cell volumes).

Classes

EuclideanL2Orthogonalizer([qrFnc])

Orthogonalizes the basis in the standard Euclidean L2 inner product, i.e., the output basis will satisfy .. math::.

EuclideanMatrixWeightedL2Orthogonalizer(...)

Orthogonalizes the basis in an SPD matrix-weighted Euclidean L2 inner product, i.e., the output basis will satisfy .. math::.

EuclideanVectorWeightedL2Orthogonalizer(...)

Orthogonalizes the basis in vector-weighted Euclidean L2 inner product, i.e., the output basis will satisfy .. math::.

NoOpOrthogonalizer()

No op class (doesn't do anything)

Orthogonalizer(*args, **kwargs)

Interface for the Orthogonalizer class.

class romtools.vector_space.utils.orthogonalizer.EuclideanL2Orthogonalizer(qrFnc=None)[source]#

Bases: object

Orthogonalizes the basis in the standard Euclidean L2 inner product, i.e., the output basis will satisfy .. math:

\boldsymbol \Phi_{\*}^T \boldsymbol \Phi_{\*} = \mathbf{I}.

This class conforms to Orthogonalizer protocol.

orthogonalize(my_array)[source]#

Orthogonalizes the input matrix and returns the orthogonalized matrix.

Parameters:

my_array (np.ndarray) – The input matrix to be orthogonalized.

Returns:

The orthogonalized matrix.

Return type:

np.ndarray

class romtools.vector_space.utils.orthogonalizer.EuclideanMatrixWeightedL2Orthogonalizer(weighting_matrix, qrFnc=None)[source]#

Bases: object

Orthogonalizes the basis in an SPD matrix-weighted Euclidean L2 inner product, i.e., the output basis will satisfy .. math:

\boldsymbol \Phi_{\*}^T \mathbf{M}\boldsymbol \Phi_{\*} = \mathbf{I},

where \(\mathbf{M}\) is the SPD weighting matrix. Typically, this inner product is used for orthogonalizing with respect to a mass matrix

This class conforms to Orthogonalizer protocol.

Parameters:

weighting_matrix (ndarray)

orthogonalize(my_array)[source]#

Orthogonalizes the input matrix using the specified weighting matrix and returns the orthogonalized matrix.

Parameters:

my_array (np.ndarray) – The input matrix to be orthogonalized.

Returns:

The orthogonalized matrix.

Return type:

np.ndarray

class romtools.vector_space.utils.orthogonalizer.EuclideanVectorWeightedL2Orthogonalizer(weighting_vector, qrFnc=None)[source]#

Bases: object

Orthogonalizes the basis in vector-weighted Euclidean L2 inner product, i.e., the output basis will satisfy .. math:

\boldsymbol \Phi_{\*}^T \mathrm{diag}(\mathbf{w})\boldsymbol \Phi_{\*} = \mathbf{I},

where \(\mathbf{w}\) is the weighting vector. Typically, this inner product is used for orthogonalizing with respect to cell volumes

This class conforms to Orthogonalizer protocol.

Parameters:

weighting_vector (ndarray)

orthogonalize(my_array)[source]#

Orthogonalizes the input matrix using the specified weighting vector and returns the orthogonalized matrix.

Parameters:

my_array (np.ndarray) – The input matrix to be orthogonalized.

Returns:

The orthogonalized matrix.

Return type:

np.ndarray

class romtools.vector_space.utils.orthogonalizer.NoOpOrthogonalizer[source]#

Bases: object

No op class (doesn’t do anything)

This class conforms to Orthogonalizer protocol.

orthogonalize(my_array)[source]#

Returns the input array.

Parameters:

my_array (ndarray)

Return type:

ndarray

class romtools.vector_space.utils.orthogonalizer.Orthogonalizer(*args, **kwargs)[source]#

Bases: Protocol

Interface for the Orthogonalizer class.