Numerics
The ‘numerics’ parameter category contains parameters specifying various options regarding the numerical methods used within the simulation, as well as some numerical resolutions and length scales.
boxsize
Description |
Specifies size of simulation box |
||
Default |
512*Mpc
|
||
Elaboration |
All CONCEPT simulations take place within a cubic
box of constant comoving side length
|
||
Example 0 |
Use a box size of boxsize = 1024*Mpc
|
||
Example 1 |
Use a box size of
boxsize = 1*Gpc
|
||
Example 2 |
Use a box size of boxsize = 1024*Mpc/h
With e.g.
boxsize = 1600*Mpc
Note See the |
potential_options
Description |
Specifications for potential computations |
||
Default |
{
'gridsize': {
'global': {},
'particles': {
'gravity': {
'pm' : ( 'cbrt(Ñ)', 'cbrt(Ñ)'),
'p3m': ('2*cbrt(Ñ)', '2*cbrt(Ñ)'),
},
'lapse': {
'pm': ('cbrt(Ñ)', 'cbrt(Ñ)'),
},
},
'fluid': {
'gravity': {
'pm': ('gridsize', 'gridsize'),
},
'lapse': {
'pm': ('gridsize', 'gridsize'),
},
},
},
'interpolation': {
'gravity': {
'pm' : 'CIC',
'p3m': 'CIC',
},
'lapse': {
'pm': 2,
},
},
'deconvolve': {
'gravity': {
'pm' : (True, True),
'p3m': (True, True),
},
'lapse': {
'pm': (True, True),
},
},
'interlace': {
'gravity': {
'pm' : (False, False),
'p3m': (False, False),
},
'lapse': {
'pm': (False, False),
},
},
'differentiation': {
'default': {
'gravity': {
'pm' : 2,
'p3m': 4,
},
'lapse': {
'pm': 2,
},
},
},
}
|
||
Elaboration |
This parameter is a Potentials are discretised on grids in order to implement long-range interactions. Note Currently, two distinct long-range
interactions/forces are implemented; In CONCEPT a long-range interaction takes place between two groups of components; the suppliers and the receivers, which respectively build the potential and receive a force due to it. In the simplest case of self-gravity between particles of a single component, this component is both the sole supplier and receiver component. CONCEPT uses an ‘upstream
For receivers obtaining the force grid from the downstream real-space potential grid:
For receivers obtaining the force grid from the downstream Fourier-space potential:
Note Though the above recipe is conceptually faithful to the actual implementation in CONCEPT, typically many of the steps can be combined, reducing the total number of steps (and grids in memory) significantly. In all cases, CONCEPT collapses the above procedure to its minimal equivalence, which in simple (typical) cases among other things leaves out the upstream and downstream potentials completely and combines the two deconvolutions into one. With the implemented potential scheme outlined above,
the different sub-parameters of the
|
||
Example 0 |
Use default potential options, but set the global
gravitational P³M potential grid size to potential_options = {
'gridsize': {
'global': {
'gravity': {
'p3m': 128,
},
},
},
}
This can be shortened to potential_options = {
'gridsize': {
'global': {
'gravity': 128,
},
},
}
though now both the P³M and PM method of gravity gets a
global grid size of potential_options = {
'gridsize': {
'global': 128,
},
}
Here it will be detected that no force/interaction has
been specified, in which case the default one
— potential_options = {
'gridsize': 128,
}
though this now also sets potential_options = 128
|
||
Example 1 |
Use default potential options, but set the
gravitational P³M potential grid size to potential_options = {
'gridsize': {
'global': {
'gravity': {
'pm' : 64,
'p3m': 128,
},
},
'matter': {
'gravity': {
'p3m': (128, 128),
},
},
},
}
Note As the upstream and downstream grid size within the 2-tuple are identical, this can be shortened to potential_options = {
'gridsize': {
'global': {
'gravity': {
'pm' : 64,
'p3m': 128,
},
},
'matter': {
'gravity': {
'p3m': 128,
},
},
},
}
Note This further assigns |
||
Example 2 |
For the gravitational interaction, be it PM or P³M, make
use of the highest available order for particle
interpolation (PCS), as well as both upstream and
downstream (standard) interlacing. Use potential_options = {
'gridsize': 80,
'interpolation': {
'gravity': 'PCS',
},
'interlace': {
'gravity': (True, True), # or ('bcc', 'bcc')
}
}
|
||
Example 3 |
Use potential_options = {
'gridsize': 128,
'differentiation': {
'all': {
'gravity': {
'pm' : 6,
'p3m': 'Fourier',
},
},
},
}
|
shortrange_params
Description |
Specifications for short-range forces |
||
Default |
{
'gravity': {
'scale' : '1.25*boxsize/gridsize',
'range' : '4.5*scale',
'tilesize' : 'range',
'subtiling': ('automatic', 16),
'tablesize': 4096,
},
}
|
||
Elaboration |
This parameter is a Each of the sub-parameters are described below.
|
||
Example 0 |
Extend shortrange_params = {
'gravity': {
'scale': '1.25*boxsize/gridsize',
'range': '5.5*scale',
},
}
We can shorten the above to shortrange_params = {
'scale': '1.25*boxsize/gridsize',
'range': '5.5*scale',
}
in which case Note In both cases, the remaining sub-parameters will receive default values |
||
Example 1 |
Use a fixed subtile decomposition of
shortrange_params = {
'subtiling': (3, 3, 3),
}
As all three subdivisions are equal, this can be shortened to shortrange_params = {
'subtiling': 3,
}
While probably a bit slower than using automatic subtile refinement, this subtile decomposition has the benefit of being static and thus deterministic. |
||
Example 2 |
Use dynamic subtile refinement with a period
of shortrange_params = {
'subtiling': ('automatic', 8),
}
|
powerspec_options
Description |
Specifications for power spectrum computations and dumps |
||
Default |
{
'upstream gridsize': {
'particles': '2*cbrt(Ñ)',
'fluid' : 'gridsize',
},
'global gridsize': {},
'interpolation': {
'default': 'PCS',
},
'deconvolve': {
'default': True,
},
'interlace': {
'default': True,
},
'realization correction': {
'default': True,
},
'k_max': {
'default': 'nyquist',
},
'bins per decade': {
'default': {
' 4*k_min': 4,
'100*k_min': 40,
},
},
'tophat': {
'default': 8*Mpc/h,
},
'significant figures': {
'default': 8,
},
}
|
||
Elaboration |
This is a For computing a power spectrum, one or more components
are first interpolated onto individual upstream grids,
possibly using deconvolution and interlacing, after
which they are added together in Fourier space,
producing a global grid. This scheme is similar to the
one used for potentials, except here we never go back to
real space, neither do we interpolate anything back to
the particles. See the Each sub-parameter is described below:
Note For all sub-parameters above except
|
||
Example 0 |
Use an upstream grid size of powerspec_options = {
'upstream gridsize': {
'matter': 256,
},
}
As we did not specify a global grid size, this will
similarly be powerspec_options = {
'gridsize': {
'matter': 256,
},
}
Here |
||
Example 1 |
Employ many (small) bins of the same (logarithmic) size
for all powerspec_options = {
'bins per decade': {
'all' : 100,
'all combinations': ...,
},
}
This may be shortened to powerspec_options = {
'bins per decade': 100,
}
|
||
Example 2 |
Use CIC interpolation and disable interlacing for power
spectra of the component with a name/species of
powerspec_options = {
'interpolation': {
'matter': 'CIC',
},
'interlace': {
'matter': False, # or 'sc'
}
}
|
bispec_options
Description |
Specifications for bispectrum computations and dumps |
||
Default |
{
'configuration': {
'default': ('equilateral', 20),
},
'shellthickness': {
'default': [
{
'1*k_fundamental': '0.25*k_fundamental',
'4*k_fundamental': 'max(3*k_fundamental, 1/20*log(10)*k)',
},
{
'1*k_fundamental': '0.25*k_fundamental',
'4*k_fundamental': 'max(3*k_fundamental, 1/20*log(10)*k)',
},
{
'1*k_fundamental': '0.25*k_fundamental',
'4*k_fundamental': 'max(3*k_fundamental, 1/20*log(10)*k)',
},
]
},
'upstream gridsize': {
'particles': '2*cbrt(Ñ)',
'fluid' : 'gridsize',
},
'global gridsize': {},
'interpolation': {
'default': 'PCS',
},
'deconvolve': {
'default': True,
},
'interlace': {
'default': True,
},
'significant figures': {
'default': 8,
},
}
|
||
Elaboration |
This is a For computing a bispectrum, one or more components are
first interpolated onto individual upstream grids,
possibly using deconvolution and interlacing, after
which they are added together in Fourier space,
producing a global grid. This scheme is similar to the
one used for potentials, except here we never go back to
real space, neither do we interpolate anything back to
the particles. See the Many of the sub-parameters are the same as within the
Note For all sub-parameters except
|
||
Example 0 |
Use the equilateral configurations for bispectra of the
component with a name/species of bispec_options = {
'configuration': {
'matter': 'equilateral',
},
}
If we want more control over the number of bispectrum
bins (the density of sampling points), we can specify
the number of bins/subdivisions per decade along the
bispec_options = {
'configuration': {
'matter': ('equilateral', 30),
},
}
Instead of using the predefined name bispec_options = {
'configuration': {
'matter': {
'k': 'logspace(log10(k_f), log10(nyquist), int(30*log10(nyquist/k_f)))',
't': 1,
'μ': 0.5,
},
},
}
The above specification for If we prefer, we might instead list each equilateral bin individually: _gridsize = 128 # global grid size for bispectrum
bispec_options = {
'configuration': {
'matter': [
(k, 1, 0.5)
for k in logspace(
log10(2*π/boxsize),
log10(2*π/boxsize*(_gridsize//2)),
int(30*log10(_gridsize//2)),
)
],
},
}
Note that in the above we have to reference the grid
size explicitly, whereas previously this was encoded in
_gridsize = 128 # global grid size for bispectrum
bispec_options = {
'configuration': {
'matter': [
(f'{q}*k_f', 1, 0.5)
for q in logspace(
0,
log10(_gridsize//2),
int(30*log10(_gridsize//2)),
)
],
},
}
|
||
Example 1 |
Use a constant shell thickness equal to three times the
fundamental frequency, for shell bispec_options = {
'shellthickness': {
'all' : ['3*k_f', '3*k_f', '3*k_f'],
'all combinations': ...,
},
}
This may be shortened to bispec_options = {
'shellthickness': ['3*k_f', '3*k_f', '3*k_f'],
}
or indeed bispec_options = {
'shellthickness': '3*k_f',
}
|
||
Example 2 |
Use the equilateral configurations for bispectra of the
component with a name/species of bispec_options = {
'configuration': {
'matter': ('equilateral', 30),
},
}
Ideally, the concentric shells of different bins should not overlap, as otherwise the same underlying modes will each contribute to multiple bins. At the same time, we would like to include all available modes within our bins, and so together they should cover all of configuration space, i.e. we want there to be no gaps between the concentric shells. Given the 30 logarithmically equidistant shell radii above, we can match the shell thicknesses in order to achieve this: bispec_options = {
'configuration': {
'matter': ('equilateral', 30),
},
'shellthickness': {
'matter': '1/30*log(10)*k',
},
}
Note that with the growing shell thickness above,
the usual shell thickness of bispec_options = {
'configuration': {
'matter': ('equilateral', 30),
},
'shellthickness': {
'matter': 'max(1.5*k_f, 1/30*log(10)*k)',
},
}
The above minimum shell thickness of
bispec_options = {
'configuration': {
'matter': ('equilateral', 30),
},
'shellthickness': {
'matter': {
'1*k_f': '0.25*k_f',
'10*k_f': 'max(1.5*k_f, 1/30*log(10)*k)',
},
},
}
Between the two control points Note the similarity with the above shell thickness settings and the default settings. |
||
Example 3 |
Measure the bispectrum for all isosceles configurations
— i.e. both L-isosceles and S-isosceles — for the
component with a name/species of bispec_options = {
'configuration': {
'matter': ['L-isosceles', 'S-isosceles'],
},
}
We might want to explicitly control the number of bins for each of two configuration subspaces: bispec_options = {
'configuration': {
'matter': [('L-isosceles', 15), ('S-isosceles', 25)],
},
}
Caution Due to the many possible configuration
specifications, the parsing of these specifications
is less robust than what is usually the case. In
particular, swapping ['L-isosceles', 'S-isosceles']
is a valid specification, this is not: ('L-isosceles', 'S-isosceles') # ❌
Note that the two sets of bins are written without separation in the output data file. However, the order in which the bins appear will always match the order in which they are specified. Tip For the case above (and most others), the transition
from one configuration subset to another within a
bispectrum data file can easily be located as the row
where |
||
Example 4 |
Use a squeezed configurations for bispectra of the
component with a name/species of bispec_options = {
'configuration': {
'matter': 'squeezed', # or e.g. (squeezed, 20)
},
}
The squeezed configurations are more tricky than other
configurations, as the bispec_options = {
'configuration': {
'matter': {
'k': (
'logspace(log10(5*k_f), '
'log10(2/3*nyquist), '
'int(20*log10(2/3*nyquist/(5*k_f))))'
),
't': 1,
'μ': 0.95,
},
},
}
In the above we have kept the With bispec_options = {
'configuration': {
'matter': {
'k': (
'logspace(log10(5*k_f), '
'log10(2/3*nyquist), '
'int(20*log10(2/3*nyquist/(5*k_f))))'
),
't': 1,
'μ': 0.95,
},
},
'shellthickness': {
'matter': ['3*k_f', '3*k_f', '1.5*k_f'],
},
}
|
||
Example 5 |
Imitate the way Pylians computes bispectra:
Use _k1 = 1.1*h/Mpc
_k2 = 0.8*h/Mpc
_θ = linspace(0, π, 50)
bispec_options = {
'configuration': {
'matter': {
'k': _k1,
't': _k2/_k1,
'μ': -cos(_θ),
},
},
'shellthickness': {
'matter': '2*k_f',
},
}
Note In order to fully reduce the bispectrum computation within CONCEPT to one consistent with that of Pylians, one should further:
|
||
Example 6 |
Sample the full configuration space for the component
with a name/species of bispec_options = {
'configuration': {
'matter': ('all', 5),
},
}
We recall that the full configuration space is parametrised as which uniquely covers each configuration (triangle
shape) for a given np.random.seed(42) # for consistent bins
def _sample():
r = np.random.random(3)
k = f'k_min*(k_max/k_min)**{r[0]}'
t = (1 + r[1])/2
μ = (1 + r[2])/2
if t*μ < 0.5:
return _sample()
return k, t, μ
bispec_options = {
'configuration': {
'matter': [_sample() for _ in range(100)],
},
}
Note that the above samples the entire possible
|
bispec_antialiasing
Description |
Specifies whether to enable anti-aliasing for bispectrum shells |
||
Default |
True
|
||
Elaboration |
Numerically, each bispectrum shell is a collection of
Fourier grid cells, each positioned a distance (measured
from their centres) of about The simple scheme for cell inclusion/exclusion within a shell described above comes with a number of drawbacks, arising from allowing the discrete nature of the underlying grid to spread into the shell. A more sophisticated approach is to treat the shells as being truly spherical and continuous, with cells on the boundary being taken into account in proportion to their volumetric overlap with the shell. This is what we refer to as shell anti-aliasing (enabled by default). Note that with shell anti-aliasing, the inner and outer
shell radii — related by their difference equalling
the shell thickness Note For all but the smallest |
||
Example 0 |
Turn off bispectrum shell anti-aliasing: bispec_antialiasing = False
Though generally not preferable, this is useful if the resulting bispectra are to be compared with ones computed by a different code which does not have this feature. |
class_dedicated_spectra
Description |
Specifies whether to carry out a dedicated CLASS computation for use with perturbation theory spectra |
||
Default |
False
|
||
Elaboration |
When Note This will only affect the perturbation theory output in power spectrum and bispectrum data files; the CLASS data used internally for simulation purposes will always be complete. |
||
Example 0 |
Always rerun CLASS as necessary, ensuring fully populated perturbation theory data in spectral output: class_dedicated_spectra = True
|
class_modes_per_decade
Description |
Number of Fourier modes |
||
Default |
{
3e-3/Mpc: 10,
3e-2/Mpc: 30,
3e-1/Mpc: 30,
1/Mpc: 10,
}
|
||
Elaboration |
This parameter determines the number of CLASS
perturbations to compute, by specifying the density
of Fourier modes If you seek highly resolved linear power spectra or
tree-level, make sure to not just increase
|
||
Example 0 |
Use a constant class_modes_per_decade = 20
|
||
Example 1 |
Use class_modes_per_decade = {
1e-4/Mpc: 50,
1e+1/Mpc: 10,
}
|