I have a .xyz file for a trajectory and I want to perform block analysis on it, and to find the decorrelation time and to perform analysis on that as well.

What software can I use to perform block analysis?

  • 2
    $\begingroup$ Can you be more specific about what kind of calculation you want to do? Because it sounds like what you want is to compute the position autocorrelation which can give you a decoherence time. You might want to compute the velocity autocorrelation which can give you the decoherence of the velocities. There is software for any of these, but it's not quite clear what you're looking for. $\endgroup$
    – jheindel
    Oct 2, 2020 at 0:50
  • $\begingroup$ @jheindel I think I need to find the decoherence time $\endgroup$
    – fireball.1
    Oct 2, 2020 at 8:01

1 Answer 1



This simple Python code does a Flyvbjerg-Petersen blocking analysis on column(s) of data. It is also used in some larger softwae packages, such as NECI.

You can run the code with the following command if you have just one column of data:

python blocking.py -f180000 -d5 -o/ file.out

where in this case 180000 is the line in file.out at which you want to begin the blocking analysis, and -d5 tells the program that you want to apply the blocking analysis to column 5 of the data in file.out.

If you want to do the blocking analysis on a ratio, then the command would be:

python blocking.py -f180000 -d1 -d5 -o/ file.out

where here we are doing column 1 divided by column 5.

I have several examples on my GitHub page, for example in this folder, you can see that I applied the above commands to the file RDMEstimates.uniform and the result of the blocking analysis was printed to the file blockingResult.txt.

See also:

  • $\begingroup$ what if I want to do blocking on a trajectory with PBC - i.e. 3 columns(x,y,z) while taking in consideration the periodic boundary conditions. Also each config in the trajectory has 192 atoms ( I am assuming the comparison needs to be in the position of the same atoms in different configs) $\endgroup$
    – fireball.1
    Oct 7, 2020 at 9:42
  • $\begingroup$ Sorry I missed this comment! I totally don't remember seeing it. I'm not very much sure for that specific scenario, I typically do blocking analysis for Monte Carlo calculations! $\endgroup$ Jan 22, 2021 at 20:59
  • $\begingroup$ What commodity do you usually do block analysis against ? $\endgroup$
    – fireball.1
    Jan 22, 2021 at 21:28
  • $\begingroup$ Perhaps we can continue this discussion in this chat room: chat.stackexchange.com/rooms/117114/…, as I think my answer won't be easily understood in a comment. You can write something there to let me know when you get there! $\endgroup$ Jan 22, 2021 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .