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:
Oppylops_mpi.LinearOperator

Linear operator to test.

upylops_mpi.DistributedArray

Distributed array of size equal to the number of columns of operator

vpylops_mpi.DistributedArray

Distributed array of size equal to the number of rows of operator

nrint

Number of rows of operator (i.e., elements in data)

ncint

Number of columns of operator (i.e., elements in model)

rtolfloat, optional

Relative dottest tolerance

atolfloat, optional

Absolute dottest tolerance .. versionadded:: 2.0.0

raiseerrorbool, optional

Raise error or simply return False when dottest fails

verbbool, optional

Verbosity

Returns:
passedbool

Passed flag.

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})\]