pylops_mpi.utils.dottest.dottest#
- pylops_mpi.utils.dottest.dottest(Op, u, v, nr=None, nc=None, rtol=1e-06, atol=1e-21, raiseerror=True, verb=False)[source]#
Dot test.
Perform dot-test to verify the validity of forward and adjoint operators using user-provided random vectors \(\mathbf{u}\) and \(\mathbf{v}\) (whose Partition must be consistent with the operator being tested). This test can help to detect errors in the operator ximplementation.
- Parameters:
- Op
pylops_mpi.LinearOperator
Linear operator to test.
- u
pylops_mpi.DistributedArray
Distributed array of size equal to the number of columns of operator
- v
pylops_mpi.DistributedArray
Distributed array of size equal to the number of rows of operator
- nr
int
Number of rows of operator (i.e., elements in data)
- nc
int
Number of columns of operator (i.e., elements in model)
- rtol
float
, optional Relative dottest tolerance
- atol
float
, optional Absolute dottest tolerance .. versionadded:: 2.0.0
- raiseerror
bool
, optional Raise error or simply return
False
when dottest fails- verb
bool
, optional Verbosity
- Op
- Returns:
- passed
bool
Passed flag.
- passed
- Raises:
- AssertionError
If dot-test is not verified within chosen tolerances.
Notes
A dot-test is mathematical tool used in the development of numerical linear operators.
More specifically, a correct implementation of forward and adjoint for a linear operator should verify the following equality within a numerical tolerance:
\[(\mathbf{Op}\,\mathbf{u})^H\mathbf{v} = \mathbf{u}^H(\mathbf{Op}^H\mathbf{v})\]