pisces.math_utils.random_fields#

Support for generating random fields and related utilities.

This module provides base classes and helper functions for constructing random fields on regular grids, with particular emphasis on Gaussian Random Fields (GRFs) specified by an input power spectrum.

Overview#

The key abstraction is the RandomField base class, which defines the spatial domain, Fourier-space utilities, and interface for generating random fields. A concrete implementation, GaussianRandomField, generates realizations of Gaussian random fields by sampling complex Fourier coefficients consistent with a chosen power spectrum, followed by an inverse FFT to real space.

This framework is useful in astrophysical and cosmological applications (e.g. generating initial conditions for magnetic fields in galaxy clusters), as well as in more general stochastic modeling contexts where random fields with prescribed statistics are needed.

Functions

generate_gaussian_cutoff_power_spectrum([...])

Generate a Gaussian-cutoff power spectrum function.

generate_kolmogorov_power_spectrum([...])

Generate a Kolmogorov-like turbulence power spectrum function.

generate_power_law_power_spectrum([...])

Generate a power-law power spectrum function.

generate_white_noise_power_spectrum([amplitude])

Generate a white-noise (flat) power spectrum function.

generate_zh11_power_spectrum([amplitude, k0, k1])

Generate a Kolmogorov-like power spectrum following ZuHone et al. (2011).

Classes

GaussianRandomField(domain_dimensions, ...)

Class for generating Gaussian random fields in arbitrary dimensions.

GaussianRandomVectorField(domain_dimensions, ...)

Class for generating Gaussian random vector fields in arbitrary dimensions.

RandomField(domain_dimensions, bounding_box, ...)

Abstract base class for defining random fields in arbitrary dimensions.