pylops_mpi.basicoperators.MPILaplacian#

class pylops_mpi.basicoperators.MPILaplacian(dims, axes=(-2, -1), weights=(1, 1), sampling=(1, 1), edge=False, kind='centered', base_comm=<mpi4py.MPI.Intracomm object>, dtype=<class 'numpy.float64'>)[source]#

MPI Laplacian

Apply second-order centered Laplacian operator to a multi-dimensional distributed array.

Note

At least 2 dimensions are required, use pylops_mpi.basicoperators.MPISecondDerivative for one dimension.

Parameters:
dimstuple

Number of samples for each dimension.

axesint, optional

Axes along which the Laplacian is applied.

weightstuple, optional

Weight to apply to each direction (real laplacian operator if weights=(1, 1))

samplingtuple, optional

Sampling steps for each direction

edgebool, optional

Use reduced order derivative at edges (True) or ignore them (False) for centered derivative

kindstr, optional

Derivative kind (forward, centered, or backward)

base_commmpi4py.MPI.Comm, optional

MPI Base Communicator. Defaults to mpi4py.MPI.COMM_WORLD.

dtypestr, optional

Type of elements in input array.

Raises:
ValueError

If axes. weights, and sampling do not have the same size.

Notes

The MPILaplacian operator applies a second derivative along multiple directions of a multi-dimensional distributed array.

We utilize the pylops_mpi.basicoperators.MPISecondDerivative to calculate the second derivative along the first direction(i.e., axis=0). For other values of axis, the pylops.SecondDerivative operator is pushed into the pylops_mpi.basicoperators.MPIBlockDiag operator. Subsequently, the matrix-vector product is performed between the SecondDerivative operator and the distributed data.

For simplicity, given a two-dimensional array, the Laplacian is:

\[y[i, j] = (x[i+1, j] + x[i-1, j] + x[i, j-1] +x[i, j+1] - 4x[i, j]) / (\Delta x \Delta y)\]

Methods

__init__(dims[, axes, weights, sampling, ...])

adjoint()

Adjoint MPI LinearOperator

conj()

Complex conjugate operator

dot(x)

Matrix Vector Multiplication

matvec(x)

Matrix-vector multiplication.

rmatvec(x)

Adjoint Matrix-vector multiplication.

transpose()

Transposition of MPI LinearOperator