Replace np.power 0.5 by np.sqrt (#43)
Some checks failed
Tests / run_tests (3.10) (push) Failing after 2m35s
Tests / run_tests (3.11) (push) Failing after 2m37s
Code Formatting / formatting (push) Successful in 3m1s
Tests / run_tests (3.12) (push) Failing after 1m16s

* Switch **2  by np.sqrt

* format

---------

Co-authored-by: Francois Lanusse <fr.eiffel@gmail.com>
This commit is contained in:
Wassim KABALAN 2025-06-29 10:51:45 +02:00 committed by GitHub
parent 6693e5c725
commit 7d76573701
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 5 deletions

View file

@ -96,8 +96,9 @@ def fpm_initial_conditions(cosmo, particle_mesh):
whitec = particle_mesh.generate_whitenoise(42,
type='complex',
unitary=False)
lineark = whitec.apply(lambda k, v: pk_fn(sum(ki**2 for ki in k)**0.5)**0.5
* v * (1 / v.BoxSize).prod()**0.5)
lineark = whitec.apply(lambda k, v: jnp.sqrt(
pk_fn(jnp.sqrt(sum(ki**2 for ki in k)))) * v * jnp.sqrt(
(1 / v.BoxSize).prod()))
init_mesh = lineark.c2r().value # XXX
return lineark, grid, init_mesh