11# The AbstractSciMLOperator Interface
22
3- ## Formal Properties of DiffEqOperators
3+ ## Formal Properties of SciMLOperators
44
55These are the formal properties that an ` AbstractSciMLOperator ` should obey
66for it to work in the solvers.
77
8- ## AbstractDiffEqOperator Interface Description
9-
10- 1 . Function call and multiplication: ` L(du,u,p,t) ` for inplace and ` du = L(u,p,t) ` for
11- out-of-place, meaning ` L*u ` and ` mul! ` .
12- 2 . If the operator is not a constant, update it with ` (u,p,t) ` . A mutating form, i.e.
13- ` update_coefficients!(A,u,p,t) ` that changes the internal coefficients, and a
14- out-of-place form ` B = update_coefficients(A,u,p,t) ` .
15- 3 . ` isconstant(A) ` trait for whether the operator is constant or not.
16-
17- ## AbstractDiffEqLinearOperator Interface Description
8+ 1 . An ` AbstractSciMLOperator ` represents a linear or nonlinear operator with input/output
9+ being ` AbstractArray ` s. Specifically, a SciMLOperator, ` L ` , of size ` (M,N) ` accepts
10+ input argument ` u ` with leading length ` N ` , i.e. ` size(u, 1) == N ` , and returns an
11+ ` AbstractArray ` of the same dimension with leading length ` M ` , i.e. ` size(L * u, 1) == M ` .
12+ 2 . SciMLOperators can be applied to an ` AbstractArray ` via overloaded ` Base.* ` , or
13+ the in-place ` LinearAlgebra.mul! ` . Additionally, operators are allowed to be time,
14+ or parameter dependent. The state of a SciMLOperator can be updated by calling
15+ the mutating function ` update_coefficients!(L, u, p, t) ` where ` p ` representes
16+ parameters, and ` t ` , time. Calling a SciMLOperator as ` L(du, u, p, t) ` or out-of-place
17+ ` L(u, p, t) ` will automatically update the state of ` L ` before applying it to ` u ` .
18+ ` L(u, p, t) ` is the same operation as ` L(u, p, t) * u ` .
19+ 3 . To support the update functionality, we have lazily implemented a comprehensive operator
20+ algebra. That means a user can add, subtract, scale, compose and invert SciMLOperators,
21+ and the state of the resultant operator would be updated as expected upon calling
22+ ` L(du, u, p, t) ` or ` L(u, p, t) ` so long as an update function is provided for the
23+ component operators.
24+
25+ ## AbstractSciMLOperator Interface Description
1826
19271 . ` AbstractSciMLLinearOperator <: AbstractSciMLOperator `
20- 2 . Can absorb under multiplication by a scalar. In all algorithms things like
21- ` dt*L ` show up all the time, so the linear operator must be able to absorb
22- such constants.
23- 4 . ` isconstant(A) ` trait for whether the operator is constant or not.
24- 5 . Optional: ` diagonal ` , ` symmetric ` , etc traits from LinearMaps.jl.
25- 6 . Optional: ` exp(A) ` . Required for simple exponential integration.
26- 7 . Optional: ` expv(A,u,t) = exp(t*A)*u ` and ` expv!(v,A::AbstractSciMLOperator,u,t) `
28+ 2 . ` AbstractSciMLScalarOperator <: AbstractSciMLLinearOperator `
29+ 3 . ` isconstant(A) ` trait for whether the operator is constant or not.
30+ 4 . Optional: ` exp(A) ` . Required for simple exponential integration.
31+ 5 . Optional: ` expv(A,u,t) = exp(t*A)*u ` and ` expv!(v,A::AbstractSciMLOperator,u,t) `
2732 Required for sparse-saving exponential integration.
28- 8 . Optional: factorizations. ` ldiv! ` , ` factorize ` et. al. This is only required
33+ 6 . Optional: factorizations. ` ldiv! ` , ` factorize ` et. al. This is only required
2934 for algorithms which use the factorization of the operator (Crank-Nicolson),
3035 and only for when the default linear solve is used.
3136
@@ -49,4 +54,4 @@ That same trick then can be used pretty much anywhere you would've had a linear
4954the proof to affine operators, so then `` exp(A*t)*v `` operations via Krylov methods work for A being
5055affine as well, and all sorts of things. Thus affine operators have no matrix representation but they
5156are still compatible with essentially any Krylov method which would otherwise be compatible with
52- matrix-free representations, hence their support in the SciMLOperators interface.
57+ matrix-free representations, hence their support in the SciMLOperators interface.
0 commit comments