Previous generation survey: SDSS
Current generation survey: DES
LSST precursor survey: HSC
“"amount of information" obtained about one random variable through observing the other random variable”
import tensorflow as tf
import flowpm
# Defines integration steps
stages = np.linspace(0.1, 1.0, 10, endpoint=True)
initial_conds = flowpm.linear_field(32, # size of the cube
100, # Physical size
ipklin, # Initial powerspectrum
batch_size=16)
# Sample particles and displace them by LPT
state = flowpm.lpt_init(initial_conds, a0=0.1)
# Evolve particles down to z=0
final_state = flowpm.nbody(state, stages, 32)
# Retrieve final density field
final_field = flowpm.cic_paint(tf.zeros_like(initial_conditions),
final_state[0])
def neural_nbody_ode(a, state):
pos = state[0]; vel = state[1]
#### Compute gravitational forces
delta = flowpm.cic_paint(tf.zeros([batch_size, nc, nc, nc]), pos)
delta_k = r2c3d(delta)
pot_k = delta_k * laplace_kernel(kvec) * longrange_kernel(kvec)
# Neural potential correction
pot_k = pot_k * (1 + apply_model(kvec, a))
######################################
forces = tf.stack([ flowpm.cic_readout(
c2r3d(pot_k *gradient_kernel(kvec, i)), pos)
for i in range(3) ], axis=-1)
forces = forces * 1.5 * cosmo.Omega_m
#######################################
#Computes the update of position (drift)
dpos = 1. / (a**3 * flowpm.tfbackground.E(cosmo, a)) * vel
#Computes the update of velocity (kick)
dvel = 1. / (a**2 * flowpm.tfbackground.E(cosmo, a)) * forces
return tf.stack([dpos, dvel], axis=0)
Thank you !