pylops_mpi.basicoperators.MPIBlockDiag#
- class pylops_mpi.basicoperators.MPIBlockDiag(ops, base_comm=<mpi4py.MPI.Intracomm object>, dtype=None)[source]#
MPI Block-diagonal operator.
Create a block-diagonal operator from a set of linear operators using MPI. Each rank must initialize this operator by providing one or more linear operators which will be computed within such rank.
Both model and data vectors must be of
pylops_mpi.DistributedArray
type and partitioned between ranks according to the shapes of the different linear operators.- Parameters:
- ops
list
One or more
pylops.LinearOperator
to be stacked.- base_comm
mpi4py.MPI.Comm
, optional Base MPI Communicator. Defaults to
mpi4py.MPI.COMM_WORLD
.- dtype
str
, optional Type of elements in input array.
- ops
- Attributes:
- shape
tuple
Operator shape
- shape
Notes
An MPI Block Diagonal operator is composed of N linear operators, represented by L. Each rank has one or more
pylops.LinearOperator
, which we represent here compactly as \(\mathbf{L}_i\) for rank \(i\).Each operator performs forward mode operations using its corresponding model vector, denoted as m. This vector is effectively a
pylops_mpi.DistributedArray
partitioned at each rank in such a way that its local shapes agree with those of the corresponding linear operators. The forward mode of each operator is then collected from all ranks as a DistributedArray, referred to as d.\[\begin{split}\begin{bmatrix} \mathbf{d}_1 \\ \mathbf{d}_2 \\ \vdots \\ \mathbf{d}_n \end{bmatrix} = \begin{bmatrix} \mathbf{L}_1 & \mathbf{0} & \ldots & \mathbf{0} \\ \mathbf{0} & \mathbf{L}_2 & \ldots & \mathbf{0} \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{0} & \mathbf{0} & \ldots & \mathbf{L}_n \end{bmatrix} \begin{bmatrix} \mathbf{m}_1 \\ \mathbf{m}_2 \\ \vdots \\ \mathbf{m}_n \end{bmatrix}\end{split}\]Likewise, for the adjoint mode, each operator executes operations in the adjoint mode, the adjoint mode of each operator is then collected from all ranks as a DistributedArray referred as d.
\[\begin{split}\begin{bmatrix} \mathbf{d}_1 \\ \mathbf{d}_2 \\ \vdots \\ \mathbf{d}_n \end{bmatrix} = \begin{bmatrix} \mathbf{L}_1^H & \mathbf{0} & \ldots & \mathbf{0} \\ \mathbf{0} & \mathbf{L}_2^H & \ldots & \mathbf{0} \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{0} & \mathbf{0} & \ldots & \mathbf{L}_n^H \end{bmatrix} \begin{bmatrix} \mathbf{m}_1 \\ \mathbf{m}_2 \\ \vdots \\ \mathbf{m}_n \end{bmatrix}\end{split}\]Methods
__init__
(ops[, base_comm, dtype])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