Page MenuHomec4science

pod_engine_base.py
No OneTemporary

File Metadata

Created
Wed, Feb 26, 03:59

pod_engine_base.py

# Copyright (C) 2018 by the RROMPy authors
#
# This file is part of RROMPy.
#
# RROMPy is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RROMPy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with RROMPy. If not, see <http://www.gnu.org/licenses/>.
#
from rrompy.utilities.base.types import HS1D, HS2D, Tuple
__all__ = ['PODEngineBase']
class PODEngineBase:
"""
POD engine for general matrix orthogonalization. ABSTRACT.
"""
def name(self) -> str:
return self.__class__.__name__
def __str__(self) -> str:
return self.name()
def norm(self, a:HS1D) -> float:
"""Compute norm of a Hilbert space object."""
pass
def GS(self, a:HS1D, Q:HS2D, n : int = None,
aA:HS1D = None, QA:HS2D = None) -> Tuple[HS1D, HS1D, HS1D]:
"""
Compute 1 Gram-Schmidt step with given projector.
Args:
a: Hilbert space object to be projected;
Q: orthogonal projection Hilbert space quasi-matrix;
n: number of columns of Q to be considered;
aA: augmented components of Hilbert space object to be projected;
QA: augmented components of Hilbert space object projection
quasi-matrix.
Returns:
Resulting normalized Hilbert space object, coefficients of a wrt
the updated basis.
"""
pass
def QRGramSchmidt(self, A:HS2D,
only_R : bool = False) -> Tuple[HS1D, HS1D]:
"""
Compute QR decomposition of a matrix through Gram-Schmidt method.
Args:
A: Hilbert space quasi-matrix to be decomposed;
only_R(optional): whether to skip reconstruction of Q; defaults to
False.
Returns:
Resulting orthogonal and upper-triangular quasi-factors.
"""
pass
def QRHouseholder(self, A:HS2D, Q0 : HS2D = None,
only_R : bool = False) -> Tuple[HS1D, HS1D]:
"""
Compute QR decomposition of a matrix through Householder method.
Args:
A: Hilbert space quasi-matrix to be decomposed;
Q0(optional): initial orthogonal guess for Q; defaults to random;
only_R(optional): whether to skip reconstruction of Q; defaults to
False.
Returns:
Resulting (orthogonal and )upper-triangular quasi-factor(s).
"""
pass

Event Timeline