update ksw/cosmo.py/compute_transfer_tensor#1
Open
KeyiDing25 wants to merge 28 commits into
Open
Conversation
… use rpath and use FFTW_HOME env variable, removed unnecessary link arguments in makefile and replaced outdated np.string_ with np.bytes_
…pyx and add compute_transfer_tensor in ksw/cosmo.py
…put array. Added arguments to functions. Added npol.
…ersion, still not complete)
…sp_sst and the double precision version
AdriJD
reviewed
Mar 26, 2026
|
|
||
| float complex get_alm_entry_sp(const float complex *a_ell_m, | ||
| int nell, int ell, int m){ | ||
|
|
Owner
There was a problem hiding this comment.
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])
AdriJD
reviewed
Mar 26, 2026
|
|
||
| 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; |
Owner
There was a problem hiding this comment.
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.
…parameter list in cython functions
…. Specifying double precision now.
…. updated prefactors_product function.
…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.
…history by accident in my last push.
…A functional in Afunctionals.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.