Linear Operators

We provide a collection of linear operators with efficient JAX based implementations that are relevant in standard signal/image processing problems. We also provide a bunch of utilities to combine and convert linear operators.

This module is inspired by pylops although the implementation approach is different.

A linear operator \(T : X \to Y\) connects a model space \(X\) to a data space \(Y\).

A linear operator satisfies following laws:

\[T (x + y) = T (x) + T (y)\]
\[T (\alpha x) = \alpha T(x)\]

Thus, for a general linear combination:

\[T (\alpha x + \beta y) = \alpha T (x) + \beta T (y)\]

We are concerned with linear operators \(T : \mathbb{F}^n \to \mathbb{F}^m\) where \(\mathbb{F}\) is either the field of real numbers or complex numbers. \(X = \mathbb{F}^n\) is the model space and \(Y = \mathbb{F}^m\) is the data space.

Such a linear operator can be represented by a two dimensional matrix \(A\).

The forward operation is given by:

\[y = A x.\]

The corresponding adjoint operation is given by:

\[\hat{x} = A^H y\]

We represent a linear operator by a pair of functions times and trans. The times function implements the forward operation while the trans function implements the adjoint operation.

An inverse problem consists of computing \(x\) given \(y\) and \(A\).

Data types

Operator

Represents a finite linear operator \(T : A -> B\) where \(A\) and \(B\) are finite vector spaces.

Basic operators

identity(m[, n])

Returns an identity linear operator from A to B

matrix(A)

Converts a two-dimensional matrix to a linear operator

diagonal(d)

Returns a linear operator which can be represented by a diagonal matrix

zero(m[, n])

Returns a linear operator which maps everything to 0 vector in data space

flipud(n)

Returns an operator which flips the order of entries in input upside down

sum(n)

Returns an operator which computes the sum of a vector

pad_zeros(n, before, after)

Adds zeros before and after a vector.

symmetrize(n)

An operator which constructs a symmetric vector by pre-pending the input in reversed order

restriction(n, indices)

An operator which computes y = x[I] over an index set I

Signal processing operators

fourier_basis_1d(n)

Returns an operator which represents the DFT orthonormal basis

dirac_fourier_basis_1d(n)

Returns an operator for a two-ortho basis dictionary consisting of Dirac basis and Fourier basis

Random compressive sensing operators

gaussian_dict(key, m, n[, normalize_atoms])

An operator which represents a Gaussian sensix matrix (with normalized columns)

rademacher_dict(key, m, n)

An operator which represents a Rademacher sensing matrix

random_onb_dict(key, n)

An operator representing a random orthonormal basis

random_orthonormal_rows_dict(key, m, n)

An operator whose rows are orthonormal (sampled from a random orthonormal basis)

Convenience operators

These operators are technically not linear on \(\mathbb{F}^n \to \mathbb{F}^m\)

real(n)

Returns the real parts of a vector of complex numbers

Operator algebra

neg(A)

Returns the negative of a linear operator \(T = -A\)

scale(A, alpha)

Returns the linear operator \(T = \alpha A\) for the operator \(A\)

add(A, B)

Returns the sum of two linear operators \(T = A + B\)

subtract(A, B)

Returns a linear operator \(T = A - B\)

compose(A, B)

Returns the composite linear operator \(T = AB\) such that \(T(x)= A(B(x))\)

transpose(A)

Returns the transpose of a given operator \(T = A^T\)

hermitian(A)

Returns the Hermitian transpose of a given operator \(T = A^H\)

hcat(A, B)

Returns the linear operator \(T = [A \, B]\)

power(A, p)

Returns the linear operator \(T = A^p\)

Operator parts

column(T, i)

Returns the i-th column of the operator T

columns(T, indices)

Returns the i-th column of the operator T

Properties of a linear operator

These are still experimental and not efficient.

upper_frame_bound(T)

Computes the upper frame bound for a linear operator

Utilities

jit(operator)

Returns the same linear operator with compiled times and trans functions

to_matrix(A)

Converts a linear operator to a matrix

to_adjoint_matrix(A)

Converts the adjoint of a linear operator to a matrix

to_complex_matrix(A)

Converts a linear operator to a matrix in complex numbers