pygeoinf: A Python Library for Geophysical Inference

pygeoinf is a Python library for solving geophysical inference and inverse problems in a coordinate-free, abstract framework. It leverages the mathematics of Hilbert spaces to provide a robust and flexible foundation for Bayesian and optimisation-based inference.

Overview

The core philosophy of pygeoinf is to separate the abstract mathematical structure of an inverse problem from its concrete numerical implementation. Instead of manipulating NumPy arrays directly, you work with high-level objects like HilbertSpace, LinearOperator, and GaussianMeasure. This allows you to write code that is more readable, less error-prone, and closer to the underlying mathematics.

The library is built on a few key concepts:

  • `HilbertSpace`: The foundational class. It represents a vector space with an inner product, but it abstracts away the specific representation of vectors (e.g., NumPy arrays, pyshtools grids).

  • `LinearOperator`: Represents linear mappings between Hilbert spaces. These are the workhorses of the library, supporting composition, adjoints, and matrix representations.

  • `GaussianMeasure`: Generalizes the multivariate normal distribution to abstract Hilbert spaces, providing a way to define priors and noise models.

  • `ForwardProblem`: Encapsulates the mathematical model d = A(u) + e, linking the unknown model u to the observed data d.

  • Inversion Classes: High-level classes like LinearBayesianInversion and LinearLeastSquaresInversion provide ready-to-use algorithms for solving the inverse problem.

Key Features

  • Abstract Coordinate-Free Formulation: Write elegant code that mirrors the mathematics of inverse problems.

  • Bayesian Inference: Solve inverse problems in a probabilistic framework to obtain posterior distributions over models.

  • Optimisation Methods: Includes Tikhonov-regularized least-squares and minimum-norm solutions.

  • Probabilistic Modelling: Define priors and noise models using GaussianMeasure objects on abstract spaces.

  • Randomized Algorithms: Utilizes randomized SVD and Cholesky decompositions for efficient low-rank approximations of large operators.

  • Application-Specific Spaces: Provides concrete HilbertSpace implementations for functions on a line, circle, and the two-sphere.

  • High-Quality Visualisation: Built-in plotting methods for functions on symmetric spaces, including map projections via cartopy.

## Tutorials

You can run the interactive tutorials directly in Google Colab to get started with the core concepts of the library.

Tutorial Name | Link to Colab |
:— | :— |