mirror of
https://github.com/DifferentiableUniverseInitiative/JaxPM.git
synced 2025-06-30 00:51:11 +00:00
Replace np.power 0.5 by np.sqrt (#43)
* Switch **2 by np.sqrt * format --------- Co-authored-by: Francois Lanusse <fr.eiffel@gmail.com>
This commit is contained in:
parent
6693e5c725
commit
7d76573701
4 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue