pymor.bindings.scipy¶
Module Contents¶
- class pymor.bindings.scipy.ScipyBicgStabSolver(check_finite=None, tol=1e-15, maxiter=None)[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipyBicgStabSpILUSolver(check_finite=None, tol=1e-15, maxiter=None, spilu_drop_tol=0.0001, spilu_fill_factor=10, spilu_drop_rule=None, spilu_permc_spec='COLAMD')[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipyLGMRESSolver(check_finite=None, tol=1e-05, maxiter=1000, inner_m=39, outer_k=3)[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipyLSMRSolver(check_finite=None, damp=0.0, atol=1e-06, btol=1e-06, conlim=100000000.0, maxiter=None, show=False)[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipyLSQRSolver(check_finite=None, damp=0.0, atol=1e-06, btol=1e-06, conlim=100000000.0, iter_lim=None, show=False)[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipyLSTSQSolver(check_finite=True)[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipyLUSolveSolver(check_finite=None, check_cond=True)[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipyLinearSolver(check_finite=True)[source]¶
Bases:
pymor.solvers.interface.SolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- class pymor.bindings.scipy.ScipySpSolveSolver(check_finite=None, permc_spec='COLAMD', keep_factorization=True, use_umfpack=True)[source]¶
Bases:
ScipyLinearSolverEquation solver.
Solves operator equations of the form
\[A(U; \mu) = V\]The operator \(A\) can be linear or non-linear. When \(A\) is linear, a solver can also be used to solve the adjoint equation
\[A^H(V; \mu) = U\]for \(U\).
When
least_squaresisTrue, the equations are solved in a least-squares sense:\[\operatorname{argmin}_{U} \|A(U; \mu) - V\|^2 \quad\text{or}\quad \operatorname{argmin}_{V} \|A^H(V; \mu) - U\|^2\]Solvers will typically only work for certain classes of
Operators. In most cases, solvers are invoked by theapply_inverseandapply_inverse_adjointmethods ofOperators. If anOperatorhas no associated solver,DefaultSolveris used.
- pymor.bindings.scipy.lyap_dense_solver_options()[source]¶
Return available dense Lyapunov solvers with default options for the SciPy backend.
- Returns:
A dict of available solvers with default solver options.
- pymor.bindings.scipy.lyap_lrcf_solver_options()[source]¶
Return available Lyapunov solvers with default options for the SciPy backend.
- Returns:
A dict of available solvers with default solver options.
- pymor.bindings.scipy.ricc_dense_solver_options()[source]¶
Return available Riccati solvers with default options for the SciPy backend.
- Returns:
A dict of available solvers with default solver options.
- pymor.bindings.scipy.ricc_lrcf_solver_options()[source]¶
Return available Riccati solvers with default options for the SciPy backend.
- Returns:
A dict of available solvers with default solver options.
- pymor.bindings.scipy.solve_lyap_dense(A, E, B, trans=False, cont_time=True, options=None)[source]¶
Compute the solution of a Lyapunov equation.
See
for a general description.
This function uses
scipy.linalg.solve_continuous_lyapunovorscipy.linalg.solve_discrete_lyapunov, which are dense solvers for Lyapunov equations with E=I.Note
If E is not
None, the problem will be reduced to a standard algebraic Lyapunov equation by inverting E.- Parameters:
A – The matrix A as a 2D
NumPy array.E – The matrix E as a 2D
NumPy arrayorNone.B – The matrix B as a 2D
NumPy array.trans – Whether the first operator in the Lyapunov equation is transposed.
cont_time – Whether the continuous- or discrete-time Lyapunov equation is solved.
options – The solver options to use (see
lyap_dense_solver_options).
- Returns:
X – Lyapunov equation solution as a
NumPy array.
- pymor.bindings.scipy.solve_lyap_lrcf(A, E, B, trans=False, cont_time=True, options=None)[source]¶
Compute an approximate low-rank solution of a Lyapunov equation.
See
for a general description.
This function uses
scipy.linalg.solve_continuous_lyapunovorscipy.linalg.solve_discrete_lyapunov, which are dense solvers for Lyapunov equations with E=I. Therefore, we assume A and E can be converted toNumPy arraysusingto_matrixand thatB.to_numpyis implemented.Note
If E is not
None, the problem will be reduced to a standard algebraic Lyapunov equation by inverting E.- Parameters:
A – The non-parametric
OperatorA.E – The non-parametric
OperatorE orNone.B – The operator B as a
VectorArrayfromA.source.trans – Whether the first
Operatorin the Lyapunov equation is transposed.cont_time – Whether the continuous- or discrete-time Lyapunov equation is solved.
options – The solver options to use (see
lyap_lrcf_solver_options).
- Returns:
Z – Low-rank Cholesky factor of the Lyapunov equation solution,
VectorArrayfromA.source.
- pymor.bindings.scipy.solve_pos_ricc_dense(A, E, B, C, R=None, S=None, trans=False, options=None)[source]¶
Compute the solution of a Riccati equation.
See
pymor.algorithms.riccati.solve_pos_ricc_densefor a general description.This function uses
scipy.linalg.solve_continuous_are, which is a dense solver.- Parameters:
A – The matrix A as a 2D
NumPy array.E – The matrix E as a 2D
NumPy arrayorNone.B – The matrix B as a 2D
NumPy array.C – The matrix C as a 2D
NumPy array.R – The matrix R as a 2D
NumPy arrayorNone.S – The matrix S as a 2D
NumPy arrayorNone.trans – Whether the first operator in the Riccati equation is transposed.
options – The solver options to use (see
ricc_dense_solver_options).
- Returns:
X – Riccati equation solution as a
NumPy array.
- pymor.bindings.scipy.solve_pos_ricc_lrcf(A, E, B, C, R=None, S=None, trans=False, options=None)[source]¶
Compute an approximate low-rank solution of a positive Riccati equation.
See
pymor.algorithms.riccati.solve_pos_ricc_lrcffor a general description.This function uses
scipy.linalg.solve_continuous_are, which is a dense solver. Therefore, we assume allOperatorsandVectorArrayscan be converted toNumPy arraysusingto_matrixandto_numpy.- Parameters:
A – The non-parametric
OperatorA.E – The non-parametric
OperatorE orNone.B – The operator B as a
VectorArrayfromA.source.C – The operator C as a
VectorArrayfromA.source.R – The matrix R as a 2D
NumPy arrayorNone.S – The operator S as a
VectorArrayfromA.sourceorNone.trans – Whether the first
Operatorin the positive Riccati equation is transposed.options – The solver options to use (see
ricc_lrcf_solver_options).
- Returns:
Z – Low-rank Cholesky factor of the positive Riccati equation solution,
VectorArrayfromA.source.
- pymor.bindings.scipy.solve_ricc_dense(A, E, B, C, R=None, S=None, trans=False, options=None)[source]¶
Compute the solution of a Riccati equation.
See
pymor.algorithms.riccati.solve_ricc_densefor a general description.This function uses
scipy.linalg.solve_continuous_are, which is a dense solver.- Parameters:
A – The matrix A as a 2D
NumPy array.E – The matrix E as a 2D
NumPy arrayorNone.B – The matrix B as a 2D
NumPy array.C – The matrix C as a 2D
NumPy array.R – The matrix R as a 2D
NumPy arrayorNone.S – The matrix S as a 2D
NumPy arrayorNone.trans – Whether the first operator in the Riccati equation is transposed.
options – The solver options to use (see
ricc_dense_solver_options).
- Returns:
X – Riccati equation solution as a
NumPy array.
- pymor.bindings.scipy.solve_ricc_lrcf(A, E, B, C, R=None, S=None, trans=False, options=None)[source]¶
Compute an approximate low-rank solution of a Riccati equation.
See
pymor.algorithms.riccati.solve_ricc_lrcffor a general description.This function uses
scipy.linalg.solve_continuous_are, which is a dense solver. Therefore, we assume allOperatorsandVectorArrayscan be converted toNumPy arraysusingto_matrixandto_numpy.- Parameters:
A – The non-parametric
OperatorA.E – The non-parametric
OperatorE orNone.B – The operator B as a
VectorArrayfromA.source.C – The operator C as a
VectorArrayfromA.source.R – The matrix R as a 2D
NumPy arrayorNone.S – The operator S as a
VectorArrayfromA.sourceorNone.trans – Whether the first
Operatorin the Riccati equation is transposed.options – The solver options to use (see
ricc_lrcf_solver_options).
- Returns:
Z – Low-rank Cholesky factor of the Riccati equation solution,
VectorArrayfromA.source.