Skip to content

update ksw/cosmo.py/compute_transfer_tensor#1

Open
KeyiDing25 wants to merge 28 commits into
masterfrom
dky2
Open

update ksw/cosmo.py/compute_transfer_tensor#1
KeyiDing25 wants to merge 28 commits into
masterfrom
dky2

Conversation

@KeyiDing25

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread src/estimator.c

float complex get_alm_entry_sp(const float complex *a_ell_m,
int nell, int ell, int m){

@AdriJD AdriJD Mar 26, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is not quite correct I think. You can say generally that if the absolute value of m is larger or equal to nell that the returned value should be 0 + 0i. So put that check in before you have the if statements for m >=0 and m < 0. Right now that check is only done for mp and not for m. Also, if (mp >= nell) will never be true because mp is always < 0 I think

So an easier way would be:

Check if abs(m) >= nell: if yes, return 0 + 0i
Check if m >=0
if yes, return a_ell_m[ell * nell + m]
if false, return (m % 2) ? -conjf(a_ell_m[ell * nell + m]) : conjf(a_ell_m[ell * nell + m])

Comment thread src/estimator.c Outdated

ptrdiff_t total = (ptrdiff_t) npol * ndeltaL * nL * m_dim;
for (ptrdiff_t idx=0; idx<total; idx++){
out[idx] = 0.f + 0.f * I;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please indent the inner parts of for loops. It becomes very hard to see what parts are inside or outside the loop otherwise

so do:

for (ptrdiff_t idx=0; idx<total; idx++){
    out[idx] = 0.f + 0.f * I;
}

…d ndeltaL and deltaL_list from parameter list
… finish first version of compute_estimate_sst. I still need to add all the coefficients and to edit the code for kappa functionals. Also need to add the other half combinations of ma, mb and M in wigner 3j symbols.
…um_scalar_dL,_parse_prim_reduced_bispec_tensor to cosmo.py, edited _init_reduced_bispectrum in estimator.py and factors in cosmo.py to extend dim of factors to 4 for tensor case. And made several necessary minor changes when debugging. Added pol to T,E,B. Added a test for compute_estimator_sst.
KeyiDing24 added 9 commits May 7, 2026 15:04
…radial_functional.pyx/pxd undo), deleted compute_A_LM function in cython file estimator_core.pyx and deleted n_L_phi_scalar/tensor from cython and python interface.
…take real value for t_cubic in C and multiply by 2/6 now, added a test function, finished updating documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants