pymor.playground.operators package¶
Submodules¶
numpy module¶
-
class
pymor.playground.operators.numpy.NumpyListVectorArrayMatrixOperator(matrix, source_id=None, range_id=None, solver_options=None, name=None)[source]¶ Bases:
pymor.operators.numpy.NumpyMatrixOperatorVariant of
NumpyMatrixOperatorusingListVectorArrayinstead ofNumpyVectorArray.Methods
apply,apply_adjoint,apply_inverse,as_range_array,as_source_arrayapply_inverse_adjoint,assemble,from_filedisable_logging,enable_logging,has_interface_name,implementor_names,implementorsAttributes
-
apply(U, mu=None)[source]¶ Apply the operator to a
VectorArray.Parameters
- U
VectorArrayof vectors to which the operator is applied.- mu
The
Parameterfor which to evaluate the operator.
Returns
VectorArrayof the operator evaluations.
-
apply_adjoint(V, mu=None)[source]¶ Apply the adjoint operator.
For any given linear
Operatorop,ParametermuandVectorArraysU,Vin thesourceresp.rangewe have:op.apply_adjoint(V, mu).dot(U) == V.dot(op.apply(U, mu))
Thus, when
opis represented by a matrixM,apply_adjointis given by left-multplication of (the complex conjugate of)MwithV.Parameters
- V
VectorArrayof vectors to which the adjoint operator is applied.- mu
The
Parameterfor which to apply the adjoint operator.
Returns
VectorArrayof the adjoint operator evaluations.
-
apply_inverse(V, mu=None, least_squares=False)[source]¶ Apply the inverse operator.
Parameters
- V
VectorArrayof vectors to which the inverse operator is applied.- mu
The
Parameterfor which to evaluate the inverse operator.- least_squares
If
True, solve the least squares problem:u = argmin ||op(u) - v||_2.
Since for an invertible operator the least squares solution agrees with the result of the application of the inverse operator, setting this option should, in general, have no effect on the result for those operators. However, note that when no appropriate
solver_optionsare set for the operator, most implementations will choose a least squares solver by default which may be undesirable.- check_finite
Test if solution only contains finite values.
- default_sparse_solver_backend
Default sparse solver backend to use (scipy, pyamg, generic).
Returns
VectorArrayof the inverse operator evaluations.Raises
- InversionError
The operator could not be inverted.
Defaults
check_finite, default_sparse_solver_backend (see
pymor.core.defaults)
-
as_range_array(mu=None)[source]¶ Return a
VectorArrayrepresentation of the operator in its range space.In the case of a linear operator with
NumpyVectorSpaceassource, this method returns for everyParametermuaVectorArrayVin the operator’srange, such thatV.lincomb(U.to_numpy()) == self.apply(U, mu)
for all
VectorArraysU.Parameters
- mu
The
Parameterfor which to return theVectorArrayrepresentation.
Returns
- V
The
VectorArraydefined above.
-
as_source_array(mu=None)[source]¶ Return a
VectorArrayrepresentation of the operator in its source space.In the case of a linear operator with
NumpyVectorSpaceasrange, this method returns for everyParametermuaVectorArrayVin the operator’ssource, such thatself.range.make_array(V.dot(U).T) == self.apply(U, mu)
for all
VectorArraysU.Parameters
- mu
The
Parameterfor which to return theVectorArrayrepresentation.
Returns
- V
The
VectorArraydefined above.
-