Generator
- class cosmax.spectral_ops.Generator(elements: int, size: float = 1.0)
Bases:
SpectralOperation
Generates initial conditions given a power spectrum
- Parameters:
elements – number of grid points in each dimension
size – size of the box in real space
- elements
number of grid points in each dimension
- Type:
int
- size
size of the box in real space
- Type:
float
- k
wavenumber of each bin
- index_grid
index of the bin for each wavenumber
- Type:
jax.Array
Methods Summary
__call__
(field, Pk)Generate a 3D density for a given power spectrum.
Methods Documentation
- __call__(field: Array, Pk: Array) Array
Generate a 3D density for a given power spectrum.
- Parameters:
field – 3D density field to be perturbed
Pk – power spectrum
- Returns:
3D density field