Algorithm Search⌘K

Algorithmadvanced

Surface-related multiple elimination

Also called SRME.

Predict the surface multiples by convolving the recorded data with itself over the surface positions, then remove them, exactly by one inverse per frequency or by iteration.

Time
O(f s^3) worst · average · best
Space
O(f s^2) extra
Where
K = the number of iterations; f = the number of frequencies; s = the number of surface positions
Properties
data drivendeterministicexact under modelnot needs subsurface model
Origin
D. J. Verschuur, A. J. Berkhout, C. P. A. Wapenaar, 1992

Surface-related multiple elimination (SRME) removes from marine seismic data the multiples that bounced at least once at the sea surface. It needs no model of the earth. Every surface multiple is a path from the source down and up to the surface, a reflection at the surface, and a second path down and up to the receiver. Both paths are already in the data, so the data convolved with themselves, summed over all surface positions, predict the multiples. At one frequency this is a matrix product, and the data without surface multiples are P0=P(I+aP)−1P_0 = P (I + aP)^{-1}, which one linear solve per frequency gives, or a Neumann series whose terms the iteration adds one by one. It works on the convolutional model extended to many sources and receivers, and it removes multiples whose period and moveout change from trace to trace, which predictive deconvolution cannot.

In plain words

At sea, sound from the source goes down, comes back up, hits the sea surface and goes down again. So each echo is followed by weaker copies: echoes of echoes. These copies confuse the picture of the rocks. Each copy is made of two trips that the recording already holds: one trip from the source to some point on the sea surface, and one from that point to the receiver. So the method builds the copies by joining every recorded trip with every other recorded trip that starts where the first ended, and adds up over all meeting points. This guess of the copies is then removed from the data. Repeating the guess with the cleaned data makes it better each time, until only the first echoes are left.

The problem

Input: the data p(t;xr,xs)p(t; x_r, x_s) for receivers and sources on one regular grid of ss surface positions; the surface operator a(ω)a(\omega), which holds the free-surface reflection coefficient (about −1-1), the inverse of the source spectrum and the grid step. In practice aa is not known and is estimated. Output: the data P0P_0 without surface multiples. After the DFT in time, the data at one frequency form the s×ss \times s matrix PP (rows: receivers, columns: sources), and the model is

P=P0+a P0 P.P = P_0 + a\, P_0\, P.

The product P0PP_0 P sums over the surface position ll where the multiple meets the surface: an event of PP from the source to ll, then an event of P0P_0 from ll to the receiver. By the convolution theorem the product of spectra is a convolution in time, so the matrix product is a convolution in time and a sum in space. The model is a physical model of the surface multiples for point sources and receivers at the surface, not a theorem about real data; the direct wave, the ghosts and missing near offsets must be handled first.

The algorithm

  1. SRME(P(ω) for every ω, a(ω), iterations K)
  2. 1for each frequency ω do
  3. 2P₀ ← P ▷ the start: the data
  4. 3repeat K times
  5. 4P₀ ← P - a P₀ P ▷ predict the multiples and subtract
  6. 5append P₀ to the output ▷ or P₀ ← P (I + a P)⁻¹ by one solve
  7. 6return the output, back in time by the inverse DFT

After one step, P0=P−aP2P_0 = P - aP^2: the prediction is the data convolved with themselves, which removes the first-order surface multiples exactly and leaves the higher orders with wrong amplitudes. Each later step adds the next term of the series P0=∑j(−a)jPj+1P_0 = \sum_j (-a)^j P^{j+1}. The direct form solves X(I+aP)=PX (I + aP) = P for XX once per frequency. In practice the operator aa is unknown, the data are not perfect, and the prediction is subtracted with a short filter fitted so that the result has the least energy: adaptive subtraction, a heuristic.

Example

One reflector. A flat reflector with coefficient r=0.5r = 0.5 lies τ=8\tau = 8 samples below the surface, the surface coefficient is −1-1 and the source is a unit impulse, so a=−1a = -1 and P=rz/(1+rz)P = rz/(1 + rz) with z=e−iωτz = e^{-i\omega\tau}. The trace has r,−r2,r3,…r, -r^2, r^3, \ldots at τ,2τ,3τ,…\tau, 2\tau, 3\tau, \ldots; on a periodic axis of 64 samples the series wraps and each value gets the factor 1/(1−r8)1/(1 - r^8).

time τ\tau 2τ2\tau 3τ3\tau 4τ4\tau 5τ5\tau
data 0.502 −0.251-0.251 0.125 −0.063-0.063 0.031
one step, P+P2P + P^2 0.486 0.008 −0.129-0.129 0.127 −0.095-0.095
direct, P(I−P)−1P (I - P)^{-1} 0.5 0 0 0 0

Without the wrap, one step gives exactly (−1)m+1(2−m)rm(-1)^{m+1}(2 - m) r^m at mτm\tau: rr, 00, −r3-r^3, 2r42r^4, −3r5-3r^5. The first-order multiple is gone, and the later orders are not. The direct form returns the primary alone, exact to rounding.

The iteration. With r=0.4r = 0.4, τ=4\tau = 4 and 32 samples, the largest error of the output after kk steps is 0.0640.064 (k=1k = 1), 0.0310.031 (2), 6.2×10−36.2 \times 10^{-3} (5), 6.5×10−46.5 \times 10^{-4} (10), 1.0×10−51.0 \times 10^{-5} (20) and 3.0×10−93.0 \times 10^{-9} (40). The ratio over the last 20 steps is 3×10−4≈(2/3)203 \times 10^{-4} \approx (2/3)^{20}, the rate of Claim 4 of the proof, r/(1−r)=2/3r/(1 - r) = 2/3 at the worst frequency. For r=0.5r = 0.5 the worst rate is 11, and the iteration does not converge at that frequency, while the direct form still works.

Adaptive subtraction. On the r=0.5r = 0.5 trace, start from P0=PP_0 = P, predict M=P0PM = P_0 P, and pick the scalar ss that minimizes ∥P−sM∥2\|P - sM\|^2, six times. The scalars are −0.633-0.633, −0.829-0.829, −0.971-0.971, −0.941-0.941, −0.942-0.942 and −0.958-0.958, close to but not equal to the true −1-1, and residual multiples of about 0.02 remain. These numbers are measurements; they show why adaptive subtraction is a heuristic.

Correctness

Under the model, the data without surface multiples are P(I+aP)−1P (I + aP)^{-1} whenever I+aPI + aP is invertible, and it is invertible whenever the data were made from some P0P_0 with I−aP0I - aP_0 invertible; the direct form is then exact. The iteration computes the partial sums of the Neumann series, and its error after kk steps is (−1)kak+1P0Pk+1(-1)^k a^{k+1} P_0 P^{k+1}, so it converges when the spectral radius of aPaP is below 1, which holds exactly when every eigenvalue of aP0aP_0 has real part below 1/21/2. The first prediction is the multidimensional autoconvolution of the data. These are theorems, proved in proofs/correctness.md. The model itself, and the estimate of aa by adaptive subtraction, are not theorems: the first is a physical model, the second a heuristic.

Proof: Under the surface-multiple model P = P0 + a P0 P the data without surface multiples are P (I + a P)^(-1), the iteration gives the partial sums of a Neumann series that converge exactly when the spectral radius of aP is below 1, and the first prediction is the multidimensional autoconvolution of the datafull

Setting. Fix one frequency ω\omega. The data form a complex N×NN \times N matrix PP: entry (i,j)(i, j) is the spectrum at ω\omega of the trace recorded at surface position ii from a source at surface position jj, on one grid for sources and receivers. The surface operator aa is a complex number; it holds the reflection coefficient of the free surface, the inverse of the source spectrum and the step of the sum over surface positions. The data without surface multiples, P0P_0, are linked to PP by the model

P=P0+aP0P.(M)P = P_0 + a P_0 P. \tag{M}

(M) is the feedback model of Verschuur, Berkhout and Wapenaar (1992), with the surface and source terms folded into one scalar: every surface multiple is a full event of PP from the source to some surface position ll, a reflection there with the factor aa, and an event of P0P_0 from ll to the receiver. The product P0PP_0 P sums over ll. We take (M) as given; the claims are about what follows from it. The function srme_direct solves X(I+aP)=PX (I + aP) = P for XX; lines L2 to L4 compute P0(0)=PP_0^{(0)} = P and P0(k+1)=P−aP0(k)PP_0^{(k+1)} = P - a P_0^{(k)} P. ρ(⋅)\rho(\cdot) is the spectral radius.

Claim 1 (direct solution). If I+aPI + aP is invertible, (M) has exactly one solution, P0=P(I+aP)−1P_0 = P (I + aP)^{-1}. Conversely, for any P0P_0 with I−aP0I - aP_0 invertible, the data P=(I−aP0)−1P0P = (I - aP_0)^{-1} P_0 satisfy (M), and then I+aP=(I−aP0)−1I + aP = (I - aP_0)^{-1} is invertible and srme_direct returns P0P_0.

Proof. (M) is P0(I+aP)=PP_0 (I + aP) = P, which has the one solution P(I+aP)−1P (I + aP)^{-1} when I+aPI + aP is invertible. For the converse, (I−aP0)P=P0(I - aP_0)P = P_0 gives P=P0+aP0PP = P_0 + aP_0 P, which is (M). Since P0P_0 commutes with I−aP0I - aP_0, also P=P0(I−aP0)−1P = P_0 (I - aP_0)^{-1}, and I+aP=((I−aP0)+aP0)(I−aP0)−1=(I−aP0)−1I + aP = \big((I - aP_0) + aP_0\big)(I - aP_0)^{-1} = (I - aP_0)^{-1}. □\square

So the direct form recovers P0P_0 exactly whenever the data obey (M), however strong the multiples are. The function add_surface_multiples, used in the tests, is the map of the converse.

Claim 2 (the iteration gives the Neumann partial sums). For every k≥0k \ge 0,

P0(k)=∑j=0k(−a)jPj+1,P0(k)−P0=(−1)kak+1P0Pk+1,P_0^{(k)} = \sum_{j=0}^{k} (-a)^j P^{j+1}, \qquad P_0^{(k)} - P_0 = (-1)^k a^{k+1} P_0 P^{k+1},

where the second formula assumes (M).

Proof. For k=0k = 0 the sum is PP. If the formula holds for kk, then P−aP0(k)P=P+∑j=0k(−a)j+1Pj+2P - a P_0^{(k)} P = P + \sum_{j=0}^{k} (-a)^{j+1} P^{j+2}, which is the sum for k+1k + 1. For the error Ek=P0(k)−P0E_k = P_0^{(k)} - P_0, subtract (M), written as P0=P−aP0PP_0 = P - aP_0P, from the iteration: Ek+1=−aEkPE_{k+1} = -a E_k P. And E0=P−P0=aP0PE_0 = P - P_0 = aP_0P by (M). So Ek=(−a)kaP0Pk+1E_k = (-a)^k a P_0 P^{k+1}. □\square

Claim 3 (convergence). If ρ(aP)<1\rho(aP) < 1, then P0(k)→P0P_0^{(k)} \to P_0, and for every ε>0\varepsilon > 0 the error is O((ρ(aP)+ε)k)O((\rho(aP) + \varepsilon)^k). For N=1N = 1 and P0≠0P_0 \ne 0, the iteration converges if and only if ∣aP∣<1|aP| < 1.

Proof. Ek=(−1)kP0(aP)k+1E_k = (-1)^k P_0 (aP)^{k+1} by Claim 2, and ∥(aP)k∥=O((ρ(aP)+ε)k)\|(aP)^k\| = O((\rho(aP) + \varepsilon)^k) for every ε>0\varepsilon > 0 by Gelfand's formula ρ(B)=lim⁡k∥Bk∥1/k\rho(B) = \lim_k \|B^k\|^{1/k}. For N=1N = 1, ∣Ek∣=∣P0∣ ∣aP∣k+1|E_k| = |P_0|\,|aP|^{k+1}, which tends to 00 if and only if ∣aP∣<1|aP| < 1. □\square

Claim 4 (when the iteration converges). Let PP be given by P0P_0 as in Claim 1. Then ρ(aP)<1\rho(aP) < 1 if and only if every eigenvalue λ\lambda of aP0aP_0 has real part below 1/21/2.

Proof. aP=aP0(I−aP0)−1aP = aP_0 (I - aP_0)^{-1} is the rational function g(λ)=λ/(1−λ)g(\lambda) = \lambda/(1 - \lambda) of aP0aP_0, and gg has no pole on the spectrum of aP0aP_0 because I−aP0I - aP_0 is invertible. By the spectral mapping theorem the eigenvalues of aPaP are the g(λ)g(\lambda). Now ∣g(λ)∣<1|g(\lambda)| < 1 if and only if ∣λ∣2<∣1−λ∣2=1−2 Re λ+∣λ∣2|\lambda|^2 < |1 - \lambda|^2 = 1 - 2\,\mathrm{Re}\,\lambda + |\lambda|^2, that is Re λ<1/2\mathrm{Re}\,\lambda < 1/2. □\square

For one flat reflector with coefficient rr under a free surface with coefficient −1-1 and a unit impulse source, P0=rzP_0 = r z with z=e−iωτz = e^{-i\omega\tau} and a=−1a = -1, so aP0=−rzaP_0 = -rz. At the frequencies with z=−1z = -1 this is rr, so the iteration converges at every frequency if and only if r<1/2r < 1/2, and the worst rate is ∣aP∣=r/(1−r)|aP| = r/(1 - r), which is 2/32/3 for r=0.4r = 0.4. For r≥1/2r \ge 1/2 the direct form of Claim 1 still works.

Claim 5 (the first prediction). The first step is P0(1)=P−aP2P_0^{(1)} = P - a P^2, and the time-domain trace of (P2)ij(P^2)_{ij} is ∑lpil∗plj\sum_l p_{il} * p_{lj}, the convolution in time of the trace from jj to ll with the trace from ll to ii, summed over the surface positions ll. For N=1N = 1 it is the autoconvolution of the trace (circular on the periodic time axis of the code).

Proof. (P2)ij=∑lPilPlj(P^2)_{ij} = \sum_l P_{il} P_{lj} at every frequency; by the convolution theorem of the DFT the product of spectra is the spectrum of the circular convolution of the traces, and the inverse DFT is linear. □\square

In the one-reflector case the data trace has (−1)m+1rm(-1)^{m+1} r^m at time mτm\tau (the multiple of order m−1m - 1), and the trace of P2=r2z2/(1+rz)2P^2 = r^2 z^2 / (1 + rz)^2 has (−1)m(m−1)rm(-1)^m (m - 1) r^m there. So P+P2P + P^2 has (−1)m+1(2−m)rm(-1)^{m+1}(2 - m) r^m: the first-order multiple (m=2m = 2) is removed exactly, the primary is kept, and the higher orders remain with changed amplitudes. The later terms of the series correct them.

Claim 6 (the least-squares scalar). The function estimate_surface_scalar returns the ss that minimizes ∑k∥Pk−sMk∥F2\sum_k \|P_k - s M_k\|_F^2 over complex ss, namely s=∑k⟨Mk,Pk⟩/∑k∥Mk∥F2s = \sum_k \langle M_k, P_k\rangle / \sum_k \|M_k\|_F^2, where ⟨M,P⟩=∑ijMij‾Pij\langle M, P\rangle = \sum_{ij} \overline{M_{ij}} P_{ij}.

Proof. The function is ∥P∥2−2 Re(sˉ⟨M,P⟩)+∣s∣2∥M∥2\|P\|^2 - 2\,\mathrm{Re}(\bar s \langle M, P\rangle) + |s|^2 \|M\|^2, summed over kk; completing the square in ss gives the minimizer. □\square

The claim is about the formula. That the minimum-energy scalar equals the true −a-a is not a theorem: the primaries left in PkP_k are not orthogonal to the prediction, and the rule pulls the scalar toward a value that also removes part of them. This is why adaptive subtraction is a heuristic.

Claim 7 (cost). With nfn_f frequencies and NN surface positions, the direct form costs O(nfN3)O(n_f N^3) and KK steps of the iteration cost O(nfKN3)O(n_f K N^3) with dense products, plus the transforms of the N2N^2 traces.

Proof. Each frequency needs one dense solve with NN right-hand sides, O(N3)O(N^3), or KK products of N×NN \times N matrices, O(N3)O(N^3) each. □\square

Complexity

In the real-RAM model, with ff frequencies and ss surface positions, the direct form costs O(fs3)O(f s^3): one dense solve with ss right-hand sides per frequency. KK steps of the iteration cost O(Kfs3)O(K f s^3). The transforms of the s2s^2 traces add O(s2nlog⁡n)O(s^2 n \log n) for nn time samples with an FFT. Space is O(fs2)O(f s^2) for the data at all frequencies. For 3D surveys ss counts the sources and receivers in two dimensions, so the cost is large, and the data must first be interpolated to the grid.

Properties

  • Data-driven: no velocities, no subsurface model (a property of the model, not an approximation).
  • Exact under the model, with the direct form (a theorem).
  • Removes surface multiples of all orders and all moveouts, including multiples from dipping and curved reflectors (a consequence of the model).
  • Does not remove internal multiples, which bounce only between layers below the surface.
  • Needs dense sources and receivers on the same grid, including the near offsets that the recording usually misses.

Variants and improvements

  • Adaptive subtraction with short filters in time and space windows, to absorb errors of the source wavelet, the surface coefficient and the data (a heuristic).
  • Estimation of primaries by sparse inversion (EPSI): treat P0P_0 and the source as unknowns of an inversion with a sparsity prior, in place of prediction and subtraction.
  • Internal multiple prediction with the same idea, using a chosen layer boundary in place of the surface.
  • 3D SRME with interpolation of the missing sources and receivers.
  • The same matrix calculus underlies seismic interferometry, which correlates in place of convolving.

When to use it

Use it on marine data with a strong sea floor and a free surface, where surface multiples dominate. It is usually the first step of multiple removal, before the parabolic Radon transform cleans up what remains, and before migration, which would otherwise image the multiples as false reflectors.

Pitfalls

  • Missing near offsets and coarse source sampling break the sum over surface positions; interpolate first.
  • The direct wave and the source ghost must be removed or modeled, or they enter the prediction.
  • Adaptive subtraction can remove primaries that overlap the multiples; keep the filters short and the windows large.
  • The iteration diverges at frequencies where the spectral radius of aPaP is 1 or more, as for a sea floor with a strong reflection; the direct form or adaptive damping is then needed.
  • 3D effects: a 2D SRME on 3D data predicts multiples at wrong times when the surface paths leave the plane of the line.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

imgkit.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Shared helper of the imaging and inverse problems pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Small images and signals for the imaging and inverse problems pages.

Conventions:
- A signal is a list of numbers. An image is a list of rows, img[i][j], with
  row i from the top and column j from the left.
- An n x n image covers the square [-1, 1]^2. The center of pixel (i, j) is
  x_j = -1 + (2 j + 1) / n and y_i = 1 - (2 i + 1) / n, so y goes up.
- DFT: X_k = sum_j x_j exp(-2 pi i j k / n), unnormalized; the inverse has
  the factor 1 / n. Index k stands for frequency k for k < n / 2 and k - n
  otherwise. fftshift moves the zero frequency to position n // 2.
- Periodic convolution kernels are stored with their center at index 0
  (wrapped around), so a delta kernel gives the identity and no shift.
"""

import cmath
import math

# ------------------------------------------------------------------ images


def new_image(n1, n2, value=0.0):
    """An n1 x n2 image (n1 rows, n2 columns) filled with value."""
    return [[value] * n2 for _ in range(n1)]


def img_add(a, b):
    """The pixelwise sum a + b."""
    return [[x + y for x, y in zip(ra, rb)] for ra, rb in zip(a, b)]


def img_scale(a, c):
    """The image c a."""
    return [[c * x for x in row] for row in a]


def img_dot(a, b):
    """<a, b> = sum conj(a_ij) b_ij."""
    return sum(x.conjugate() * y for ra, rb in zip(a, b) for x, y in zip(ra, rb))


def img_norm(a):
    """The Euclidean (Frobenius) norm of an image."""
    return math.sqrt(sum(abs(x) ** 2 for row in a for x in row))


def flatten(img):
    """Row-major vector of an image."""
    return [x for row in img for x in row]


def unflatten(v, n1, n2):
    """The n1 x n2 image of a row-major vector."""
    return [list(v[i * n2:(i + 1) * n2]) for i in range(n1)]


# ------------------------------------------------------------------ DFT


def _is_pow2(n):
    return n > 0 and n & (n - 1) == 0


def _fft_pow2(x):
    """Iterative radix-2 FFT, unnormalized forward transform."""
    n = len(x)
    a = [complex(v) for v in x]
    j = 0
    for i in range(1, n):
        bit = n >> 1
        while j & bit:
            j ^= bit
            bit >>= 1
        j |= bit
        if i < j:
            a[i], a[j] = a[j], a[i]
    size = 2
    while size <= n:
        half = size // 2
        tw = [cmath.exp(-2j * math.pi * k / size) for k in range(half)]
        for start in range(0, n, size):
            for k in range(half):
                u = a[start + k]
                v = a[start + k + half] * tw[k]
                a[start + k] = u + v
                a[start + k + half] = u - v
        size *= 2
    return a


def dft(x):
    """X_k = sum_j x_j exp(-2 pi i j k / n). Radix-2 FFT when n is a power of 2."""
    n = len(x)
    if n == 0:
        return []
    if _is_pow2(n):
        return _fft_pow2(x)
    w = [cmath.exp(-2j * math.pi * t / n) for t in range(n)]
    return [sum(x[j] * w[(j * k) % n] for j in range(n)) for k in range(n)]


def idft(xf):
    """x_j = (1/n) sum_k X_k exp(2 pi i j k / n)."""
    n = len(xf)
    if n == 0:
        return []
    y = dft([complex(v).conjugate() for v in xf])
    return [v.conjugate() / n for v in y]


def _rows_then_cols(img, f):
    rows = [f(row) for row in img]
    cols = [f(list(col)) for col in zip(*rows)]
    return [list(r) for r in zip(*cols)]


def dft2(img):
    """2D DFT: X_kl = sum_jq x_jq exp(-2 pi i (j k / n1 + q l / n2))."""
    return _rows_then_cols(img, dft)


def idft2(img):
    """Inverse 2D DFT, with the factor 1 / (n1 n2)."""
    return _rows_then_cols(img, idft)


def _shift1(x, s):
    return list(x[s:]) + list(x[:s])


def fftshift(x):
    """Move the zero frequency to position n // 2 (1D, or both axes of an image)."""
    if x and isinstance(x[0], (list, tuple)):
        rows = [fftshift(r) for r in x]
        return _shift1(rows, (len(rows) + 1) // 2)
    return _shift1(x, (len(x) + 1) // 2)


def ifftshift(x):
    """The inverse of fftshift (1D, or both axes of an image)."""
    if x and isinstance(x[0], (list, tuple)):
        rows = [ifftshift(r) for r in x]
        return _shift1(rows, len(rows) // 2)
    return _shift1(x, len(x) // 2)


def circ_conv(x, h):
    """Periodic convolution y_i = sum_j h_j x_{(i - j) mod n}, kernel centered at index 0."""
    n = len(x)
    nz = [(j, hj) for j, hj in enumerate(h) if hj != 0]
    return [sum(hj * x[(i - j) % n] for j, hj in nz) for i in range(n)]


def circ_conv2(img, h):
    """Periodic 2D convolution with the kernel h centered at index (0, 0)."""
    n1, n2 = len(img), len(img[0])
    nz = [(p, q, h[p][q]) for p in range(len(h)) for q in range(len(h[0])) if h[p][q] != 0]
    out = new_image(n1, n2)
    for i in range(n1):
        for j in range(n2):
            out[i][j] = sum(v * img[(i - p) % n1][(j - q) % n2] for p, q, v in nz)
    return out


# ------------------------------------------------------------------ phantoms


def pixel_centers(n):
    """(xs, ys): xs[j] = -1 + (2 j + 1) / n and ys[i] = 1 - (2 i + 1) / n."""
    xs = [-1.0 + (2 * j + 1) / n for j in range(n)]
    ys = [1.0 - (2 * i + 1) / n for i in range(n)]
    return xs, ys


# Rows: rho, A, B, x0, y0, phi (degrees). A is the semi-axis along the
# direction phi (counterclockwise from the x axis), B the other semi-axis.
# Geometry and densities of Shepp and Logan (1974), as reproduced in Kak and
# Slaney, Principles of Computerized Tomographic Imaging, Table 3.1. The value
# at the center (0, 0) is 2 - 0.98 = 1.02.
SHEPP_LOGAN = [
    (2.0, 0.92, 0.69, 0.0, 0.0, 90.0),
    (-0.98, 0.874, 0.6624, 0.0, -0.0184, 90.0),
    (-0.02, 0.31, 0.11, 0.22, 0.0, 72.0),
    (-0.02, 0.41, 0.16, -0.22, 0.0, 108.0),
    (0.01, 0.25, 0.21, 0.0, 0.35, 90.0),
    (0.01, 0.046, 0.046, 0.0, 0.1, 0.0),
    (0.01, 0.046, 0.046, 0.0, -0.1, 0.0),
    (0.01, 0.046, 0.023, -0.08, -0.605, 0.0),
    (0.01, 0.023, 0.023, 0.0, -0.605, 0.0),
    (0.01, 0.046, 0.023, 0.06, -0.605, 90.0),
]

# The same ellipses with the gray levels of Toft (1996), which give more
# contrast. The value at the center is 1 - 0.8 = 0.2.
MODIFIED_SHEPP_LOGAN = [
    (rho, a, b, x0, y0, phi)
    for rho, (_, a, b, x0, y0, phi) in zip(
        (1.0, -0.8, -0.2, -0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1), SHEPP_LOGAN
    )
]


def ellipse_value(x, y, table):
    """The phantom value at the point (x, y): the sum of rho over the ellipses that hold it."""
    total = 0.0
    for rho, a, b, x0, y0, phi in table:
        c, s = math.cos(math.radians(phi)), math.sin(math.radians(phi))
        dx, dy = x - x0, y - y0
        u = dx * c + dy * s
        v = -dx * s + dy * c
        if (u / a) ** 2 + (v / b) ** 2 <= 1.0:
            total += rho
    return total


def ellipse_phantom(n, table):
    """The n x n image of an ellipse table, sampled at the pixel centers."""
    xs, ys = pixel_centers(n)
    return [[ellipse_value(x, y, table) for x in xs] for y in ys]


def disk_phantom(n, radius):
    """1 at pixel centers with x^2 + y^2 <= radius^2, 0 elsewhere."""
    xs, ys = pixel_centers(n)
    r2 = radius * radius
    return [[1.0 if x * x + y * y <= r2 else 0.0 for x in xs] for y in ys]


def spikes_1d(n, positions, amplitudes):
    """A signal of length n with the given amplitudes at the given positions."""
    out = [0.0] * n
    for p, a in zip(positions, amplitudes):
        out[p] += a
    return out


# ------------------------------------------------------------------ projector


def parallel_beam_matrix(n, angles, nbins):
    """Pixel-driven discrete Radon transform of an n x n image on [-1, 1]^2.

    Each pixel center (x, y) projects to s = x cos(theta) + y sin(theta). Its
    value times the pixel area over the bin width is split linearly between
    the two nearest bin centers. The bins cover [-sqrt(2), sqrt(2)]. Row
    a * nbins + b holds angle a and bin b; column i * n + j holds pixel (i, j).
    Returns the sparse rows, each a list of (column, weight) pairs.
    Pixel-driven projection has a ripple: with a bin width close to the pixel
    size, a disk projection is off by up to about 10 percent in some bins. A
    bin of about twice the pixel size (nbins = 23 for n = 32) keeps it near
    1 percent.
    """
    xs, ys = pixel_centers(n)
    smax = math.sqrt(2.0)
    width = 2.0 * smax / nbins
    scale = (2.0 / n) ** 2 / width
    rows = []
    for theta in angles:
        c, s = math.cos(theta), math.sin(theta)
        acc = [dict() for _ in range(nbins)]
        for i, y in enumerate(ys):
            for j, x in enumerate(xs):
                t = (x * c + y * s + smax) / width - 0.5
                b0 = math.floor(t)
                frac = t - b0
                col = i * n + j
                for b, w in ((b0, 1.0 - frac), (b0 + 1, frac)):
                    if 0 <= b < nbins and w > 0.0:
                        acc[b][col] = acc[b].get(col, 0.0) + w * scale
        rows.extend(sorted(d.items()) for d in acc)
    return rows


def sp_matvec(rows, x):
    """y = A x for sparse rows of (column, weight) pairs."""
    return [sum(w * x[c] for c, w in row) for row in rows]


def sp_rmatvec(rows, y, ncols):
    """x = A^H y for sparse rows of (column, weight) pairs and ncols columns."""
    out = [0.0] * ncols
    for row, yi in zip(rows, y):
        if yi == 0:
            continue
        for c, w in row:
            out[c] += w.conjugate() * yi
    return out


# ------------------------------------------------------------------ noise


def gauss_noise(rng, shape, sigma):
    """Independent N(0, sigma^2) values: a list for an int shape, an image for (n1, n2)."""
    if isinstance(shape, int):
        return [rng.gauss(0.0, sigma) for _ in range(shape)]
    n1, n2 = shape
    return [[rng.gauss(0.0, sigma) for _ in range(n2)] for _ in range(n1)]


def _poisson_small(rng, lam):
    """Knuth's product method, exact for a mean lam <= 30."""
    limit = math.exp(-lam)
    k, p = 0, rng.random()
    while p > limit:
        k += 1
        p *= rng.random()
    return k


def poisson_sample(rng, lam):
    """An exact Poisson(lam) sample: a sum of Knuth samples with means at most 30."""
    if lam < 0:
        raise ValueError("negative mean")
    total = 0
    while lam > 30.0:
        total += _poisson_small(rng, 30.0)
        lam -= 30.0
    if lam > 0.0:
        total += _poisson_small(rng, lam)
    return total
imgla.py 259 lines
# SPDX-License-Identifier: MIT
# Shared helper of the imaging and inverse problems pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Dense linear algebra on lists of rows (float, complex or Fraction entries).

A matrix is a list of rows. A vector is a list of numbers. The inner product
is <u, v> = sum_i conj(u_i) v_i, linear in the second argument, so that the
adjoint A^H satisfies <A x, y> = <x, A^H y>.
"""

import math


def _flat(x):
    """Flatten a list of rows (an image) into one list; a vector is returned as is."""
    if x and isinstance(x[0], (list, tuple)):
        return [v for row in x for v in row]
    return x


def zeros(m, n):
    """The m x n zero matrix."""
    return [[0.0] * n for _ in range(m)]


def eye(n):
    """The n x n identity matrix."""
    out = zeros(n, n)
    for i in range(n):
        out[i][i] = 1.0
    return out


def transpose(a):
    """A^T."""
    return [list(col) for col in zip(*a)]


def conj_transpose(a):
    """A^H, the conjugate transpose."""
    return [[v.conjugate() for v in col] for col in zip(*a)]


def matmul(a, b):
    """The product A B."""
    bt = list(zip(*b))
    return [[sum(x * y for x, y in zip(row, col)) for col in bt] for row in a]


def matvec(a, x):
    """The product A x."""
    return [sum(v * w for v, w in zip(row, x)) for row in a]


def rmatvec(a, y):
    """The product A^H y."""
    n = len(a[0]) if a else 0
    out = [0.0] * n
    for row, yi in zip(a, y):
        if yi == 0:
            continue
        for j, v in enumerate(row):
            out[j] += v.conjugate() * yi
    return out


def dot(u, v):
    """<u, v> = sum_i conj(u_i) v_i. Images (lists of rows) are flattened."""
    return sum(a.conjugate() * b for a, b in zip(_flat(u), _flat(v)))


def norm2(x):
    """The Euclidean norm. Images (lists of rows) are flattened."""
    return math.sqrt(sum(abs(v) ** 2 for v in _flat(x)))


def solve(a, b):
    """Solve A x = b by Gaussian elimination with partial pivoting.

    b is a vector or a matrix (a list of rows). A must be square and
    nonsingular; a zero pivot raises ValueError. Fractions stay exact.
    """
    n = len(a)
    vec = not (b and isinstance(b[0], (list, tuple)))
    rhs = [[bi] for bi in b] if vec else [list(r) for r in b]
    m = [list(row) + rhs[i] for i, row in enumerate(a)]
    w = len(m[0])
    for c in range(n):
        p = max(range(c, n), key=lambda r: abs(m[r][c]))
        if m[p][c] == 0:
            raise ValueError("singular matrix")
        m[c], m[p] = m[p], m[c]
        piv = m[c][c]
        for r in range(c + 1, n):
            f = m[r][c] / piv
            if f != 0:
                mr, mc = m[r], m[c]
                for j in range(c, w):
                    mr[j] -= f * mc[j]
    x = [[0.0] * (w - n) for _ in range(n)]
    for r in range(n - 1, -1, -1):
        for j in range(w - n):
            s = m[r][n + j] - sum(m[r][k] * x[k][j] for k in range(r + 1, n))
            x[r][j] = s / m[r][r]
    return [row[0] for row in x] if vec else x


def cholesky(a):
    """Lower triangular L with A = L L^H for a Hermitian positive definite A."""
    n = len(a)
    low = zeros(n, n)
    for j in range(n):
        d = a[j][j] - sum(abs(low[j][k]) ** 2 for k in range(j))
        d = d.real if isinstance(d, complex) else d
        if not d > 0:
            raise ValueError("matrix is not positive definite")
        ljj = math.sqrt(d)
        low[j][j] = ljj
        for i in range(j + 1, n):
            s = a[i][j] - sum(low[i][k] * low[j][k].conjugate() for k in range(j))
            low[i][j] = s / ljj
    return low


def cho_solve(low, b):
    """Solve (L L^H) x = b, with L from cholesky."""
    n = len(low)
    z = [0.0] * n
    for i in range(n):
        z[i] = (b[i] - sum(low[i][k] * z[k] for k in range(i))) / low[i][i]
    x = [0.0] * n
    for i in range(n - 1, -1, -1):
        s = z[i] - sum(low[k][i].conjugate() * x[k] for k in range(i + 1, n))
        x[i] = s / low[i][i].conjugate()
    return x


def _rot_params(app, aqq, apq):
    """c, s of the Jacobi rotation that zeroes the (p, q) entry of [[app, apq], [apq, aqq]]."""
    theta = (aqq - app) / (2.0 * apq)
    t = (1.0 if theta >= 0 else -1.0) / (abs(theta) + math.sqrt(theta * theta + 1.0))
    c = 1.0 / math.sqrt(1.0 + t * t)
    return c, c * t


def sym_eig(a, tol=1e-15, max_sweeps=100):
    """Eigenvalues (ascending) and eigenvectors (as columns) of a real symmetric matrix.

    Cyclic Jacobi method. Returns (w, Q) with A = Q diag(w) Q^T.
    """
    n = len(a)
    m = [[float(v) for v in row] for row in a]
    q = eye(n)
    for _ in range(max_sweeps):
        off = sum(m[i][j] ** 2 for i in range(n) for j in range(n) if i != j)
        scale = sum(m[i][i] ** 2 for i in range(n)) + off
        if off <= (tol * tol) * scale or off == 0.0:
            break
        for p in range(n - 1):
            for r in range(p + 1, n):
                apq = m[p][r]
                if apq == 0.0:
                    continue
                c, s = _rot_params(m[p][p], m[r][r], apq)
                for k in range(n):
                    mkp, mkr = m[k][p], m[k][r]
                    m[k][p] = c * mkp - s * mkr
                    m[k][r] = s * mkp + c * mkr
                mp, mr = m[p], m[r]
                for k in range(n):
                    mpk, mrk = mp[k], mr[k]
                    mp[k] = c * mpk - s * mrk
                    mr[k] = s * mpk + c * mrk
                m[p][r] = m[r][p] = 0.0
                for k in range(n):
                    qkp, qkr = q[k][p], q[k][r]
                    q[k][p] = c * qkp - s * qkr
                    q[k][r] = s * qkp + c * qkr
    order = sorted(range(n), key=lambda i: m[i][i])
    w = [m[i][i] for i in order]
    qs = [[q[k][i] for i in order] for k in range(n)]
    return w, qs


def _complete(cols, m):
    """Replace zero columns of an m-row column list by unit vectors orthogonal to the others."""
    for idx, col in enumerate(cols):
        if any(v != 0.0 for v in col):
            continue
        for e in range(m):
            cand = [0.0] * m
            cand[e] = 1.0
            for _ in range(2):
                for jdx, other in enumerate(cols):
                    if jdx == idx or not any(v != 0.0 for v in other):
                        continue
                    h = sum(a * b for a, b in zip(other, cand))
                    cand = [a - h * b for a, b in zip(cand, other)]
            nrm = math.sqrt(sum(v * v for v in cand))
            if nrm > 0.5:
                cols[idx] = [v / nrm for v in cand]
                break
    return cols


def svd(a, tol=1e-15, max_sweeps=100):
    """Thin SVD of a real m x n matrix by one-sided Jacobi (Hestenes).

    Returns (U, S, V) with p = min(m, n): U is m x p, S a list of p values in
    descending order, V is n x p, U^T U = I, V^T V = I and A = U diag(S) V^T.
    """
    m, n = len(a), len(a[0])
    if m < n:
        v, s, u = svd(transpose(a), tol, max_sweeps)
        return u, s, v
    cols = [[float(a[i][j]) for i in range(m)] for j in range(n)]
    vcols = [[1.0 if i == j else 0.0 for i in range(n)] for j in range(n)]
    for _ in range(max_sweeps):
        rotated = False
        for p in range(n - 1):
            for r in range(p + 1, n):
                cp, cr = cols[p], cols[r]
                alpha = sum(x * x for x in cp)
                beta = sum(x * x for x in cr)
                gamma = sum(x * y for x, y in zip(cp, cr))
                if gamma == 0.0 or abs(gamma) <= tol * math.sqrt(alpha * beta):
                    continue
                rotated = True
                c, s = _rot_params(alpha, beta, gamma)
                cols[p] = [c * x - s * y for x, y in zip(cp, cr)]
                cols[r] = [s * x + c * y for x, y in zip(cp, cr)]
                vp, vr = vcols[p], vcols[r]
                vcols[p] = [c * x - s * y for x, y in zip(vp, vr)]
                vcols[r] = [s * x + c * y for x, y in zip(vp, vr)]
        if not rotated:
            break
    sig = [math.sqrt(sum(x * x for x in col)) for col in cols]
    # A column below 1e-150 times the largest one is zero to working precision;
    # its squares underflow, so its direction carries no information.
    floor = max(sig) * 1e-150 if sig else 0.0
    sig = [t if t > floor and t > 1e-150 else 0.0 for t in sig]
    order = sorted(range(n), key=lambda j: -sig[j])
    s_out = [sig[j] for j in order]
    ucols = [[x / sig[j] for x in cols[j]] if sig[j] > 0.0 else [0.0] * m for j in order]
    ucols = _complete(ucols, m)
    u = [[ucols[j][i] for j in range(n)] for i in range(m)]
    v = [[vcols[j][i] for j in order] for i in range(n)]
    return u, s_out, v


def adjoint_gap(apply_a, apply_ah, x, y):
    """|<A x, y> - <x, A^H y>| / (||A x|| ||y||) for given functions A and A^H.

    x and y may be vectors or images (lists of rows). If the denominator is
    zero, the absolute gap is returned.
    """
    ax = apply_a(x)
    gap = abs(dot(ax, y) - dot(x, apply_ah(y)))
    den = norm2(ax) * norm2(y)
    return gap / den if den > 0.0 else gap
surface_related_multiple_elimination.py 96 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/surface-related-multiple-elimination/. The authors are listed in prov/JC2TNG.jsonl.
"""Surface-related multiple elimination (SRME) in the data-matrix form.

For one frequency, the data form a square matrix P: row = receiver
position, column = source position, on the same grid. The data without
surface multiples are P0, and the free surface links them by

    P = P0 + a P0 P,

where the surface operator a = r / S folds the free-surface reflection
coefficient r (-1 for water over air), the inverse of the source spectrum S
and the spatial step of the sum into one number per frequency. Then
P0 = P (I + a P)^(-1). The iteration P0 <- P - a P0 P converges to it when
the spectral radius of a P is below 1. All matrices are complex lists of rows.
"""

import imgkit as ik
import imgla as la


def _sub(a, b):
    return [[x - y for x, y in zip(ra, rb)] for ra, rb in zip(a, b)]


def _scale(a, s):
    return [[s * x for x in row] for row in a]


def srme_iterative(p, a, iters):
    """Iterate P0 <- P - a P0 P, starting from P0 = P, for one frequency."""
    p0 = [list(row) for row in p]  # @line L2
    for _ in range(iters):  # @line L3
        p0 = _sub(p, _scale(la.matmul(p0, p), a))  # @line L4
    return p0


def srme_direct(p, a):
    """P0 = P (I + a P)^(-1) for one frequency, by one linear solve."""
    n = len(p)
    m = [[(1.0 if i == j else 0.0) + a * p[i][j] for j in range(n)] for i in range(n)]
    # X (I + a P) = P is the same as (I + a P)^T X^T = P^T.
    xt = la.solve(la.transpose(m), la.transpose(p))
    return la.transpose(xt)


def srme(data, surface, iters=None):
    """Apply SRME at every frequency.

    data is a list of matrices P(w_k), surface a list of the scalars a(w_k).
    With iters=None the direct form is used, otherwise the iteration.
    """
    out = []
    for p, a in zip(data, surface):  # @line L1
        if iters is None:
            out.append(srme_direct(p, a))
        else:
            out.append(srme_iterative(p, a, iters))  # @line L5
    return out  # @line L6


def add_surface_multiples(p0, a):
    """The data with surface multiples: P = (I - a P0)^(-1) P0, the inverse map of SRME."""
    n = len(p0)
    m = [[(1.0 if i == j else 0.0) - a * p0[i][j] for j in range(n)] for i in range(n)]
    return la.solve(m, p0)


def estimate_surface_scalar(data, predicted):
    """The least-squares scalar s minimizing sum_k ||P_k - s M_k||^2 (Frobenius).

    This is the minimum-energy rule of adaptive subtraction with one
    complex scalar for the whole data set; it is a heuristic, not part of the
    exact relation.
    """
    num = 0j
    den = 0.0
    for p, m in zip(data, predicted):
        for rp, rm in zip(p, m):
            for x, y in zip(rp, rm):
                num += y.conjugate() * x
                den += abs(y) ** 2
    return num / den


def srme_trace(trace, a=-1.0, iters=None):
    """SRME for one zero-offset trace of a 1D earth (each P is a 1 x 1 matrix).

    The trace is periodic with n samples; a is the surface operator, -1 for
    a unit impulse source under a free surface with r = -1. Returns the trace
    without surface multiples.
    """
    spec = ik.dft(trace)
    data = [[[v]] for v in spec]
    out = srme(data, [a] * len(spec), iters)
    return [v.real for v in ik.idft([m[0][0] for m in out])]
test_surface_related_multiple_elimination.py 121 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/surface-related-multiple-elimination/. The authors are listed in prov/JC2TNG.jsonl.

import cmath
import math
import random

import imgkit as ik
import imgla as la
from surface_related_multiple_elimination import (
    add_surface_multiples,
    estimate_surface_scalar,
    srme,
    srme_direct,
    srme_iterative,
    srme_trace,
)


def one_reflector_spectrum(n, tau, r):
    """P = r z / (1 + r z), z = exp(-2 pi i k tau / n): one reflector under a free surface."""
    out = []
    for k in range(n):
        z = cmath.exp(-2j * math.pi * k * tau / n)
        out.append(r * z / (1 + r * z))
    return out


def max_diff(a, b):
    return max(abs(x - y) for ra, rb in zip(a, b) for x, y in zip(ra, rb))


def random_matrix(rng, n, scale):
    return [[complex(rng.gauss(0.0, scale), rng.gauss(0.0, scale)) for _ in range(n)] for _ in range(n)]


def test_one_reflector_trace_has_the_expected_multiples():
    n, tau, r = 64, 8, 0.5
    tr = [v.real for v in ik.idft(one_reflector_spectrum(n, tau, r))]
    # The series r, -r^2, r^3, .. wraps around the period of 64 samples.
    wrap = 1.0 / (1.0 - r ** 8)
    for m in range(1, 8):
        assert abs(tr[m * tau] - (-1) ** (m + 1) * r ** m * wrap) < 1e-12
    assert max(abs(tr[i]) for i in range(n) if i % tau) < 1e-12


def test_direct_srme_leaves_only_the_primary():
    n, tau, r = 64, 8, 0.5
    tr = [v.real for v in ik.idft(one_reflector_spectrum(n, tau, r))]
    out = srme_trace(tr, a=-1.0)
    expect = [r if i == tau else 0.0 for i in range(n)]
    assert max(abs(p - q) for p, q in zip(out, expect)) < 1e-12


def test_first_prediction_is_the_autoconvolution():
    n, tau, r = 64, 8, 0.5
    spec = one_reflector_spectrum(n, tau, r)
    tr = [v.real for v in ik.idft(spec)]
    auto = ik.circ_conv(tr, tr)
    pred = [v.real for v in ik.idft([s * s for s in spec])]
    assert max(abs(p - q) for p, q in zip(auto, pred)) < 1e-12
    # The first-order multiple r^2 at 2 tau comes from the primary convolved with itself.
    assert abs(pred[2 * tau] - r * r) < 0.01


def test_iteration_converges_geometrically():
    n, tau, r = 32, 4, 0.4
    tr = [v.real for v in ik.idft(one_reflector_spectrum(n, tau, r))]
    expect = [r if i == tau else 0.0 for i in range(n)]
    errs = []
    for k in (5, 10, 20, 40):
        out = srme_trace(tr, a=-1.0, iters=k)
        errs.append(max(abs(p - q) for p, q in zip(out, expect)))
    assert errs[0] > errs[1] > errs[2] > errs[3]
    assert errs[3] < 1e-6
    # The worst frequency has |a P| = r / (1 - r) = 2/3.
    assert errs[3] / errs[2] < (2.0 / 3.0) ** 20 * 1.5


def test_matrix_relation_and_exact_recovery():
    rng = random.Random(1)
    n = 4
    data, surface, truth = [], [], []
    for _ in range(3):
        p0 = random_matrix(rng, n, 0.15)
        a = cmath.exp(1j * rng.uniform(0.0, 2.0 * math.pi)) * -1.0
        p = add_surface_multiples(p0, a)
        rel = [[x + a * y for x, y in zip(r0, rq)] for r0, rq in zip(p0, la.matmul(p0, p))]
        assert max_diff(rel, p) < 1e-12
        data.append(p)
        surface.append(a)
        truth.append(p0)
    out = srme(data, surface)
    for o, t in zip(out, truth):
        assert max_diff(o, t) < 1e-12
    out_it = srme(data, surface, iters=60)
    for o, t in zip(out_it, truth):
        assert max_diff(o, t) < 1e-9


def test_direct_and_iterative_agree():
    rng = random.Random(2)
    p = random_matrix(rng, 5, 0.1)
    a = -0.8 + 0.3j
    d = srme_direct(p, a)
    it = srme_iterative(p, a, 80)
    assert max_diff(d, it) < 1e-10


def test_adaptive_scalar_is_close_to_the_true_operator():
    # Minimum-energy subtraction is a heuristic: it lands near, not on, a = -1.
    n, tau, r = 64, 8, 0.5
    data = [[[v]] for v in one_reflector_spectrum(n, tau, r)]
    p0 = data
    s = 0j
    for _ in range(6):
        pred = [[[q[0][0] * p[0][0]]] for q, p in zip(p0, data)]
        s = estimate_surface_scalar(data, pred)
        p0 = [[[p[0][0] - s * m[0][0]]] for p, m in zip(data, pred)]
    assert abs(s + 1.0) < 0.1
    assert abs(s.imag) < 1e-12

History

Verschuur, Berkhout and Wapenaar (1992) published surface-related multiple elimination in its adaptive form. They wrote the data at one frequency as a matrix, modeled the surface multiples as a feedback of the data through the free surface, and removed them by a series or an iteration, with the source and surface terms estimated from the data by minimum energy. The method became a standard way to remove surface multiples from marine data.

References

  1. D. J. Verschuur, A. J. Berkhout and C. P. A. Wapenaar, Adaptive surface-related multiple elimination, Geophysics 57(9), 1992, 1166 to 1177, the matrix model of surface multiples, their prediction by a multidimensional convolution of the data with itself, the series and iterative forms, and the adaptive estimate of the surface operator
  2. Oz Yilmaz, Seismic Data Analysis, Society of Exploration Geophysicists, 2001, Investigations in Geophysics 10, the chapter on multiple attenuation (surface-related multiple elimination)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.average
  • a full proof of time.best
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • at least three sources
  • a scene preset for the example