Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try #6 #13

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tests/rigid_body_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@


from jax import config as jax_config
jax_config.update('jax_disable_jit', True)

import jax.numpy as jnp

Expand Down Expand Up @@ -240,9 +241,9 @@ def test_nve_2d_neighbor_list(self, dtype):
shape)
init_fn, step_fn = simulate.nve(energy_fn, shift)

# step_fn = jit(step_fn)
step_fn = jit(step_fn)

# @jit
@jit
def total_energy(state, nbrs):
pos = state.position
return (energy_fn(pos, neighbor=nbrs) +
Expand All @@ -252,7 +253,7 @@ def total_energy(state, nbrs):
state = init_fn(key, body, 1e-3, mass=shape.mass(), neighbor=nbrs)
E_initial = total_energy(state, nbrs)

# @jit
@jit
def step(i, state_nbrs):
state, nbrs = state_nbrs
nbrs = nbrs.update(state.position)
Expand Down Expand Up @@ -294,9 +295,9 @@ def test_nve_2d_neighbor_list_multi_atom_species(self, dtype):
shape)
init_fn, step_fn = simulate.nve(energy_fn, shift)

# step_fn = jit(step_fn)
step_fn = jit(step_fn)

# @jit
@jit
def total_energy(state, nbrs):
pos = state.position
return (energy_fn(pos, neighbor=nbrs) +
Expand All @@ -306,7 +307,7 @@ def total_energy(state, nbrs):
state = init_fn(key, body, 1e-3, mass=shape.mass(), neighbor=nbrs)
E_initial = total_energy(state, nbrs)

# @jit
@jit
def step(i, state_nbrs):
state, nbrs = state_nbrs
nbrs = nbrs.update(state.position)
Expand Down
Loading