gemseo.algos.linear_solvers.scipy_linalg.scipy_linalg module#

Wrappers for SciPy's linear solvers.

class ScipyLinAlgAlgorithmDescription(algorithm_name, internal_algorithm_name, library_name='SciPy Linear Algebra', description='', website='', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.base_scipy_linalg_settings.BaseSciPyLinalgSettingsBase'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False)[source]#

Bases: LinearSolverDescription

The description of the SciPy linear algebra library.

Parameters:
  • algorithm_name (str)

  • internal_algorithm_name (str)

  • library_name (str) --

    By default it is set to "SciPy Linear Algebra".

  • description (str) --

    By default it is set to "".

  • website (str) --

    By default it is set to "".

  • Settings (type[BaseSciPyLinalgSettingsBase]) --

    By default it is set to <class 'gemseo.algos.linear_solvers.scipy_linalg.settings.base_scipy_linalg_settings.BaseSciPyLinalgSettingsBase'>.

  • lhs_must_be_symmetric (bool) --

    By default it is set to False.

  • lhs_must_be_positive_definite (bool) --

    By default it is set to False.

  • lhs_must_be_linear_operator (bool) --

    By default it is set to False.

Settings#

The option validation model for SciPy linear algebra library.

alias of BaseSciPyLinalgSettingsBase

library_name: str = 'SciPy Linear Algebra'#

The library name.

class ScipyLinalgAlgos(algo_name)[source]#

Bases: BaseLinearSolverLibrary

Wrapper for scipy linalg sparse linear solvers.

Parameters:

algo_name (str) -- The algorithm name.

Raises:

KeyError -- When the algorithm is not in the library.

ALGORITHM_INFOS: ClassVar[dict[str, LinearSolverDescription]] = {'BICG': LinearSolverDescription(algorithm_name='BICG', internal_algorithm_name='bicg', library_name='', description='BI-Conjugate Gradient', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.bicg.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.bicg.BICG_Settings'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False), 'BICGSTAB': LinearSolverDescription(algorithm_name='BICGSTAB', internal_algorithm_name='bicgstab', library_name='', description='Bi-Conjugate Gradient STABilized', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.bicgstab.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.bicgstab.BICGSTAB_Settings'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False), 'CG': LinearSolverDescription(algorithm_name='CG', internal_algorithm_name='cg', library_name='', description='Conjugate Gradient', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.cg.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.cg.CG_Settings'>, lhs_must_be_symmetric=True, lhs_must_be_positive_definite=True, lhs_must_be_linear_operator=False), 'CGS': LinearSolverDescription(algorithm_name='CGS', internal_algorithm_name='cgs', library_name='', description='Conjugate Gradient Squared', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.cgs.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.cgs.CGS_Settings'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False), 'DEFAULT': LinearSolverDescription(algorithm_name='DEFAULT', internal_algorithm_name='lgmres', library_name='', description='Default solver (LGMRES)', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lgmres.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.lgmres.LGMRES_Settings'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False), 'GCROT': LinearSolverDescription(algorithm_name='GCROT', internal_algorithm_name='gcrotmk', library_name='', description='Generalized Conjugate Residual with Optimal Truncation', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.gcrotmk.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.gcrot.GCROT_Settings'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False), 'GMRES': LinearSolverDescription(algorithm_name='GMRES', internal_algorithm_name='gmres', library_name='', description='Generalized Minimum RESidual', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.gmres.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.gmres.GMRES_Settings'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False), 'LGMRES': LinearSolverDescription(algorithm_name='LGMRES', internal_algorithm_name='lgmres', library_name='', description='Loose Generalized Minimum RESidual', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lgmres.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.lgmres.LGMRES_Settings'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False), 'TFQMR': LinearSolverDescription(algorithm_name='TFQMR', internal_algorithm_name='tfqmr', library_name='', description='Transpose-Free Quasi-Minimal Residual', website='https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.tfqmr.html', Settings=<class 'gemseo.algos.linear_solvers.scipy_linalg.settings.base_scipy_linalg_settings.BaseSciPyLinalgSettingsBase'>, lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False)}#

The description of the algorithms contained in the library.

file_path: str#

The path to the file where the problem is saved when it is not converged.

This will be set only if the optio, save_when_fail is set to True.