mirror of
https://github.com/DifferentiableUniverseInitiative/JaxPM.git
synced 2025-06-29 16:41: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
|
@ -52,7 +52,7 @@ def _initialize_pk(mesh_shape, box_shape, kedges, los):
|
|||
kshapes = np.eye(len(mesh_shape), dtype=np.int32) * -2 + 1
|
||||
kvec = [(2 * np.pi * m / l) * np.fft.fftfreq(m).reshape(kshape)
|
||||
for m, l, kshape in zip(mesh_shape, box_shape, kshapes)]
|
||||
kmesh = sum(ki**2 for ki in kvec)**0.5
|
||||
kmesh = jnp.sqrt(sum(ki**2 for ki in kvec))
|
||||
|
||||
dig = np.digitize(kmesh.reshape(-1), kedges)
|
||||
kcount = np.bincount(dig, minlength=len(kedges) + 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue