mirror of
https://github.com/DifferentiableUniverseInitiative/JaxPM.git
synced 2025-04-24 11:50:53 +00:00
remove fftk from kernels.py
This commit is contained in:
parent
da06f4dba8
commit
c99b2c3ef4
1 changed files with 0 additions and 18 deletions
|
@ -2,24 +2,6 @@ import jax.numpy as jnp
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
def fftk(shape, symmetric=True, finite=False, dtype=np.float32):
|
|
||||||
""" Return k_vector given a shape (nc, nc, nc) and box_size
|
|
||||||
"""
|
|
||||||
k = []
|
|
||||||
for d in range(len(shape)):
|
|
||||||
kd = np.fft.fftfreq(shape[d])
|
|
||||||
kd *= 2 * np.pi
|
|
||||||
kdshape = np.ones(len(shape), dtype='int')
|
|
||||||
if symmetric and d == len(shape) - 1:
|
|
||||||
kd = kd[:shape[d] // 2 + 1]
|
|
||||||
kdshape[d] = len(kd)
|
|
||||||
kd = kd.reshape(kdshape)
|
|
||||||
|
|
||||||
k.append(kd.astype(dtype))
|
|
||||||
del kd, kdshape
|
|
||||||
return k
|
|
||||||
|
|
||||||
|
|
||||||
def gradient_kernel(kvec, direction, order=1):
|
def gradient_kernel(kvec, direction, order=1):
|
||||||
"""
|
"""
|
||||||
Computes the gradient kernel in the requested direction
|
Computes the gradient kernel in the requested direction
|
||||||
|
|
Loading…
Add table
Reference in a new issue