@@ -215,27 +215,25 @@ def main():
215
215
# In case we have a second order integration scheme, we remove the velocity for plotting
216
216
x_t_det_no_vel = x_t_det [:, :, :system .A .shape [0 ]]
217
217
218
+ key , path_key = jax .random .split (key )
219
+ x_t_stoch = setup .sample_paths (state_q , x_0 , args .dt , args .T , args .BS , path_key )
220
+ x_t_stoch_no_vel = x_t_stoch [:, :, :system .A .shape [0 ]]
221
+ np .save (f'{ args .save_dir } /stochastic_paths.npy' , x_t_stoch_no_vel )
222
+
218
223
if system .mdtraj_topology :
219
224
save_trajectory (system .mdtraj_topology , x_t_det_no_vel [0 ].reshape (1 , - 1 , 3 ), f'{ args .save_dir } /det_0.pdb' )
220
225
save_trajectory (system .mdtraj_topology , x_t_det_no_vel [- 1 ].reshape (1 , - 1 , 3 ), f'{ args .save_dir } /det_-1.pdb' )
221
226
227
+ save_trajectory (system .mdtraj_topology , x_t_stoch_no_vel [0 ].reshape (1 , - 1 , 3 ), f'{ args .save_dir } /stoch_0.pdb' )
228
+ save_trajectory (system .mdtraj_topology , x_t_stoch_no_vel [- 1 ].reshape (1 , - 1 , 3 ), f'{ args .save_dir } /stoch_-1.pdb' )
229
+
222
230
if system .plot :
223
231
plot_energy (system , [x_t_det_no_vel [0 ], x_t_det_no_vel [- 1 ]], args .log_plots )
224
232
show_or_save_fig (args .save_dir , 'path_energy_deterministic' , args .extension )
225
233
226
234
system .plot (title = 'Deterministic Paths' , trajectories = x_t_det_no_vel )
227
235
show_or_save_fig (args .save_dir , 'paths_deterministic' , args .extension )
228
236
229
- key , path_key = jax .random .split (key )
230
- x_t_stoch = setup .sample_paths (state_q , x_0 , args .dt , args .T , args .BS , path_key )
231
- x_t_stoch_no_vel = x_t_stoch [:, :, :system .A .shape [0 ]]
232
- np .save (f'{ args .save_dir } /stochastic_paths.npy' , x_t_stoch_no_vel )
233
-
234
- if system .mdtraj_topology :
235
- save_trajectory (system .mdtraj_topology , x_t_stoch_no_vel [0 ].reshape (1 , - 1 , 3 ), f'{ args .save_dir } /stoch_0.pdb' )
236
- save_trajectory (system .mdtraj_topology , x_t_stoch_no_vel [- 1 ].reshape (1 , - 1 , 3 ), f'{ args .save_dir } /stoch_-1.pdb' )
237
-
238
- if system .plot :
239
237
plot_energy (system , [x_t_stoch_no_vel [0 ], x_t_stoch_no_vel [- 1 ]], args .log_plots )
240
238
show_or_save_fig (args .save_dir , 'path_energy_stochastic' , args .extension )
241
239
0 commit comments