Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions Wrappers/Python/cil/optimisation/operators/Operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,29 +425,38 @@ def dot_test(operator, domain_init=None, range_init=None, tolerance=1e-6, **kwar
return False

class AdjointOperator(LinearOperator):

r"""
Adjoint of a linear operator.

"""
The Adjoint operator :math:`A^{*}: Y^{*}\rightarrow X^{*}` of a linear operator :math:`A: X\rightarrow Y` defined as

.. math:: <x, A^* y> = <Ax, y>
Given a linear operator :math:`A: X \to Y` between inner-product spaces
:math:`(X,\langle\cdot,\cdot\rangle_X)` and :math:`(Y,\langle\cdot,\cdot\rangle_Y)`,
its adjoint :math:`A^{*}: Y \to X` is defined by
\[
\langle Ax,\, y\rangle_Y \;=\; \langle x,\, A^{*}y\rangle_X,
\qquad \forall x\in X,\; y\in Y.
\]

Parameters
----------
Parameters
----------
operator : LinearOperator
The operator :math:`A` whose adjoint is constructed.

operator : A linear operator
Examples
--------
Verify the adjointness relation for the gradient operator :math:`G` and its adjoint
(the negative divergence in many discretisations):
>>> ig = ImageGeometry(2, 3)
>>> G = GradientOperator(ig)
>>> div = AdjointOperator(G) # represents G*
>>> x = G.domain.allocate("random_int")
>>> y = G.range.allocate("random_int")
>>> lhs = G.direct(x).dot(y) # <Gx, y>_Y
>>> rhs = x.dot(div.direct(y)) # <x, G* y>_X
>>> lhs == rhs
True
"""

Examples
--------
This example demonstrates that :math:` LHS:=<Gx, y> =<x, G^* y>=:RHS`, where :math:`G` is the gradient operator.
>>> ig = ImageGeometry(2,3)
>>> G = GradientOperator(ig)
>>> div = AdjointOperator(G)
>>> x = G.domain.allocate("random_int")
>>> y = G.range.allocate("random_int")
>>> lhs = G.direct(x).dot(y)
>>> rhs = x.dot(div.direct(y))
>>> lhs == rhs # returns True
"""

def __init__(self, operator):
super(AdjointOperator, self).__init__(domain_geometry=operator.range_geometry(),
Expand Down
3 changes: 3 additions & 0 deletions docs/source/optimisation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ A :code:`ScaledOperator` represents the multiplication of any operator with a sc
.. autoclass:: cil.optimisation.operators.SumOperator
:members:

.. autoclass:: cil.optimisation.operators.AdjointOperator
:members:


Trivial operators
-----------------
Expand Down