Computation time for Fqt with calculate_incoherent

Dear all,

I am trying to use dynasor to calculate the intermediate dynamic structure factor for water with the incoherent part. However, the code is taking extremely long to run. I have my code bellow and I would appreciate any suggestions that can help me reduce the computation time.

Regards!

traj = Trajectory('output.extxyz', trajectory_format='extxyz',atomic_indices='read_from_trajectory', frame_stop=5000)
q_points = get_spherical_qpoints(traj.cell, q_max=2, max_points=20000)
sample_raw = compute_dynamic_structure_factors(traj, q_points, dt = 10, window_size = 100,calculate_currents=True, calculate_incoherent=True)

Hi!

The incoherent part is pretty expensive in general.

From the “performance” tab in the documentation:

“If the incoherent part (calculate_incoherent=True) is evaluated calculations will typically scale as N_qpts * N_atoms * max_frames * time_window. The dynasor calculations will typically become slower when calculating the incoherent intermediate scattering function.”

There you can also see some benchmarks to figure out if you get reasonable performance on your system.

Under the installation tab you can read about some additional optimization you can try:

Thank you! I will check it out. :slight_smile:

To add to this, window step parameter can likely be set to 100-1000 without losing too much statistics and could speed up calculation by 100-1000x.

Also do you need 20,000 qpoints? If not reducing this number will also reduce time.