Note
Go to the end to download the full example code.
17. Real/Complex Inversion#
In this tutorial we will discuss two equivalent approaches to the solution of inverse problems with real-valued model vector and complex-valued data vector. In other words, we consider a modelling operator \(\mathbf{A}:\mathbb{F}^m \to \mathbb{C}^n\) (which could be the case for example for the real FFT).
Mathematically speaking, this problem can be solved equivalently by inverting the complex-valued problem:
or the real-valued augmented system
Whilst we already know how to solve the first problem, let’s see how we can
solve the second one by taking advantage of the real
method of the
pylops.LinearOperator
object. We will also wrap our linear operator
into a pylops.MemoizeOperator
which remembers the last N model and
data vectors and by-passes the computation of the forward and/or adjoint pass
whenever the same pair reappears. This is very useful in our case when we
want to compute the real and the imag components of
import matplotlib.pyplot as plt
import numpy as np
import pylops
plt.close("all")
np.random.seed(0)
To start we create the forward problem
Let’s check we can solve this problem using the first formulation
xinv=[1.+9.99200722e-16j 2.-1.55431223e-15j 3.+1.33226763e-15j
4.-8.88178420e-16j 5.+6.66133815e-16j]
Let’s now see how we formulate the second problem
xinv1=[1. 2. 3. 4. 5.]
Total running time of the script: (0 minutes 0.011 seconds)