Truncated Fourier Series¤
exponax.ic.RandomTruncatedFourierSeries
¤
Bases: BaseRandomICGenerator
Source code in exponax/ic/_truncated_fourier_series.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
__init__
¤
__init__(
num_spatial_dims: int,
*,
cutoff: int = 5,
offset_range: tuple[int, int] = (0.0, 0.0),
std_one: bool = False,
max_one: bool = False
)
Random generator for initial states consisting of a truncated Fourier
series. White noise is drawn in physical space, transformed to Fourier
space, low-pass filtered up to cutoff, and transformed back.
Arguments:
num_spatial_dims: The number of spatial dimensionsd.cutoff: The cutoff of the wavenumbers. This limits the "complexity" of the initial state. Note that some dynamics are very sensitive to high-frequency information.offset_range: The range of the offsets. Defaults to(0.0, 0.0), meaning zero-mean by default.std_one: Whether to normalize the state to have a standard deviation of one. Defaults toFalse. Only works if the offset is zero.max_one: Whether to normalize the state to have the maximum absolute value of one. Defaults toFalse. Only one ofstd_oneandmax_onecan beTrue.
Source code in exponax/ic/_truncated_fourier_series.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
__call__
¤
__call__(
num_points: int, *, key: PRNGKeyArray
) -> Float[Array, "1 ... N"]
Source code in exponax/ic/_truncated_fourier_series.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |