pespace.inference.likelihood_ti¶
Taichi backend of the Whittle likelihood kernel.
This module contains the taichi kernel for the Whittle likelihood
computation, used by
LikelihoodBilbyInterfaceTaichi.
Important: this module must not use from __future__ import annotations
(PEP 563). Taichi parses kernel annotations at decoration time and requires
the actual annotation objects (e.g., ti.template()); with PEP 563 all
annotations become strings and the kernel definition fails with a
TaichiSyntaxError.
Functions
|
Compute the Whittle likelihood. |
- pespace.inference.likelihood_ti.compute_whittle_likelihood_ti(channels, observed_data, response_data, psd, df)[source]¶
Compute the Whittle likelihood.
- Parameters:
channels (ti.template()) – Specifying the TDI channels to iterate over. Used with
ti.static()for compile-time loop unrolling.observed_data (ti.template()) –
taichi.fieldcontaining the observed frequency-domain data for each channel. Expected to be a field ofti.types.vector(2, float)indexed by frequency bin and channel.response_data (ti.template()) –
taichi.fieldcontaining detector responses for each channel, having the same structure asobserved_data.psd (ti.template()) –
taichi.fieldcontaining the noise power spectral density for each channel. Expected to be a real-valued field indexed by frequency bin and channel.df (float) – Spacing between frequency bins in Hz.
- Returns:
The log-likelihood value computed using the Whittle approximation.
- Return type:
float
Notes
Uses Array-of-Structures (AoS) layout for
StructField, with the channel loop placed inside the frequency loop for optimal memory accessingAtomic operations are used to accumulate the log-likelihood to ensure thread safety in parallel execution