Triumvirate C++ API 0.5.0.post1.dev301+g026f21751
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
threept.hpp
Go to the documentation of this file.
1// Triumvirate: Three-Point Clustering Measurements in LSS
2//
3// Copyright (C) 2023 Mike S Wang & Naonori S Sugiyama [GPL-3.0-or-later]
4//
5// This file is part of the Triumvirate program. See the COPYRIGHT
6// and LICENCE files at the top-level directory of this distribution
7// for details of copyright and licensing.
8//
9// This program is free software: you can redistribute it and/or modify it
10// under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// This program is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17// See the GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with this program. If not, see <https://www.gnu.org/licenses/>.
21
38
39#ifndef TRIUMVIRATE_INCLUDE_THREEPT_HPP_INCLUDED_
40#define TRIUMVIRATE_INCLUDE_THREEPT_HPP_INCLUDED_
41
42#include <fftw3.h>
43
44#include <cmath>
45#include <complex>
46#include <cstdio>
47
48#include "monitor.hpp"
49#include "parameters.hpp"
50#include "maths.hpp"
51#include "particles.hpp"
52#include "dataobjs.hpp"
53#include "field.hpp"
54#include "twopt.hpp"
55
57#ifdef __GNUC__
58#define PURE __attribute__((pure))
59#else
60#define PURE
61#endif
63
64namespace trv {
65
66// ***********************************************************************
67// Spherical orders
68// ***********************************************************************
69
75 int m1, m2, M;
76
82
87 PURE bool is_zeros();
88
93 PURE bool is_inverse(const SphericalOrderTriplet& other);
94};
95
96
97// ***********************************************************************
98// Coupling coefficients
99// ***********************************************************************
100
116 int ell1, int ell2, int ELL, int m1, int m2, int M
117);
118
125
126
127// ***********************************************************************
128// Normalisation
129// ***********************************************************************
130
139 ParticleCatalogue& particles, double alpha = 1.
140);
141
151 ParticleCatalogue& particles, trv::ParameterSet& params, double alpha = 1.
152);
153
154
155// ***********************************************************************
156// Shot noise
157// ***********************************************************************
158
191std::complex<double> calc_ylm_wgtd_shotnoise_amp_for_bispec(
192 ParticleCatalogue& particles_data, ParticleCatalogue& particles_rand,
193 LineOfSight* los_data, LineOfSight* los_rand,
194 double alpha, int ell, int m
195);
196
210std::complex<double> calc_ylm_wgtd_shotnoise_amp_for_bispec(
211 ParticleCatalogue& particles, LineOfSight* los,
212 double alpha, int ell, int m
213);
214
215
216// ***********************************************************************
217// Full statistics
218// ***********************************************************************
219
220// STYLE: Standard naming convention is not always followed for
221// intermediary quantities in the functions below.
222
223// Hereafter 'the Paper' refers to Sugiyama et al. (2019) [1803.02132].
224
238 ParticleCatalogue& catalogue_data, ParticleCatalogue& catalogue_rand,
239 LineOfSight* los_data, LineOfSight* los_rand,
240 trv::ParameterSet& params, trv::Binning& kbinning,
241 double norm_factor
242);
243
258 ParticleCatalogue& catalogue_data, ParticleCatalogue& catalogue_rand,
259 LineOfSight* los_data, LineOfSight* los_rand,
260 trv::ParameterSet& params, trv::Binning& rbinning,
261 double norm_factor
262);
263
275 ParticleCatalogue& catalogue_data,
276 trv::ParameterSet& params, trv::Binning kbinning,
277 double norm_factor
278);
279
291 ParticleCatalogue& catalogue_data,
292 trv::ParameterSet& params, trv::Binning& rbinning,
293 double norm_factor
294);
295
311 ParticleCatalogue& catalogue_rand, LineOfSight* los_rand,
312 trv::ParameterSet& params, trv::Binning& rbinning,
313 double alpha, double norm_factor, bool wide_angle = false
314);
315
316#ifdef TRV_USE_LEGACY_CODE
332trv::BispecMeasurements compute_bispec_for_los_choice(
333 ParticleCatalogue& catalogue_data, ParticleCatalogue& catalogue_rand,
334 LineOfSight* los_data, LineOfSight* los_rand,
335 int los_choice,
336 trv::ParameterSet& params, trv::Binning& kbinning,
337 double norm_factor
338);
339#endif // TRV_USE_LEGACY_CODE
340
341} // namespace trv
342
343#endif // !TRIUMVIRATE_INCLUDE_THREEPT_HPP_INCLUDED_
Isotropic coordinate binning.
Definition dataobjs.hpp:58
Parameter set.
Particle catalogue.
Definition particles.hpp:78
Clustering measurement data objects.
Mesh field (with one-point statistics) and pseudo two-point statistics.
Mathematical calculations.
Provide tracking of program resources and exceptions.
double calc_coupling_coeff_3pt(int ell1, int ell2, int ELL, int m1, int m2, int M)
Calculate the coupling coefficient for spherical-harmonic components of full three-point statistics.
Definition threept.cpp:65
double calc_bispec_normalisation_from_particles(ParticleCatalogue &particles, double alpha=1.)
Calculate particle-based bispectrum normalisation.
Definition threept.cpp:96
std::complex< double > calc_ylm_wgtd_shotnoise_amp_for_bispec(ParticleCatalogue &particles_data, ParticleCatalogue &particles_rand, LineOfSight *los_data, LineOfSight *los_rand, double alpha, int ell, int m)
Calculate bispectrum shot noise amplitude weighted by reduced spherical harmonics.
Definition threept.cpp:156
trv::ThreePCFMeasurements compute_3pcf_in_gpp_box(ParticleCatalogue &catalogue_data, trv::ParameterSet &params, trv::Binning &rbinning, double norm_factor)
Compute three-point correlation function in a periodic box in the global plane-parallel approximation...
Definition threept.cpp:2190
trv::BispecMeasurements compute_bispec_in_gpp_box(ParticleCatalogue &catalogue_data, trv::ParameterSet &params, trv::Binning kbinning, double norm_factor)
Compute bispectrum in a periodic box in the global plane-parallel approximation.
Definition threept.cpp:1473
trv::ThreePCFWindowMeasurements compute_3pcf_window(ParticleCatalogue &catalogue_rand, LineOfSight *los_rand, trv::ParameterSet &params, trv::Binning &rbinning, double alpha, double norm_factor, bool wide_angle=false)
Compute three-point correlation function window from a random catalogue.
Definition threept.cpp:2621
double calc_bispec_normalisation_from_mesh(ParticleCatalogue &particles, trv::ParameterSet &params, double alpha=1.)
Calculate mesh-based bispectrum normalisation.
Definition threept.cpp:138
trv::BispecMeasurements compute_bispec(ParticleCatalogue &catalogue_data, ParticleCatalogue &catalogue_rand, LineOfSight *los_data, LineOfSight *los_rand, trv::ParameterSet &params, trv::Binning &kbinning, double norm_factor)
Compute bispectrum from paired survey-type catalogues.
Definition threept.cpp:248
void validate_multipole_coupling(trv::ParameterSet &params)
Validate three-point correlator multipoles are non-vanishing.
Definition threept.cpp:73
trv::ThreePCFMeasurements compute_3pcf(ParticleCatalogue &catalogue_data, ParticleCatalogue &catalogue_rand, LineOfSight *los_data, LineOfSight *los_rand, trv::ParameterSet &params, trv::Binning &rbinning, double norm_factor)
Compute three-point correlation function from paired survey-type catalogues.
Definition threept.cpp:1014
Program parameter configuration.
Particle containers with I/O methods and operations.
Bispectrum measurements.
Definition dataobjs.hpp:249
Line-of-sight vector.
Definition dataobjs.hpp:186
Spherical order triplet .
Definition threept.hpp:74
bool is_zeros()
Check if the spherical orders are all zeros.
Definition threept.cpp:49
SphericalOrderTriplet operator+(const SphericalOrderTriplet &other)
Return the sum with another spherical order triplet.
Definition threept.cpp:40
int M
spherical orders
Definition threept.hpp:75
bool is_inverse(const SphericalOrderTriplet &other)
Check if another triplet is the additive inverse.
Definition threept.cpp:53
Three-point correlation function measurements.
Definition dataobjs.hpp:267
Three-point correlation function window measurements.
Definition dataobjs.hpp:288
Two-point statistic computations.